using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using Kreta.BusinessLogic.HelperClasses; using Kreta.BusinessLogic.Helpers; using Kreta.BusinessLogic.Security; using Kreta.Enums.ManualEnums; using Kreta.Framework.Util; using Kreta.Resources; using Kreta.Web.Areas.Kerdoiv.Models; using Kreta.Web.Helpers; using Kreta.Web.Models.EditorTemplates; using Kreta.Web.Security; namespace Kreta.Web.Areas.Kerdoiv.Controllers { [MvcRoleClaimsAuthorize(true)] [MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)] [MvcRolePackageAuthorize(KretaClaimPackages.Tanar.ClaimValue, KretaClaimPackages.Osztalyfonok.ClaimValue, KretaClaimPackages.SzuperOsztalyfonok.ClaimValue)] public class NatKerdoivController : Controller { #region Properties public static string FormName => "NatKerdoivForm"; public static string PopupName => "NatKerdoiv_Popup"; #endregion Properties [HttpGet] public ActionResult Index() { NatKerdoivCo co = new KerdoivHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType()).GetNatKerdoivCo(); var model = new NatKerdoivModel(co) { EgyToOtWithNemTudomSelectList = GetEgyToOtWithNemTudomList() }; return View(model); } [HttpGet] [MvcValidateAjaxAntiForgeryToken] public ActionResult OpenNatKerdoivPopup() { PopUpModel popUpModel = new PopUpModel(null, PopupName); popUpModel.AddBtn(popUpModel, "NemToltomKiButton", KerdoivResource.MostNemToltomKi, "NatKerdoivPopupHelper.nemToltomKi", "BtnDelete"); popUpModel.AddBtn(popUpModel, "KitioltomButton", KerdoivResource.Kitoltom, "NatKerdoivPopupHelper.kitoltom", "BtnOk"); return PartialView(Constants.General.PopupView, popUpModel); } private List GetEgyToOtWithNemTudomList() { var result = FrameworkEnumExtensions.EnumToListManual().ToSelectListItemList(); //NOTE: A "Nem tudom" elemet a végére tesszük az elejéről a listának. var nemTudomItem = result.First(); result.Remove(nemTudomItem); result.Add(nemTudomItem); return result; } } }