init
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user