using System.Web.Mvc; using Kreta.BusinessLogic.Helpers; using Kreta.BusinessLogic.Security; using Kreta.Web.Areas.Hianyzas.Models; using Kreta.Web.Areas.Tanulo.Helper; using Kreta.Web.Helpers; using Kreta.Web.Helpers.Modal; using Kreta.Web.Models.EditorTemplates; using Kreta.Web.Security; namespace Kreta.Web.Areas.Hianyzas.Controllers { [MvcRoleClaimsAuthorize(true)] [MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)] [MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)] public class FelmentesekController : Controller { #region Properties public static string GridName => "FelmentesekGrid"; public static string SearchFormName => "searchForm"; public static string NewModifyPopupName => "New_Modify_Popup"; public static string NewModifyFormName => "FelmentesekNewModifyForm"; #endregion Properties public ActionResult Index() { var model = new FelmentesekSearchModel(); return View(model); } public ActionResult ModFelmentes(int id) { var model = TanuloLogic.GetFelmentes(id); var pm = new PopUpModel(model, "_Felmentes_Bevitel"); pm.Buttons.Add(new ModalButtonModel() { Name = "BtnFelmentesCancel", Text = Resources.CommonResource.Megse, EventName = "FelmentesekHelper.modFelmentesCancel" }); pm.Buttons.Add(new ModalButtonModel() { Name = "BtnFelmentesOk", Text = Resources.CommonResource.Mentes, EventName = "FelmentesekHelper.modFelmentesSave" }); return PartialView(Constants.General.PopupView, pm); } public ActionResult InfoFelmentes(int id) { var model = new FelmentesekGridModel(new FelmentesHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetFelmentesById(id), true); var pm = new PopUpModel(model, "_Felmentes_Info"); pm.Buttons.Add(new ModalButtonModel() { Name = "BtnFelmentesInfoCancel", Text = Resources.CommonResource.Megse, EventName = "FelmentesekHelper.infoFelmentesCancel" }); return PartialView(Constants.General.PopupView, pm); } } }