init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
122
KretaWeb/Areas/Feljegyzes/Controllers/BaseBeirasokController.cs
Normal file
122
KretaWeb/Areas/Feljegyzes/Controllers/BaseBeirasokController.cs
Normal file
|
@ -0,0 +1,122 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Helpers.SystemSettings;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Feljegyzes.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Feljegyzes.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue, KretaClaimPackages.IsPortas.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Tanar.ClaimValue, KretaClaimPackages.Osztalyfonok.ClaimValue, KretaClaimPackages.SzuperOsztalyfonok.ClaimValue, KretaClaimPackages.Naplo.ClaimValue)]
|
||||
public class BaseBeirasokController : AbstractFeljegyzesekController
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public static string StartPopupFormName => "BeirasokStartPopupForm";
|
||||
public static string StartPopupId => "BeirasokStartWindow";
|
||||
|
||||
public static string GridName => "BeirasokGrid";
|
||||
|
||||
public static string NewModifyPopupName => "New_Modify_Popup";
|
||||
public static string NewModifyFormName => "BeirasNewModifyForm";
|
||||
|
||||
protected IKretaAuthorization Authorization { get; }
|
||||
|
||||
#endregion Properties
|
||||
|
||||
public BaseBeirasokController(IKretaAuthorization authorization)
|
||||
{
|
||||
Authorization = authorization ?? throw new ArgumentNullException(nameof(authorization));
|
||||
}
|
||||
|
||||
// Sitemap-ben letiltásra került, NE töröld ki!
|
||||
//[MvcRolePackageAuthorize(KretaClaimPackages.Osztalyfonok.ClaimValue, KretaClaimPackages.SzuperOsztalyfonok.ClaimValue)]
|
||||
//public ActionResult IndexOsztalyfonoki()
|
||||
//{
|
||||
// return View("Index");
|
||||
//}
|
||||
|
||||
#region Popup actions
|
||||
|
||||
[HttpPost]
|
||||
[MvcValidateAjaxAntiForgeryToken]
|
||||
public ActionResult OpenNewModifyPopup(int? id, int tanuloId, int? osztalyCsoportId)
|
||||
{
|
||||
bool isModify = id.IsEntityId();
|
||||
BeirasModel beirasModel;
|
||||
var helper = new FeljegyzesHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
FeljegyzesHelperCo feljegyzesHelperCo = helper.GetFeljegyzesHelperCo();
|
||||
if (isModify)
|
||||
{
|
||||
//NOTE: Az id az IdEntityId vizsgálat miatt nem lehet null!
|
||||
FeljegyzesCo co = helper.GetFeljegyzesById(id.Value);
|
||||
beirasModel = new BeirasModel(co, tanuloId);
|
||||
}
|
||||
else
|
||||
{
|
||||
beirasModel = new BeirasModel
|
||||
{
|
||||
TanuloId = tanuloId,
|
||||
FeljegyzoId = ClaimData.FelhasznaloId,
|
||||
FeljegyzoNev = ClaimData.FelhasznaloNev,
|
||||
EsemenyDatuma = feljegyzesHelperCo.DefaultEsemenyDatuma,
|
||||
OsztalyCsoportId = osztalyCsoportId
|
||||
};
|
||||
}
|
||||
|
||||
beirasModel.MinimumErvenyessegKezdete = feljegyzesHelperCo.MinimumErvenyessegKezdete;
|
||||
beirasModel.MaximumErvenyessegKezdete = feljegyzesHelperCo.MaximumErvenyessegKezdete;
|
||||
|
||||
beirasModel.TipusList = GetTipusList();
|
||||
|
||||
var systemSettingsHelper = new SystemSettingsHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
beirasModel.NemzetiDokumentumNyelvek = systemSettingsHelper.GetSystemSettingValue<List<int>>(RendszerBeallitasTipusEnum.Nemzeti_Nyelvi_Dokumentum_Nyelvek);
|
||||
beirasModel.NyelvesitendoEsemenyTipuslist = Core.Constants.NyelvesitendoEsemenyTipuslist;
|
||||
|
||||
var popupModel = new PopUpModel(beirasModel, $"~/Areas/Feljegyzes/Views/Beirasok/{NewModifyPopupName}.cshtml");
|
||||
popupModel.AddBtn(popupModel, "BtnCancel_" + NewModifyFormName, CommonResource.Megse, "BeirasokHelper.newModifyPopupCancel");
|
||||
popupModel.AddOkBtn(popupModel, "BeirasokHelper.newModifyPopupSave");
|
||||
if (isModify)
|
||||
{
|
||||
popupModel.AddDeleteBtn(popupModel, "BeirasokHelper.newModifyPopupDelete");
|
||||
}
|
||||
|
||||
return PartialView(Constants.General.PopupView, popupModel);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public ActionResult OpenStartPopup(bool isFromSzervezet)
|
||||
{
|
||||
var model = GetFeljegyzesekModel();
|
||||
model.IsDualisKepzohelyiCsoport = isFromSzervezet;
|
||||
return PartialView("~/Areas/Feljegyzes/Views/Beirasok/Start_Popup.cshtml", model);
|
||||
}
|
||||
|
||||
#endregion Popup actions
|
||||
|
||||
[NonAction]
|
||||
public ActionResult BeirasokReszletekGrid(BeirasokGridModel model)
|
||||
{
|
||||
return PartialView("~/Areas/Feljegyzes/Views/Beirasok/DetailGrid.cshtml", model);
|
||||
}
|
||||
|
||||
private static List<SelectListItem> GetTipusList()
|
||||
{
|
||||
var result = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.EsemenyTipus, ClaimData.SelectedTanevID.Value).ToSelectListItemList(new List<string> { ((int)EsemenyTipusEnum.ElektronikusUzenet).ToString(), ((int)EsemenyTipusEnum.FaliujsagBejegyzes).ToString() });
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue