init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
112
KretaWeb/Areas/Tantargy/Controllers/BaseTanmenetController.cs
Normal file
112
KretaWeb/Areas/Tantargy/Controllers/BaseTanmenetController.cs
Normal file
|
@ -0,0 +1,112 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes.ExcelHelpers;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.ApiControllers;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Tanar.ClaimValue)]
|
||||
public class BaseTanmenetController : Controller
|
||||
{
|
||||
#region Properties
|
||||
|
||||
protected IKretaAuthorization Authorization { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
public BaseTanmenetController(IKretaAuthorization authorization)
|
||||
{
|
||||
Authorization = authorization ?? throw new ArgumentNullException(nameof(authorization));
|
||||
}
|
||||
|
||||
#region Popup actions
|
||||
|
||||
[NonAction]
|
||||
public ActionResult OpenNewTanmenetWindow(NewTanmenetModel model)
|
||||
{
|
||||
var pm = new PopUpModel(model, "~/Areas/Tantargy/Views/Tanmenet/NewTanmenet_Bevitel.cshtml");
|
||||
pm = pm.AddCancelBtn(pm, "TanmenetHelper.newTanmenetCancel");
|
||||
pm = pm.AddBtn(pm, "openNewTanmenetGrid", CommonResource.Tovabb, "TanmenetHelper.openNewTanmenetGrid");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
protected ActionResult OpenEditTanmenetGridWindow(TanmenetOrakModel model)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(model.FoglalkozasId_input))
|
||||
{
|
||||
model.TanmenetModalHeader = TantargyResource.UjTanmenet + model.FoglalkozasId_input;
|
||||
}
|
||||
else
|
||||
{
|
||||
model.TanmenetModalHeader = TantargyResource.Tanmenet + new BaseTanmenetApiController().GetTanmenetModalHeader(model.TantargyId, model.OsztalyId);
|
||||
}
|
||||
var pm = new PopUpModel(model, "~/Areas/Tantargy/Views/Tanmenet//EditTanmenetGrid_Bevitel.cshtml");
|
||||
pm = pm.AddBtn(pm, "TanmenetGridCancelBtn", AdminisztracioResource.Megsem, "TanmenetHelper.editTanmenetGridCancel");
|
||||
pm = pm.AddBtn(pm, "SaveTanmenet", CommonResource.Mentes, "TanmenetHelper.saveTanmenetOrak");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Export actions
|
||||
|
||||
[NonAction]
|
||||
public string ExportTanmenet(int tantargyId, int osztalyId)
|
||||
{
|
||||
var memoryStream = GetTanmenetExport(tantargyId, osztalyId);
|
||||
|
||||
if (memoryStream != null)
|
||||
{
|
||||
return Convert.ToBase64String(memoryStream.ToArray());
|
||||
}
|
||||
|
||||
return ImportExportCommonResource.NincsElegendoAdatARendszerbenAzExportalashoz;
|
||||
}
|
||||
|
||||
private MemoryStream GetTanmenetExport(int tantargyId, int osztalyId)
|
||||
{
|
||||
var manager = new ExcelExportManager();
|
||||
var exportFile = new ExcelExportItem();
|
||||
|
||||
exportFile.AddColumn(0, TanmenetResource.Oraszam);
|
||||
exportFile.AddColumn(1, TanmenetResource.Tema);
|
||||
|
||||
var rowIndex = 2;
|
||||
var tanmenetHelper = new TanmenetHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var ds = tanmenetHelper.GetTanmenetek(tantargyId, osztalyId, ClaimData.FelhasznaloId);
|
||||
|
||||
foreach (var row in ds.Tables[0].AsEnumerable())
|
||||
{
|
||||
exportFile.AddCell(rowIndex, 0, row.Field<int>("Oraszam"));
|
||||
exportFile.AddCell(rowIndex, 1, row.Field<string>("Tema"));
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
// mindenképp 2000-ig feltöltjük az excelt
|
||||
for (; rowIndex < 2001; rowIndex++)
|
||||
{
|
||||
exportFile.AddCell(rowIndex, 0, rowIndex);
|
||||
exportFile.AddCell(rowIndex, 1, string.Empty);
|
||||
}
|
||||
|
||||
return manager.CreateExcelExport(new List<ExcelExportItem> { exportFile });
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.Core.FeatureToggle;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Controllers;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
public class BaseTantargyFelosztasController : Controller
|
||||
{
|
||||
protected IFeatureContext FeatureContext { get; }
|
||||
|
||||
public BaseTantargyFelosztasController(IFeatureContext featureContext)
|
||||
{
|
||||
FeatureContext = featureContext;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public PopUpModel OpenTantargyFelosztasFelvetelePopUp(bool isFromSzervezet = false)
|
||||
{
|
||||
var model = new TantargyFelosztasFelveteleModel
|
||||
{
|
||||
TanarList = new ComboBoxHelperApiController().GetTanarSelectListItemList(isFromSzervezet)
|
||||
};
|
||||
|
||||
model.IsFromSzervezet = isFromSzervezet;
|
||||
model.DualisKepzesTantargyId = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetDualisKepzesTantargyId();
|
||||
var popUpModel = new PopUpModel(model, "TantargyFelosztasFelveteleModal");
|
||||
popUpModel.AddCancelBtn(popUpModel, "TantargyFelosztasHelper.CloseWindow");
|
||||
popUpModel.AddOkBtn(popUpModel, "FelosztasFelvetelHelper.ValidateFelosztas");
|
||||
|
||||
return popUpModel;
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyFelosztasAdatokPopUp(int id, bool isFromSzervezet = false)
|
||||
{
|
||||
var model = new TantargyFelosztasAdatokModel();
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var adatok = helper.GetTantargyFelosztasAdatok(id);
|
||||
model.Csoport = adatok.Csoport;
|
||||
model.FoglalkozasHelye = adatok.FoglalkozasHelye;
|
||||
model.FoglalkozasKategoria = adatok.FoglalkozasKategoria;
|
||||
model.FoglalkozasTipus = adatok.FoglalkozasTipus;
|
||||
model.HetiOraszam = adatok.HetiOraszam;
|
||||
model.MunkakorTipus = adatok.MunkakorTipus;
|
||||
model.MunkavallaloNev = adatok.MunkavallaloNev;
|
||||
model.Tantargynev = adatok.Tantargynev;
|
||||
model.Tanev = adatok.Tanev;
|
||||
model.OsszevontOra = adatok.OsszevontOra;
|
||||
model.NemzetisegiOra = adatok.NemzetisegiOra;
|
||||
model.MegbizasiOraszam = adatok.MegbizasiOraszam;
|
||||
model.TuloraSzam = adatok.TuloraSzam;
|
||||
model.IsFromSzervezet = isFromSzervezet;
|
||||
|
||||
var pm = new PopUpModel(model, "TantargyFelosztasAdatokModal");
|
||||
pm.AddCancelBtn(pm, "TantargyFelosztasHelper.CloseWindow");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyFelosztasModositasPopUp(int id, bool isFromSzervezet = false)
|
||||
{
|
||||
var model = new TantargyFelosztasModositasaModel();
|
||||
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
var adatok = helper.GetTantargyFelosztas(id);
|
||||
var kapcsolatok = helper.GetTantargyFelosztasKapcsolatai(id);
|
||||
model.Id = id;
|
||||
model.Oraszam = adatok.Oraszam;
|
||||
model.CsoportID = adatok.OsztalyCsoportID;
|
||||
model.TanarId = adatok.TanarID;
|
||||
model.TantargyId = adatok.TantargyID;
|
||||
model.TipusId = adatok.FoglalkozasTipusa;
|
||||
model.Modosithato = adatok.Modosithato;
|
||||
model.DiakokSzama = kapcsolatok.DiakokSzama;
|
||||
model.ErtekelesekSzama = kapcsolatok.ErtekelesekSzama;
|
||||
model.TanorakSzama = kapcsolatok.TanorakSzama;
|
||||
model.OsszevontOra = adatok.OsszevontOra;
|
||||
model.NemzetisegiOra = adatok.NemzetisegiOra;
|
||||
model.MegbizasiOraszam = adatok.MegbizasiOraszam;
|
||||
model.TuloraSzam = adatok.TuloraSzam;
|
||||
model.MulasztasokSzama = kapcsolatok.MulasztasokSzama;
|
||||
model.IsFromSzervezet = isFromSzervezet;
|
||||
|
||||
var pm = new PopUpModel(model, "TantargyFelosztasModositasModal");
|
||||
pm.AddCancelBtn(pm, "TantargyFelosztasHelper.CloseWindow");
|
||||
pm.AddOkBtn(pm, "TantargyFelosztasHelper.ValidateFelosztas");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core.FeatureToggle;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Attributes;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue, KretaClaimPackages.IsDefaultAdminUser.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue, KretaClaimPackages.Dualis_Admin.ClaimValue, KretaClaimPackages.IsSzakiranyuOktatasertFelelos.ClaimValue)]
|
||||
[KretaGlobalLanguageChangeActionFilter(LanguageCode = "hu-Dualis")]
|
||||
public class DualisTantargyFelosztasController : BaseTantargyFelosztasController
|
||||
{
|
||||
public DualisTantargyFelosztasController(IFeatureContext featureContext) : base(featureContext)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyFelosztasFelvetelePopUp()
|
||||
{
|
||||
var popUpModel = OpenTantargyFelosztasFelvetelePopUp(true);
|
||||
(popUpModel.Instance as TantargyFelosztasFelveteleModel).ApiControllerName = Constants.ApiControllers.DualisTantargyFelosztasApi;
|
||||
return PartialView(Constants.General.PopupView, popUpModel);
|
||||
}
|
||||
}
|
||||
}
|
131
KretaWeb/Areas/Tantargy/Controllers/OraTervController.cs
Normal file
131
KretaWeb/Areas/Tantargy/Controllers/OraTervController.cs
Normal file
|
@ -0,0 +1,131 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Tantargy.ApiControllers;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class OraTervController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
OraTervSearchModel model = new OraTervSearchModel();
|
||||
model.IsKovetkezoTanev = ClaimData.KovTanevID == ClaimData.SelectedTanevID;
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenOraTervNewPopUp(int tantervId)
|
||||
{
|
||||
PopUpModel pm = new PopUpModel(new OraTervModel()
|
||||
{
|
||||
TantervId = tantervId,
|
||||
EvfolyamList = GetEvfolyamList(tantervId)
|
||||
}, "OraTerv_Bevitel");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "OraTervHelper.newOraTervCancel");
|
||||
pm = pm.AddOkBtn(pm, "OraTervHelper.newOraTervSave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenOraTervModPopUp(int id)
|
||||
{
|
||||
OraTervApiController api = new OraTervApiController();
|
||||
|
||||
OraTervModel model = api.GetOraTervElem(id);
|
||||
model.EvfolyamList = GetEvfolyamList(model.TantervId.Value);
|
||||
|
||||
PopUpModel pm = new PopUpModel(model, "OraTerv_Bevitel");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "OraTervHelper.modOraTervCancel");
|
||||
pm = pm.AddOkBtn(pm, "OraTervHelper.modOraTervSave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenOraTervTantargyNewPopUp(int oraTervId)
|
||||
{
|
||||
PopUpModel pm = new PopUpModel(new OraTervTargyModel()
|
||||
{
|
||||
OratervId = oraTervId,
|
||||
TantargyList = GetTantargyList(oraTervId)
|
||||
}, "OraTervTantargy_Bevitel");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "OraTervHelper.newTantargyCancel");
|
||||
pm = pm.AddOkBtn(pm, "OraTervHelper.newTantargySave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenOraTervTantargyModPopUp(int oraTervTantargyId)
|
||||
{
|
||||
OraTervApiController api = new OraTervApiController();
|
||||
OraTervTargyModel model = api.GetOraTervTantargyElem(oraTervTantargyId);
|
||||
model.OratervTantargyId = oraTervTantargyId;
|
||||
model.TantargyList = GetTantargyList(model.OratervId, oraTervTantargyId);
|
||||
|
||||
PopUpModel pm = new PopUpModel(model, "OraTervTantargy_Bevitel");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "OraTervHelper.modTantargyCancel");
|
||||
pm = pm.AddOkBtn(pm, "OraTervHelper.modTantargySave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult GetDetailGrid(int? id)
|
||||
{
|
||||
return PartialView("DetailGrid", id);
|
||||
}
|
||||
|
||||
#region Helpers
|
||||
|
||||
private List<SelectListItem> GetEvfolyamList(int tantervID)
|
||||
{
|
||||
List<SelectListItem> items = ((int)GeneratedAdatszotarTipusEnum.EvfolyamTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToSelectItemList();
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetTantargyList(int oraTervId)
|
||||
{
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var tantargyDictionary = helper.GetTantargyak(oraTervId);
|
||||
List<SelectListItem> tantargyList = new List<SelectListItem>();
|
||||
|
||||
foreach (var item in tantargyDictionary)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
tantargyList.Add(sli);
|
||||
}
|
||||
return tantargyList;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetTantargyList(int oraTervId, int oraTervTantargyId)
|
||||
{
|
||||
OratervHelper helper = new OratervHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var tantargyDictionary = helper.GetTantargyakModOraTervTantargy(oraTervId, oraTervTantargyId);
|
||||
List<SelectListItem> tantargyList = new List<SelectListItem>();
|
||||
|
||||
foreach (var item in tantargyDictionary)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
tantargyList.Add(sli);
|
||||
}
|
||||
return tantargyList;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
51
KretaWeb/Areas/Tantargy/Controllers/TanmenetController.cs
Normal file
51
KretaWeb/Areas/Tantargy/Controllers/TanmenetController.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
public class TanmenetController : BaseTanmenetController
|
||||
{
|
||||
public TanmenetController(IKretaAuthorization authorization) : base(authorization)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
if (Authorization.IsValidTanulasiElemek())
|
||||
{
|
||||
return Redirect(Url.Action("AccessDenied", "ErrorHandler", new { area = string.Empty }));
|
||||
}
|
||||
|
||||
var model = new TanmenetSearchModel
|
||||
{
|
||||
ControllerName = Constants.Controllers.Tanmenet,
|
||||
ApiControllerName = Constants.ApiControllers.TanmenetApi,
|
||||
ImportControllerName = Constants.Controllers.TanmenetImportExport,
|
||||
IsFromSzervezet = false,
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public ActionResult OpenNewTanmenetWindow()
|
||||
{
|
||||
var model = new NewTanmenetModel
|
||||
{
|
||||
ApiControllerName = Constants.ApiControllers.TanmenetApi,
|
||||
};
|
||||
return OpenNewTanmenetWindow(model);
|
||||
}
|
||||
|
||||
public new ActionResult OpenEditTanmenetGridWindow(TanmenetOrakModel model)
|
||||
{
|
||||
model.ApiControllerName = Constants.ApiControllers.TanmenetApi;
|
||||
return base.OpenEditTanmenetGridWindow(model);
|
||||
}
|
||||
|
||||
public new string ExportTanmenet(int tantargyId, int osztalyId)
|
||||
{
|
||||
return base.ExportTanmenet(tantargyId, osztalyId);
|
||||
}
|
||||
}
|
||||
}
|
93
KretaWeb/Areas/Tantargy/Controllers/TanorakController.cs
Normal file
93
KretaWeb/Areas/Tantargy/Controllers/TanorakController.cs
Normal file
|
@ -0,0 +1,93 @@
|
|||
using System.Net;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Tanar.ClaimValue)]
|
||||
public class TanorakController : Controller
|
||||
{
|
||||
private IKretaAuthorization Authorization { get; }
|
||||
|
||||
public TanorakController(IKretaAuthorization authorization)
|
||||
{
|
||||
Authorization = authorization;
|
||||
}
|
||||
|
||||
// GET: Tantargy/Tanorak
|
||||
public ActionResult Index()
|
||||
{
|
||||
TanorakSearchModel model = new TanorakSearchModel();
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenAdatokPopup(int ID)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Authorization.IsValidTanitasiOra(ID))
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.Forbidden, ErrorResource.NincsJogaAzOldalMegtekintesehez);
|
||||
}
|
||||
|
||||
PopUpModel pm = new PopUpModel(GetTanoraAdatokModel(ID), "TanorakAdatok");
|
||||
|
||||
pm = pm.AddCancelBtn(pm, "TanorakHelper.adatokCancel");
|
||||
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
catch (BlException ex)
|
||||
{
|
||||
throw new StatusError(HttpStatusCode.BadRequest, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private TanoraAdatokModel GetTanoraAdatokModel(int id)
|
||||
{
|
||||
TanoraCO co;
|
||||
|
||||
var helper = new TanoraHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
co = helper.GetTanorakAdatok(id);
|
||||
|
||||
TanoraAdatokModel model = ConvertTanoraCoToTanoraAdatokModel(co);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
private TanoraAdatokModel ConvertTanoraCoToTanoraAdatokModel(TanoraCO co)
|
||||
{
|
||||
TanoraAdatokModel model = new TanoraAdatokModel()
|
||||
{
|
||||
Datum = co.Datum.ToShortDateString(),
|
||||
HelyNev = co.TeremNev,
|
||||
HetNapja = co.HetNapjaNev,
|
||||
Id = co.ID,
|
||||
Oraszam = string.IsNullOrWhiteSpace(co.OraIdopont) ? co.Oraszam.ToString() : co.OraIdopont,
|
||||
OraSorszama = co.EvesOraSorszam.HasValue ? co.EvesOraSorszam.Value.ToString() : "",
|
||||
OsztCsopNev = co.OsztalyCsoportNev,
|
||||
TanarNev = co.TanarNev,
|
||||
TargyNev = co.TantargyNev,
|
||||
Tema = co.Megtartott.HasValue && co.Megtartott.Value ? co.Tema : "-",
|
||||
FoglalkozasNev = co.FoglalkozasNev,
|
||||
Megtartott = co.Megtartott.Value,
|
||||
OraKezdete = co.OraKezd.ToShortTimeString(),
|
||||
OraVege = co.OraVeg.ToShortTimeString()
|
||||
};
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes.ExcelHelpers;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core.FeatureToggle;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TantargyFelosztasController : BaseTantargyFelosztasController
|
||||
{
|
||||
public TantargyFelosztasController(IFeatureContext featureContext) : base(featureContext)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ActionResult Index(string filter)
|
||||
{
|
||||
var api = new ApiControllers.TantargyFelosztasApiController();
|
||||
|
||||
var model = new TantargyFelosztasModel();
|
||||
var intezmeny = api.GetIntezmenyAdatok();
|
||||
model.VeglegesTTF = intezmeny.VeglegesTTF;
|
||||
model.VeglegesESL = intezmeny.VeglegesESL;
|
||||
model.ElfogadottTTF = intezmeny.ElfogadottTTF;
|
||||
model.ElfogadottESL = intezmeny.ElfogadottESL;
|
||||
model.IntezmenyId = intezmeny.ID;
|
||||
model.IsFromSzervezet = false;
|
||||
model.ControllerName = Constants.Controllers.Tantargyfelosztas;
|
||||
model.ApiControllerName = Constants.ApiControllers.TantargyFelosztasApi;
|
||||
|
||||
if (filter == "minden")
|
||||
{
|
||||
model.SearchFeladatKategoriaId = Constants.MindenErteke.FeladatKategoria;
|
||||
}
|
||||
|
||||
model.SearchFeladatellatasihely = ClaimData.FelhelySzuro;
|
||||
|
||||
(var oraszam, var ttfKorrekcioOraszam) = new FoglalkozasHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetFoglalkozasOsszOraszamok();
|
||||
|
||||
ViewBag.Oraszam = oraszam;
|
||||
ViewBag.TtfKorrekcioOraszam = ttfKorrekcioOraszam;
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
|
||||
[System.Web.Mvc.HttpPost]
|
||||
[MvcValidateAjaxAntiForgeryToken]
|
||||
public string ExportFormazottTantargyfelosztas()
|
||||
{
|
||||
var helper = new TTFExportHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var munkaugyiAdatokKlebelsbergOrNSZFH =
|
||||
FeatureContext.IsEnabled(Core.Constants.FeatureName.MunkaugyiAdatokKlebelsberg)
|
||||
|| FeatureContext.IsEnabled(Core.Constants.FeatureName.MunkaugyiAdatokNSZFH);
|
||||
var memoryStream = helper.ExportFormazottTtf(munkaugyiAdatokKlebelsbergOrNSZFH ? 1 : 0);
|
||||
|
||||
if (memoryStream != null)
|
||||
{
|
||||
return Convert.ToBase64String(memoryStream.ToArray());
|
||||
}
|
||||
|
||||
return ImportExportCommonResource.NincsElegendoAdatARendszerbenAzExportalashoz;
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyFelosztasFelvetelePopUp()
|
||||
{
|
||||
var popUpModel = OpenTantargyFelosztasFelvetelePopUp(false);
|
||||
(popUpModel.Instance as TantargyFelosztasFelveteleModel).ApiControllerName = Constants.ApiControllers.TantargyFelosztasApi;
|
||||
return PartialView(Constants.General.PopupView, popUpModel);
|
||||
}
|
||||
}
|
||||
}
|
295
KretaWeb/Areas/Tantargy/Controllers/TantargyakController.cs
Normal file
295
KretaWeb/Areas/Tantargy/Controllers/TantargyakController.cs
Normal file
|
@ -0,0 +1,295 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Helpers.SystemSettings;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Tantargy.Logic;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.TabStrip;
|
||||
using Kreta.Web.Models;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TantargyakController : Controller
|
||||
{
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult Index(string filter)
|
||||
{
|
||||
TantargySearchModel model = TantargySearchModel.SetFilterTantargySearchModel(filter);
|
||||
model.NemzetiDokumentumNyelvek = new SystemSettingsHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetSystemSettingValue<List<int>>(RendszerBeallitasTipusEnum.Nemzeti_Nyelvi_Dokumentum_Nyelvek);
|
||||
model.IsSzakkepzo = ClaimData.IsSzakkepzoIntezmeny;
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult ErrorIndex(bool? nincsTantargykategoria)
|
||||
{
|
||||
TantargySearchModel model = new TantargySearchModel();
|
||||
|
||||
if (nincsTantargykategoria.HasValue && nincsTantargykategoria.Value)
|
||||
{
|
||||
model.nincsTantargykategoria = nincsTantargykategoria;
|
||||
}
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyPropertiesTab(int tantargyID)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = tantargyID,
|
||||
RadioButtonItems = GetMinositesRadioButtonItems()
|
||||
};
|
||||
tmodel.TabList = GetTabItems(tmodel);
|
||||
PopUpModel pm = new PopUpModel(tmodel, "TantargyProperties_Info");
|
||||
pm = pm.AddCancelBtn(pm, "TantargyHelper.propertiesCancel");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantargyModifyAddPopup(int? tantargyID)
|
||||
{
|
||||
TantargyModel tmodel;
|
||||
if (tantargyID.HasValue)
|
||||
{
|
||||
tmodel = GetTantargyBaseProperties(tantargyID.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmodel = new TantargyModel();
|
||||
tmodel.SetDefaultsForNew();
|
||||
}
|
||||
|
||||
tmodel.NemzetiDokumentumNyelvek = new SystemSettingsHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetSystemSettingValue<List<int>>(RendszerBeallitasTipusEnum.Nemzeti_Nyelvi_Dokumentum_Nyelvek);
|
||||
|
||||
var tabModel = TantargyLogic.GetTabModel(tmodel);
|
||||
|
||||
PopUpModel pm = new PopUpModel(tabModel, "TantargyModifyAdd_Bevitel");
|
||||
pm = pm.AddCancelBtn(pm, "TantargyHelper.modifyAddCancel");
|
||||
pm = pm.AddBtn(pm, "saveTantargy", CommonResource.Mentes, "TantargyHelper.saveModifyAddTantargy");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public static List<TabStripItemModel> GetTantargyTobbesModTabs(TantargyModModel model)
|
||||
{
|
||||
List<TabStripItemModel> list = new List<TabStripItemModel>();
|
||||
|
||||
list.Add(new TabStripItemModel() { ItemId = "1", ItemName = TantargyResource.Alapadatok, Model = model, PartialViewName = "~/Areas/Tantargy/Views/Tantargyak/TantargyTobbesModify.cshtml" });
|
||||
list[0].IsActive = true;
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public ActionResult OpenModPopup(List<TantargyModModel> tantargyakList)
|
||||
{
|
||||
TantargyModModel tmodel = new TantargyModModel();
|
||||
|
||||
tmodel.TabList = GetTantargyTobbesModTabs(tmodel);
|
||||
|
||||
foreach (var item in tantargyakList)
|
||||
{
|
||||
tmodel.TantargyakIDArray += item.ID.ToString() + ",";
|
||||
tmodel.TantargyakNevArray += item.TantargyNev.ToString() + ", ";
|
||||
}
|
||||
|
||||
tmodel.TantargyakIDArray = tmodel.TantargyakIDArray.Remove(tmodel.TantargyakIDArray.Length - 1);
|
||||
tmodel.TantargyakNevArray = tmodel.TantargyakNevArray.Remove(tmodel.TantargyakNevArray.Length - 2);
|
||||
|
||||
PopUpModel pm = new PopUpModel(tmodel, "TantargyModify_bevitel");
|
||||
pm = pm.AddCancelBtn(pm, "TantargyHelper.modifyAddCancel");
|
||||
pm = pm.AddBtn(pm, "saveTantargy", CommonResource.Mentes, "TantargyHelper.saveCsoportosModifyAddTantargy");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakBaseProperties(int id)
|
||||
{
|
||||
TantargyModel tmodel = GetTantargyBaseProperties(id);
|
||||
tmodel.NemzetiDokumentumNyelvek = new SystemSettingsHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetSystemSettingValue<List<int>>(RendszerBeallitasTipusEnum.Nemzeti_Nyelvi_Dokumentum_Nyelvek);
|
||||
|
||||
return PartialView("TantargyBasicProperties_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakFoglalkozasai(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyFoglalkozasai_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakOrarendiOrai(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyOrarendiOrai_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakTanmenetei(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyTanmenetei_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakMegtartottTanorai(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyMegtartottTanorai_Tab", tmodel);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult OpenTantargyakErtekelesei(int id)
|
||||
{
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantargyErtekelesei_Tab", tmodel);
|
||||
}
|
||||
|
||||
private List<TabStripItemModel> GetTabItems(TantargyModel tmodel)
|
||||
{
|
||||
var items = new List<TabStripItemModel>();
|
||||
//Alapadatok
|
||||
items.Add(new TabStripItemModel { ItemId = "1", ItemName = StringResourcesUtil.GetString(161), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakBaseProperties", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } } });
|
||||
//Foglalkozasok
|
||||
items.Add(new TabStripItemModel { ItemId = "2", ItemName = StringResourcesUtil.GetString(164), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakFoglalkozasai", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } } });
|
||||
//Orarendi orak
|
||||
items.Add(new TabStripItemModel { ItemId = "3", ItemName = StringResourcesUtil.GetString(165), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakOrarendiOrai", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
//Tanmenetek
|
||||
items.Add(new TabStripItemModel { ItemId = "4", ItemName = StringResourcesUtil.GetString(166), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakTanmenetei", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
//Megtartott tanorak
|
||||
items.Add(new TabStripItemModel { ItemId = "5", ItemName = StringResourcesUtil.GetString(167), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakMegtartottTanorai", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
//Ertekeles
|
||||
items.Add(new TabStripItemModel { ItemId = "6", ItemName = StringResourcesUtil.GetString(168), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakErtekelesei", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
//Minositesek
|
||||
//items.Add(new TabStripItemModel { ItemId = "7", ItemName = StringResourcesUtil.GetString(3233), Area = "Tantargy", Controller = "Tantargyak", Action = "OpenTantargyakMinositesei", RouteParameters = new Dictionary<string, string>() { { "Id", tmodel.ID.ToString() } }, IsETTFDisabled = true });
|
||||
return items;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetMinositesRadioButtonItems()
|
||||
{
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
list.Add(new SelectListItem() { Value = "0", Text = StringResourcesUtil.GetString(3231), Selected = true });
|
||||
list.Add(new SelectListItem() { Value = "1", Text = StringResourcesUtil.GetString(30) });
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetTargyKategoriaList()
|
||||
{
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
var itemlist = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.TargyKategoriaTipus, ClaimData.SelectedTanevID.Value, true);
|
||||
foreach (var item in itemlist)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
list.Add(sli);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetFotargyakList(int tanevId, int id)
|
||||
{
|
||||
IDictionary<string, string> fotargyLista;
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
var helper = new TantargyHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
fotargyLista = helper.GetFotargyak(kiveve: id).OrderBy(x => x.Value).ToDictionary(k => k.Key, v => v.Value);
|
||||
|
||||
foreach (var item in fotargyLista)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
list.Add(sli);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
#region Export
|
||||
|
||||
public ActionResult ExportTantargyakMindenAdata([FromUri] TantargySearchModel data)
|
||||
{
|
||||
data.IsSzakkepzo = ClaimData.IsSzakkepzoIntezmeny;
|
||||
|
||||
return TantargyLogic.ExportTantargyakMindenAdata(data);
|
||||
}
|
||||
#endregion
|
||||
|
||||
private TantargyModel GetTantargyBaseProperties(int tantargyId)
|
||||
{
|
||||
var t = new TantargyHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
TantargyCO tantargy = t.GetTantargyById(tantargyId);
|
||||
TantargyModel tmodel = new TantargyModel()
|
||||
{
|
||||
ID = tantargy.ID,
|
||||
AltantargyNyomtatvanyban = tantargy.AltantargyNyomtatvanyban,
|
||||
FoTargyID = tantargy.FoTargyID,
|
||||
FoTargyNev = tantargy.FoTargyNev,
|
||||
GyakorlatiTargy = tantargy.GyakorlatiTargy,
|
||||
IsFoTargy = tantargy.isFoTargy,
|
||||
NevNyomtatvanyban = tantargy.NevNyomtatvanyban,
|
||||
TantargyNev = tantargy.TantargyNev,
|
||||
TantargyRovidNev = tantargy.TantargyRovidNev,
|
||||
TargyKategoria = tantargy.TargyKategoria,
|
||||
TargyKategoriaNev = tantargy.TargyKategoriaNev,
|
||||
ESLTargyKategoria = tantargy.ESLTantargykategoria,
|
||||
ESLTargyKategoriaNev = tantargy.ESLTantargykategoriaNev,
|
||||
Tanev = tantargy.Tanev,
|
||||
TantargyAngolNev = tantargy.TantargyAngolNev,
|
||||
TantargyNemetNev = tantargy.TantargyNemetNev,
|
||||
TantargyHorvatNev = tantargy.TantargyHorvatNev,
|
||||
TantargyRomanNev = tantargy.TantargyRomanNev,
|
||||
TantargySzerbNev = tantargy.TantargySzerbNev,
|
||||
Sorszam = tantargy.Sorszam,
|
||||
Megjegyzes = tantargy.Megjegyzes,
|
||||
Gyakorlatigenyesseg = tantargy.Gyakorlatigenyesseg,
|
||||
IsAmiTargyMod = tantargy.IsAmiTargy,
|
||||
IsKollegiumiTargy = tantargy.IsKollegiumiTargy,
|
||||
IsEgymi = tantargy.IsEgymiTargy,
|
||||
IsFelnottOktatas = tantargy.IsFelnottOktatasTargy,
|
||||
IsNincsBeloleOraMod = tantargy.IsNincsBeloleOra,
|
||||
IsTanulmanyiAtlagbaNemSzamit = tantargy.IsTanulmanyiAtlagbaNemSzamit,
|
||||
IsOsztalynaplobanNemJelenikMeg = tantargy.IsOsztalynaplobanNemJelenikMeg,
|
||||
IsOsztalyOrarendjebenMegjelenik = tantargy.IsOsztalyokOrarendjebenMegjelenik,
|
||||
IsMszgTargy = tantargy.IsMszgTargy,
|
||||
AmiKepzesiJellemzokModel = new AmiKepzesiJellemzokModel()
|
||||
{
|
||||
MufajTipusId = tantargy.MufajTipusId,
|
||||
TanszakTipusId = tantargy.TanszakTipusId,
|
||||
MuveszetiAgId = tantargy.MuveszetiAgId
|
||||
}
|
||||
};
|
||||
|
||||
tmodel.SetErtekelesKorlatozasIdList(tantargy);
|
||||
|
||||
return tmodel;
|
||||
}
|
||||
}
|
||||
}
|
160
KretaWeb/Areas/Tantargy/Controllers/TantervekController.cs
Normal file
160
KretaWeb/Areas/Tantargy/Controllers/TantervekController.cs
Normal file
|
@ -0,0 +1,160 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Tantargy.ApiControllers;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Helpers.TabStrip;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(TanevEnum.Mind, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TantervekController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
TantervSearchModel model = new TantervSearchModel();
|
||||
model.IsKovetkezoTanev = ClaimData.KovTanevID == ClaimData.SelectedTanevID;
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervProperties(int tantervID)
|
||||
{
|
||||
TantervModel tmodel = new TantervModel()
|
||||
{
|
||||
ID = tantervID
|
||||
};
|
||||
tmodel.TabList = GetTabItems(tmodel);
|
||||
|
||||
PopUpModel pm = new PopUpModel(tmodel, "TantervPropertiesTab");
|
||||
pm = pm.AddCancelBtn(pm, "TantervHelper.propertiesCancel");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervOsztalyaiTab(int id)
|
||||
{
|
||||
TantervModel tmodel = new TantervModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantervProperties_Osztalyok", tmodel);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervTanuloiTab(int id)
|
||||
{
|
||||
TantervModel tmodel = new TantervModel()
|
||||
{
|
||||
ID = id
|
||||
};
|
||||
return PartialView("TantervProperties_Tanulok", tmodel);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervModifyAdd(int? tantervID)
|
||||
{
|
||||
TantervModel model;
|
||||
if (tantervID.HasValue)
|
||||
{
|
||||
TantervekApiController api = new TantervekApiController();
|
||||
model = api.GetTantervProperties(tantervID.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
model = new TantervModel();
|
||||
model.CsoportTipusa = (int)CsoportTipusEnum.iskolai_csoport_tanorai_celu_;
|
||||
model.KerettantervreEpulo = true;
|
||||
}
|
||||
|
||||
PopUpModel pm = new PopUpModel(model, "TantervModifyAdd_Bevitel");
|
||||
pm = pm.AddCancelBtn(pm, "TantervHelper.modifyAddCancel");
|
||||
pm = pm.AddOkBtn(pm, "TantervHelper.modifyAddSave");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenModPopUp(List<TantervModel> tantervList)
|
||||
{
|
||||
TantervekApiController api = new TantervekApiController();
|
||||
TantervModModel model = new TantervModModel();
|
||||
|
||||
if (tantervList.Count == 1)
|
||||
{
|
||||
model = api.GetTantervPropertiesMod(tantervList[0].ID.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in tantervList)
|
||||
{
|
||||
model.TantervIDArray += item.ID.ToString() + ",";
|
||||
model.TantervNevArray += item.Nev.ToString() + ", ";
|
||||
}
|
||||
|
||||
model.TantervIDArray = model.TantervIDArray.Remove(model.TantervIDArray.Length - 1);
|
||||
model.TantervNevArray = model.TantervNevArray.Remove(model.TantervNevArray.Length - 2);
|
||||
}
|
||||
|
||||
PopUpModel pm = new PopUpModel(model, "TantervModify_Bevitel");
|
||||
pm = pm.AddCancelBtn(pm, "TantervHelper.modifyAddCancel");
|
||||
pm = pm.AddOkBtn(pm, "TantervHelper.confirmCsopModWindow");
|
||||
return PartialView(Constants.General.PopupView, pm);
|
||||
}
|
||||
|
||||
public ActionResult OpenTantervAlapadatok(int id)
|
||||
{
|
||||
TantervekApiController api = new TantervekApiController();
|
||||
TantervModel tmodel = api.GetTantervProperties(id);
|
||||
|
||||
return PartialView("TantervProperties_Info", tmodel);
|
||||
}
|
||||
|
||||
public List<TabStripItemModel> GetTabItems(TantervModel model)
|
||||
{
|
||||
var items = new List<TabStripItemModel>();
|
||||
items.Add(new TabStripItemModel { ItemId = "1", ItemName = StringResourcesUtil.GetString(161) /*Alapadatok*/, Area = "Tantargy", Controller = "Tantervek", Action = "OpenTantervAlapadatok", RouteParameters = new Dictionary<string, string>() { { "Id", model.ID.ToString() } } });
|
||||
items.Add(new TabStripItemModel { ItemId = "2", ItemName = StringResourcesUtil.GetString(3848) /*Tanterv osztályai*/, Area = "Tantargy", Controller = "Tantervek", Action = "OpenTantervOsztalyaiTab", RouteParameters = new Dictionary<string, string>() { { "Id", model.ID.ToString() } } });
|
||||
items.Add(new TabStripItemModel { ItemId = "3", ItemName = StringResourcesUtil.GetString(3849) /*Tanterv tanulói*/, Area = "Tantargy", Controller = "Tantervek", Action = "OpenTantervTanuloiTab", RouteParameters = new Dictionary<string, string>() { { "Id", model.ID.ToString() } } });
|
||||
return items;
|
||||
}
|
||||
|
||||
#region Keresok
|
||||
|
||||
private List<SelectListItem> GetJellCsopTipListS()
|
||||
{
|
||||
|
||||
var dictionary = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.CsoportTipus, ClaimData.SelectedTanevID.Value, true);
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
|
||||
foreach (var item in dictionary)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
list.Add(sli);
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetEvfolyamListS()
|
||||
{
|
||||
|
||||
var dictionary = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.EvfolyamTipus, ClaimData.SelectedTanevID.Value, true);
|
||||
List<SelectListItem> list = new List<SelectListItem>();
|
||||
|
||||
foreach (var item in dictionary)
|
||||
{
|
||||
SelectListItem sli = new SelectListItem() { Text = item.Value, Value = item.Key };
|
||||
list.Add(sli);
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.Web.Areas.Tantargy.Models;
|
||||
using Kreta.Web.Attributes;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Tantargy.Controllers
|
||||
{
|
||||
[KretaGlobalLanguageChangeActionFilter(LanguageCode = "hu-Dualis")]
|
||||
public class TanulasiElemekController : BaseTanmenetController
|
||||
{
|
||||
public TanulasiElemekController(IKretaAuthorization authorization) : base(authorization)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
if (!Authorization.IsValidTanulasiElemek())
|
||||
{
|
||||
return Redirect(Url.Action("AccessDenied", "ErrorHandler", new { area = string.Empty }));
|
||||
}
|
||||
|
||||
var model = new TanmenetSearchModel
|
||||
{
|
||||
ControllerName = Constants.Controllers.TanulasiElemek,
|
||||
ApiControllerName = Constants.ApiControllers.TanulasiElemekApi,
|
||||
ImportControllerName = Constants.Controllers.TanulasiElemImportExport,
|
||||
IsFromSzervezet = true,
|
||||
};
|
||||
return View("~/Areas/Tantargy/Views/Tanmenet/Index.cshtml", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenNewTanmenetWindow()
|
||||
{
|
||||
var model = new NewTanmenetModel
|
||||
{
|
||||
ApiControllerName = Constants.ApiControllers.TanulasiElemekApi,
|
||||
};
|
||||
return OpenNewTanmenetWindow(model);
|
||||
}
|
||||
|
||||
public new ActionResult OpenEditTanmenetGridWindow(TanmenetOrakModel model)
|
||||
{
|
||||
model.ApiControllerName = Constants.ApiControllers.TanulasiElemekApi;
|
||||
return base.OpenEditTanmenetGridWindow(model);
|
||||
}
|
||||
|
||||
public new string ExportTanmenet(int tantargyId, int osztalyId)
|
||||
{
|
||||
return base.ExportTanmenet(tantargyId, osztalyId);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue