init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes.ExcelHelpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Logic;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
public class ElozetesTantargyfelosztasController : Controller
|
||||
{
|
||||
// GET: Adatszolgaltatasok/ElozetesTantargyfelosztas
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var model = new TantargyFelosztasSearchModel();
|
||||
var intezmeny = TtfLogic.GetIntezmenyAdatok();
|
||||
model.IntezmenyId = intezmeny.ID;
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public string ExportEgyszeruTantargyfelosztas()
|
||||
{
|
||||
var helper = new TTFExportHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var memoryStream = helper.ExportEgyszeruTTF();
|
||||
|
||||
if (memoryStream != null)
|
||||
{
|
||||
return Convert.ToBase64String(memoryStream.ToArray());
|
||||
}
|
||||
|
||||
return ImportExportCommonResource.NincsElegendoAdatARendszerbenAzExportalashoz;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[MvcValidateAjaxAntiForgeryToken]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public string ExportLepedoTantargyfelosztas()
|
||||
{
|
||||
var helper = new TTFExportHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var memoryStream = helper.ExportLepedoTTF();
|
||||
|
||||
if (memoryStream != null)
|
||||
{
|
||||
return Convert.ToBase64String(memoryStream.ToArray());
|
||||
}
|
||||
|
||||
return ImportExportCommonResource.NincsElegendoAdatARendszerbenAzExportalashoz;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Exceptions;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.ApiControllers;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
//Note: kikapcsolva, mert jelenleg nincs használatban
|
||||
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
//[MvcRolePackageAuthorize(KretaClaimPackages.Fenntarto.ClaimValue, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class EnaploAdatszolgaltatasController : Controller
|
||||
{
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
public ActionResult Index()
|
||||
{
|
||||
EnaploAdatszolgaltatasApiController api = new EnaploAdatszolgaltatasApiController();
|
||||
EnaploAdatszolgaltatasModel model = api.GetEnaploAdatszolgaltatas();
|
||||
model.IgenNemList = GetIgenNemList();
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Uploads the agreement.
|
||||
/// </summary>
|
||||
/// <param name="szerzodesFile">The szerzodes file.</param>
|
||||
/// <param name="model">The model.</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public ActionResult UploadSzerzodes(HttpPostedFileBase szerzodesFile, EnaploAdatszolgaltatasModel model)
|
||||
{
|
||||
try
|
||||
{
|
||||
var input_file = szerzodesFile.InputStream;
|
||||
MemoryStream memoryStream = new MemoryStream();
|
||||
|
||||
var fileName = szerzodesFile.FileName;
|
||||
|
||||
byte[] buffer = new byte[16 * 1024];
|
||||
int read;
|
||||
while ((read = input_file.Read(buffer, 0, buffer.Length)) > 0)
|
||||
{
|
||||
memoryStream.Write(buffer, 0, read);
|
||||
}
|
||||
|
||||
var helper = new AdatszolgaltatasokHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
helper.SaveorUpdateSzerzodesForEnaploAdatszolgaltatas(memoryStream, fileName, model.ID);
|
||||
}
|
||||
catch (InvalidDataException ex)
|
||||
{
|
||||
return Content(ex.Message);
|
||||
}
|
||||
catch (KretaInvalidFileFormatException e)
|
||||
{
|
||||
return Content(e.Message);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Content(JsonConvert.SerializeObject(e));
|
||||
}
|
||||
|
||||
return Content(string.Empty);
|
||||
}
|
||||
|
||||
[MvcValidateAjaxAntiForgeryToken]
|
||||
[HttpPost]
|
||||
public ActionResult RemoveSzerzodes(HttpPostedFileBase szerzodesFile)
|
||||
{
|
||||
try
|
||||
{
|
||||
//Fájl törlés hack
|
||||
}
|
||||
catch (InvalidDataException ex)
|
||||
{
|
||||
return Content(ex.Message);
|
||||
}
|
||||
catch (KretaInvalidFileFormatException e)
|
||||
{
|
||||
return Content(e.Message);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Content(JsonConvert.SerializeObject(e));
|
||||
}
|
||||
|
||||
return Content(string.Empty);
|
||||
}
|
||||
|
||||
public List<SelectListItem> GetIgenNemList()
|
||||
{
|
||||
IDictionary<string, string> dictionary = FrameworkEnumExtensions.EnumToListManual<IgenNemEnum>();
|
||||
return dictionary.ToSelectListItemList();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes.ExcelHelpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Controllers;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class EslRiportController : Controller
|
||||
{
|
||||
public ActionResult IndexFelevi()
|
||||
{
|
||||
EslRiportModel model = new EslRiportModel { IsFelevi = true, FeladatellatasiHely = ClaimData.FelhelySzuro };
|
||||
return View("Index", model);
|
||||
}
|
||||
public ActionResult IndexEvvegi()
|
||||
{
|
||||
EslRiportModel model = new EslRiportModel { IsFelevi = false, FeladatellatasiHely = ClaimData.FelhelySzuro };
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[MvcValidateAjaxAntiForgeryToken]
|
||||
public string GetLemorzsolodasEslRiportExport(EslRiportModel model)
|
||||
{
|
||||
var stream = new EslRiportExportHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetLemorzsolodasEslRiportExport(model.FeladatellatasiHely, model.IsFelevi);
|
||||
var guid = Cache.Add(stream);
|
||||
|
||||
return Url.Action(nameof(CacheController.DownloadFile), nameof(CacheController).Replace("Controller", string.Empty), new { guid, fileName = AdatszolgaltatasokResource.LemorzsolodassalVeszelyeztetettTanulokExportFileName, contentType = Core.Constants.ContentTypes.Xlsx, area = string.Empty });
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class HittanOraszamController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
TanevCO tanevCo;
|
||||
|
||||
var tanev = new TanevHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
tanevCo = tanev.GetTanevInfo();
|
||||
|
||||
ViewBag.DateColumnTitle = string.Format(AdatszolgaltatasokResource.HittanCsoportLetszamOktoberFormat, tanevCo.KezdoNap.Year.ToString());
|
||||
|
||||
return View("Index");
|
||||
}
|
||||
|
||||
public ActionResult IndexForJanuar()
|
||||
{
|
||||
TanevCO tanevCo;
|
||||
|
||||
var tanev = new TanevHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
tanevCo = tanev.GetTanevInfo();
|
||||
|
||||
ViewBag.DateColumnTitle = string.Format(AdatszolgaltatasokResource.HittanCsoportLetszamFebruarFormat, tanevCo.UtolsoNap.Year.ToString());
|
||||
|
||||
return View("IndexForJanuar");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
using System.IO;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core;
|
||||
using Kreta.Core.FeatureToggle;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Areas.Nyomtatvanyok.Logic;
|
||||
using Kreta.Web.Controllers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class IktSzandeknyilatkozatokController : Controller
|
||||
{
|
||||
private readonly IFeatureContext FeatureContext;
|
||||
|
||||
public IktSzandeknyilatkozatokController(IFeatureContext featureContext)
|
||||
{
|
||||
FeatureContext = featureContext;
|
||||
}
|
||||
|
||||
#region Properties
|
||||
|
||||
public static string GridName => "IktSzandeknyilatkozatokGrid";
|
||||
|
||||
#endregion Properties
|
||||
|
||||
// GET: Adatszolgaltatasok/IktSzandeknyilatkozatok
|
||||
public ActionResult Index()
|
||||
{
|
||||
var model = new IktSzandeknyilatkozatokModel
|
||||
{
|
||||
IsElfogadottSzandeknyilatkozatList = new ComboBoxHelperEnumApiController(FeatureContext).GetIsElfogadottSzandeknyilatkozatEnumSelectList()
|
||||
};
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[MvcValidateAjaxAntiForgeryToken]
|
||||
public string DokumentumGeneralas()
|
||||
{
|
||||
MemoryStream stream = NyomtatvanyokLogic.GetIktSzandeknyilatkozatAdatok();
|
||||
var guid = Cache.Add(stream);
|
||||
|
||||
return Url.Action(nameof(CacheController.DownloadFile), nameof(CacheController).Replace("Controller", ""), new { guid, fileName = AdatszolgaltatasokResource.IktSzandeknyilatkozatokFileName, contentType = Core.Constants.ContentTypes.Pdf, area = "" });
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core.FeatureToggle;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.ApiControllers;
|
||||
using Kreta.Web.Controllers;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class InformatikaiAdatszolgaltatasController : Controller
|
||||
{
|
||||
private readonly IFeatureContext FeatureContext;
|
||||
|
||||
public InformatikaiAdatszolgaltatasController(IFeatureContext featureContext)
|
||||
{
|
||||
FeatureContext = featureContext;
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
var api = new InformatikaiAdatszolgaltatasApiController();
|
||||
var co = new InformatikaiAdatszolgHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetModelForIndex();
|
||||
var model = api.ConvertCoToModel(co);
|
||||
model.IgenNemList = new ComboBoxHelperEnumApiController(FeatureContext).GetIgenNemEnumSelectList();
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Logic;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(false)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue, KretaClaimPackages.IsSzakkepzoIntezmeny.ClaimValue)]
|
||||
public class ItmAdatszolgaltatasController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[MvcValidateAjaxAntiForgeryToken]
|
||||
public ActionResult GetEllenorzoTablazatLetoltese()
|
||||
{
|
||||
try
|
||||
{
|
||||
ActionResult fileStremResult = ItmAdatszolgaltatasLogic.EllenorzoTablazatLetoltese();
|
||||
|
||||
return fileStremResult;
|
||||
}
|
||||
catch (BlException ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Core;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class KozmuszamlaController : Controller
|
||||
{
|
||||
// GET: Adatszolgaltatasok/KozmuSzamlak
|
||||
public ActionResult Index()
|
||||
{
|
||||
KozmuszamlaSearchModel model = new KozmuszamlaSearchModel();
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenKozmuszamlaPopup(int? id)
|
||||
{
|
||||
bool isModify = id.IsEntityId();
|
||||
KozmuszamlaModel kozmuszamlaModel;
|
||||
if (isModify)
|
||||
{
|
||||
KozmuszamlaCO co = new KozmuszamlaHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType()).GetKozmuszamlaById(id.Value);
|
||||
kozmuszamlaModel = new KozmuszamlaModel
|
||||
{
|
||||
Id = co.Id.Value,
|
||||
BefizetesDatuma = co.BefizetesDatuma,
|
||||
FizetesiHatarido = co.FizetesiHatarido,
|
||||
Fizetve = co.Fizetve ? 1 : 0,
|
||||
InvaliditasOka = co.InvaliditasOka,
|
||||
Kelte = co.Kelte,
|
||||
Kibocsato = co.Kibocsato,
|
||||
KozmuszamlaTipusId = co.KozmuszamlaTipusId.Value,
|
||||
Osszeg = co.Osszeg.Value,
|
||||
PenznemId = co.PenznemId.Value,
|
||||
KozmuszamlaTipusList = GetKozmuszamlaTipusList(),
|
||||
PenznemTipusList = GetPenznemTipusList(),
|
||||
MerohelyId = co.MerohelyId,
|
||||
MerohelyList = GetMerohelyList()
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
kozmuszamlaModel = new KozmuszamlaModel
|
||||
{
|
||||
BefizetesDatuma = DateTime.UtcNow,
|
||||
FizetesiHatarido = DateTime.UtcNow,
|
||||
InvaliditasOka = "",
|
||||
Kelte = DateTime.UtcNow,
|
||||
Kibocsato = "",
|
||||
KozmuszamlaTipusId = (int)KozmuSzamlaTipusEnum.Egyeb,
|
||||
PenznemId = (int)PenznemTipusEnum.Forint,
|
||||
Fizetve = 0,
|
||||
Osszeg = 0,
|
||||
KozmuszamlaTipusList = GetKozmuszamlaTipusList(),
|
||||
PenznemTipusList = GetPenznemTipusList(),
|
||||
MerohelyId = null,
|
||||
MerohelyList = GetMerohelyList()
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
var popupModel = new PopUpModel(kozmuszamlaModel, "New_Modify_Popup");
|
||||
popupModel.AddCancelBtn(popupModel, "KozmuszamlaHelper.KozmuszamlaPopupCancel");
|
||||
popupModel.AddOkBtn(popupModel, "KozmuszamlaHelper.KozmuszamlaPopupSave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, popupModel);
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetMerohelyList()
|
||||
{
|
||||
var ds = new MerohelyHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetNemToroltMerohelyek();
|
||||
var merohelyDictionary = ds.Tables[0].AsEnumerable()
|
||||
.ToDictionary(row => row.Field<int>(0).ToString(), row => row.Field<string>(1));
|
||||
|
||||
return merohelyDictionary.ToSelectItemList();
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetPenznemTipusList()
|
||||
=> ((int)GeneratedAdatszotarTipusEnum.PenznemTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToSelectItemList();
|
||||
|
||||
private List<SelectListItem> GetKozmuszamlaTipusList()
|
||||
=> ((int)GeneratedAdatszotarTipusEnum.KozmuSzamlaTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToSelectItemList();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
using System;
|
||||
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.BusinessLogic.Utils;
|
||||
using Kreta.Core;
|
||||
using Kreta.Core.FileService;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class MerohelyController : Controller
|
||||
{
|
||||
private readonly IFileService _fileService;
|
||||
|
||||
public MerohelyController(IFileService fileService)
|
||||
{
|
||||
_fileService = fileService;
|
||||
}
|
||||
|
||||
// GET: Adatszolgaltatasok/KozmuAdatok
|
||||
public ActionResult Index()
|
||||
{
|
||||
MerohelySearchModel model = new MerohelySearchModel();
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult OpenMerohelyPopup(int? id)
|
||||
{
|
||||
bool isModify = id.IsEntityId();
|
||||
MerohelyModel merohelyModel;
|
||||
if (isModify)
|
||||
{
|
||||
MerohelyCO co = new MerohelyHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType()).GetMerohelyById(id.Value);
|
||||
merohelyModel = new MerohelyModel
|
||||
{
|
||||
Id = co.Id.Value,
|
||||
Nev = co.Nev,
|
||||
MeroallasFrissiteseSzukseges = co.MeroallasFrissiteseSzukseges,
|
||||
MerohelyTipusId = co.MerohelyTipusId,
|
||||
MukodesiHelyId = co.MukodesiHelyId,
|
||||
MerohelyTipusList = GetMerohelyTipusListList(),
|
||||
MukodesiHelyList = GetMukodesiHelyList()
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
merohelyModel = new MerohelyModel
|
||||
{
|
||||
Nev = "",
|
||||
MerohelyTipusId = (int)MerohelyTipusEnum.Egyeb,
|
||||
MerohelyTipusList = GetMerohelyTipusListList(),
|
||||
MukodesiHelyList = GetMukodesiHelyList()
|
||||
};
|
||||
}
|
||||
|
||||
var popupModel = new PopUpModel(merohelyModel, "New_Modify_Merohely_Popup");
|
||||
popupModel.AddCancelBtn(popupModel, "MerohelyHelper.MerohelyPopupCancel");
|
||||
popupModel.AddOkBtn(popupModel, "MerohelyHelper.MerohelyPopupSave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, popupModel);
|
||||
}
|
||||
|
||||
public ActionResult GetMerohelyDetailGrid(MerohelyGridModel merohely)
|
||||
{
|
||||
return PartialView("Merohely_DetailGrid", merohely);
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetMukodesiHelyList()
|
||||
{
|
||||
MukodesiHelyHelper helper = new MukodesiHelyHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
|
||||
return helper.GetMukodesiHelyekDDL(string.Empty).OrderBy(x => x.Value).ToDictionary(k => k.Key, v => v.Value).ToSelectItemList();
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetMerohelyTipusListList()
|
||||
=> ((int)GeneratedAdatszotarTipusEnum.MerohelyTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToSelectItemList();
|
||||
|
||||
public ActionResult OpenMeroallasPopup(int? id, int merohelyId)
|
||||
{
|
||||
bool isModify = id.IsEntityId();
|
||||
MeroallasModel meroallasModel;
|
||||
if (isModify)
|
||||
{
|
||||
MeroallasCO co = new MerohelyHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType()).GetMeroallasById(id.Value);
|
||||
|
||||
meroallasModel = new MeroallasModel
|
||||
{
|
||||
Id = co.Id.Value,
|
||||
MerohelyId = co.MerohelyId,
|
||||
Meroallas = co.MeroallasErtek,
|
||||
LeolvasasDatuma = co.LeolvasasDatuma,
|
||||
PictureId = co.KepId
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
meroallasModel = new MeroallasModel
|
||||
{
|
||||
Id = default(int),
|
||||
MerohelyId = merohelyId,
|
||||
LeolvasasDatuma = DateTime.UtcNow
|
||||
};
|
||||
}
|
||||
|
||||
var popupModel = new PopUpModel(meroallasModel, "New_Modify_Meroallas_Popup");
|
||||
popupModel.AddCancelBtn(popupModel, "MerohelyHelper.MeroallasPopupCancel");
|
||||
popupModel.AddOkBtn(popupModel, "MerohelyHelper.MeroallasPopupSave");
|
||||
|
||||
return PartialView(Constants.General.PopupView, popupModel);
|
||||
}
|
||||
|
||||
public ActionResult OpenMeroallasImagePopup(int id)
|
||||
{
|
||||
MeroallasImageModel meroallasImageModel = new MeroallasImageModel();
|
||||
|
||||
var picture = new MerohelyHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType()).GetPicture(_fileService, id);
|
||||
if (picture != null)
|
||||
{
|
||||
meroallasImageModel.Name = picture.Name;
|
||||
meroallasImageModel.ContentAsBase64EncodedString = picture.ContentAsBase64EncodedString;
|
||||
}
|
||||
|
||||
var popupModel = new PopUpModel(meroallasImageModel, "MeroallasImage_Popup");
|
||||
popupModel.AddCancelBtn(popupModel, "MerohelyHelper.MeroallasImage_PopupCancel");
|
||||
|
||||
return PartialView(Constants.General.PopupView, popupModel);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Client.SzirApi;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class NemAllamiIntOktKoltsegvetesController : Controller
|
||||
{
|
||||
private readonly ISzirApiClient _szirApiClient;
|
||||
|
||||
public NemAllamiIntOktKoltsegvetesController(ISzirApiClient szirApiClient)
|
||||
{
|
||||
_szirApiClient = szirApiClient ?? throw new ArgumentNullException(nameof(szirApiClient));
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
var model = new NemAllamiModel();
|
||||
try
|
||||
{
|
||||
var connectionType = ConnectionTypeExtensions.GetSessionConnectionType();
|
||||
var helper = new SZIRAdatszolgHelper(connectionType);
|
||||
var tanevSorszam = new TanevHelper(connectionType).GetTanevInfo().Sorszam;
|
||||
model.IsSzirStatAdatszolgBekuldeseDisabled = !helper.IsVezetoAlkalmazott(ClaimData.FelhasznaloId) ||
|
||||
helper.IsSzirStatAdatszolgBekuldeseDisabled(_szirApiClient, tanevSorszam, ClaimData.IntezmenyAzonosito);
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return View("Index", model);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult NemAllamiDetail(int id)
|
||||
{
|
||||
var szirStatHelper = new SZIRAdatszolgHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var co = szirStatHelper.GetNemAllamiCo(id);
|
||||
|
||||
var model = new NemAllamiDetailModel().ConvertCoToModel(co);
|
||||
return PartialView(model);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class OkosmeroEnergetikaiAdatController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
var model = new OkosmeroEnergetikaiAdatSearchModel();
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult Export([FromUri] OkosmeroEnergetikaiAdatSearchModel data)
|
||||
{
|
||||
var stream = new AdatszolgaltatasokHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetOkosmeroEnergetikaiAdatExport(data.FeladatellatasiHely);
|
||||
var result = new FileStreamResult(stream, Core.Constants.ContentTypes.Xlsx) { FileDownloadName = AdatszolgaltatasokResource.OkosmeroEnergetikaiAdatExport + "_" + DateTime.Now.ToString("yyyy_MM_dd") + ".xlsx" };
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.ApiControllers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class OsztalyokEsCsoportokController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
OsztalyokEsCsoportLetszamokApiController api = new OsztalyokEsCsoportLetszamokApiController();
|
||||
var model = api.GetStatusz();
|
||||
return View("Index", model);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
public class PedagogusIKTAdatszolgaltatasController : Controller
|
||||
{
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var iktAdatok = new PedagogusIKTAdatszolgaltatasHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetIKTAdatok();
|
||||
int? eNaploHasznalat = null;
|
||||
int? projektorokSzama = null;
|
||||
int projektorokSzamaGeneralt = 0;
|
||||
int? mukodoProjektorokSzama = null;
|
||||
int mukodoProjektorokSzamaGeneralt = 0;
|
||||
int? termekSzama = null;
|
||||
int termekSzamaGeneralt = 0;
|
||||
int? wifiLefedettTermekSzama = null;
|
||||
int wifiLefedettTermekSzamaGeneralt = 0;
|
||||
int? wifiEleres = null;
|
||||
if (iktAdatok != null)
|
||||
{
|
||||
eNaploHasznalat = SDAConvert.ToNullableInt32(iktAdatok["ENaploHasznalat"]);
|
||||
projektorokSzama = SDAConvert.ToNullableInt32(iktAdatok["ProjektorokSzama"]);
|
||||
projektorokSzamaGeneralt = SDAConvert.ToInt32(iktAdatok["ProjektorokSzamaGeneralt"]);
|
||||
mukodoProjektorokSzama = SDAConvert.ToNullableInt32(iktAdatok["MukodoProjektorokSzama"]);
|
||||
mukodoProjektorokSzamaGeneralt = SDAConvert.ToInt32(iktAdatok["MukodoProjektorokSzamaGeneralt"]);
|
||||
termekSzama = SDAConvert.ToNullableInt32(iktAdatok["TermekSzama"]);
|
||||
termekSzamaGeneralt = SDAConvert.ToInt32(iktAdatok["TermekSzamaGeneralt"]);
|
||||
wifiLefedettTermekSzama = SDAConvert.ToNullableInt32(iktAdatok["TermekSzamaWifi"]);
|
||||
wifiLefedettTermekSzamaGeneralt = SDAConvert.ToInt32(iktAdatok["TermekSzamaWifiGeneralt"]);
|
||||
wifiEleres = SDAConvert.ToNullableInt32(iktAdatok["WifiEleres"]);
|
||||
}
|
||||
var model = new PedagogusIKTAdatszolgaltatasModel
|
||||
{
|
||||
ENaploHasznalatList = GetENaploHasznalatList(eNaploHasznalat),
|
||||
WifiEleresList = GetWifiEleresList(wifiEleres),
|
||||
IKTKompetenciaSzintList = GetIKTKompetenciaSzintList(),
|
||||
IKTEszkozhasznalatModjaList = GetIKTEszkozhasznalatModjaList(),
|
||||
ElsodlegesIKTEszkozList = GetElsodlegesIKTEszkozList()
|
||||
};
|
||||
|
||||
model.ProjektorokSzama = projektorokSzama != null ? projektorokSzama : 0;
|
||||
model.MukodoProjektorokSzama = mukodoProjektorokSzama != null ? mukodoProjektorokSzama : 0;
|
||||
model.TermekSzama = termekSzama != null ? termekSzama : 0;
|
||||
model.WifiLefedettTermekSzama = wifiLefedettTermekSzama != null ? wifiLefedettTermekSzama : 0;
|
||||
|
||||
model.ProjektorokSzamaGeneralt = projektorokSzamaGeneralt;
|
||||
model.MukodoProjektorokSzamaGeneralt = mukodoProjektorokSzamaGeneralt;
|
||||
model.TermekSzamaGeneralt = termekSzamaGeneralt;
|
||||
model.WifiLefedettTermekSzamaGeneralt = wifiLefedettTermekSzamaGeneralt;
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetENaploHasznalatList(int? eNaploHasznalat)
|
||||
{
|
||||
var result = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.ENaploHasznalat, ClaimData.SelectedTanevID.Value).ToSelectListItemList();
|
||||
if (eNaploHasznalat.HasValue)
|
||||
{
|
||||
result.First(x => x.Value == eNaploHasznalat.Value.ToString()).Selected = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetWifiEleresList(int? wifiEleres)
|
||||
{
|
||||
var result = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.WiFiEleres, ClaimData.SelectedTanevID.Value).ToSelectListItemList();
|
||||
if (wifiEleres.HasValue)
|
||||
{
|
||||
result.First(x => x.Value == wifiEleres.Value.ToString()).Selected = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetIKTKompetenciaSzintList()
|
||||
{
|
||||
var result = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.IKTKompetenciaSzint, ClaimData.SelectedTanevID.Value).ToSelectListItemList();
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetIKTEszkozhasznalatModjaList()
|
||||
{
|
||||
var result = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.IKTEszkozhasznalatMod, ClaimData.SelectedTanevID.Value).ToSelectListItemList();
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<SelectListItem> GetElsodlegesIKTEszkozList()
|
||||
{
|
||||
var result = FrameworkEnumExtensions.EnumToList((int)GeneratedAdatszotarTipusEnum.ElsodlegesIKTEszkoz, ClaimData.SelectedTanevID.Value).ToSelectListItemList();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,274 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Mime;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Aspose.Cells;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Logic;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class SZIRAdatszolgController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
var szirStatHelper = new SZIRAdatszolgHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var isPanelsEditable = szirStatHelper.IsPanelsEditable();
|
||||
|
||||
var panelBarBaseModel = new PanelBarBaseModel
|
||||
{
|
||||
PanelName = "SZIRAdatszolgPanel",
|
||||
ChildModels = new List<PanelBarChildModel>
|
||||
{
|
||||
new PanelBarChildModel() { PartialViewName = "Intezmeny_Partial", PartialViewTitle = SZIRAdatszolgResource.IntezmenyEllenorzes },
|
||||
new PanelBarChildModel() { PartialViewName = "AMI_Partial", PartialViewTitle = SZIRAdatszolgResource.AMI },
|
||||
new PanelBarChildModel() { PartialViewName = "Kollegium_Partial", PartialViewTitle = SZIRAdatszolgResource.KollegiumAdatszolgaltatas },
|
||||
new PanelBarChildModel() { PartialViewName = "Oktatok_Partial", PartialViewTitle = SZIRAdatszolgResource.Oktatok },
|
||||
new PanelBarChildModel() { PartialViewName = "NemOktatok_Partial", PartialViewTitle = SZIRAdatszolgResource.NemOktatok },
|
||||
new SZIRAdatszolgInfraModel() { PartialViewName = "Infra_Partial", PartialViewTitle = SZIRAdatszolgResource.Infra, IsPanelEditable = isPanelsEditable },
|
||||
new PanelBarChildModel() { PartialViewName = "Osztaly_Partial", PartialViewTitle = SZIRAdatszolgResource.Osztaly },
|
||||
new PanelBarChildModel() { PartialViewName = "TanuloEvEleje_Partial", PartialViewTitle = SZIRAdatszolgResource.TanuloEvEleje },
|
||||
new SZIRAdatszolgaltatasTanuloEvVegeModel() { PartialViewName = "TanuloEvVege_Partial", PartialViewTitle = SZIRAdatszolgResource.TanuloEvVege, IsPanelEditable = isPanelsEditable },
|
||||
new SZIRAdatszolgaltatasKonyvtarModel() { PartialViewName = "Konyvtar_Partial", PartialViewTitle = SZIRAdatszolgResource.KonyvtarAdatszolgaltatas, IsPanelEditable = isPanelsEditable }
|
||||
}
|
||||
};
|
||||
|
||||
var intezmenyConfigHelper = new IntezmenyConfigHelper(ConnectionTypeExtensions.GetSystemConnectionType());
|
||||
var isSzirStatAdatszolgBekuldeseEnabled = intezmenyConfigHelper.GetIntezmenyConfig<bool>(IntezmenyConfigModulEnum.SzirStatAdatszolgBekuldese, IntezmenyConfigTipusEnum.IsEnabled);
|
||||
|
||||
var isAdatokRendbenABekuldeshez = szirStatHelper.IsAdatokRendbenABekuldeshez();
|
||||
|
||||
var model = new SZIRAdatszolgModel()
|
||||
{
|
||||
panelBarBaseModel = panelBarBaseModel,
|
||||
BekuldesDatum = szirStatHelper.GetBekuldesDatuma(),
|
||||
IsSzirStatAdatszolgBekuldeseEnabled = isSzirStatAdatszolgBekuldeseEnabled,
|
||||
IsAdatokRendbenABekuldeshez = isAdatokRendbenABekuldeshez
|
||||
};
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
public ActionResult Intezmeny()
|
||||
{
|
||||
try
|
||||
{
|
||||
var wb = SZIRAdatszolgLogic.GetIntezmenyiAdatszolgSZIRStatContent();
|
||||
return GetExcelFile(wb, "Intezmeny_OSAP_adatszolg_");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Kollegium()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetKollegiumHeaderRow(wb);
|
||||
SZIRAdatszolgLogic.SetKollegiumContentRows(wb);
|
||||
|
||||
return GetExcelFile(wb, "Kollegium_OSAP_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult AMI()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetAmiHeaderRow(wb);
|
||||
SZIRAdatszolgLogic.SetAmiContentRows(wb);
|
||||
|
||||
return GetExcelFile(wb, "AMI_OSAP_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Oktatok()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetOktatoHeaderRow(wb);
|
||||
SZIRAdatszolgLogic.SetOktatoContentRows(wb);
|
||||
|
||||
return GetExcelFile(wb, "Oktato_OSAP_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult NemOktatok()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetNemOktatoHeaderRow(wb);
|
||||
SZIRAdatszolgLogic.SetNemOktatoContentRows(wb);
|
||||
|
||||
return GetExcelFile(wb, "Nem_oktato_OSAP_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Infra()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetInfraHeaderRow(wb);
|
||||
SZIRAdatszolgLogic.SetInfraContentRows(wb);
|
||||
|
||||
return GetExcelFile(wb, "Infra_OSAP_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult NemAllami()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetNemAllamiHeaderRow(wb);
|
||||
SZIRAdatszolgLogic.SetNemAllamiContentRows(wb);
|
||||
|
||||
SZIRAdatszolgLogic.SetNemAllamiSegedMagyarazat(wb);
|
||||
return GetExcelFile(wb, "KSH2535_penzugyi_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Osztaly()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetOsztalyHeaderRow(wb);
|
||||
SZIRAdatszolgLogic.SetOsztalyContentRows(wb);
|
||||
|
||||
return GetExcelFile(wb, "Osztaly_OSAP_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult TanuloEvEleje()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetTanuloEvElejeHeaderRow(wb);
|
||||
SZIRAdatszolgLogic.SetTanuloEvElejeContentRows(wb);
|
||||
|
||||
return GetExcelFile(wb, "Tanulo_Ev_Eleje_OSAP_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult TanuloEvVege()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetTanuloEvVegeHeaderRow(wb);
|
||||
SZIRAdatszolgLogic.SetTanuloEvVegeContentRows(wb);
|
||||
|
||||
return GetExcelFile(wb, "Tanulo_Ev_Vege_OSAP_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Konyvtar()
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var wb = new Workbook(FileFormatType.Xlsx))
|
||||
{
|
||||
SZIRAdatszolgLogic.SetKonyvtarHeaders(wb);
|
||||
SZIRAdatszolgLogic.SetKonyvtarContentRows(wb);
|
||||
|
||||
return GetExcelFile(wb, "Konyvtar_OSAP_adatszolg_");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new StatusError((int)HttpStatusCode.InternalServerError, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static ActionResult GetExcelFile(Workbook wb, string dokumentumNev)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
wb.Save(ms, new OoxmlSaveOptions(SaveFormat.Xlsx));
|
||||
|
||||
ms.Position = 0;
|
||||
|
||||
return new FileContentResult(ms.ToArray(), MediaTypeNames.Application.Octet)
|
||||
{
|
||||
FileDownloadName = HttpUtility.UrlEncode($"{dokumentumNev}_{DateTime.Now:yyyy_MM_dd_HH_mm}.{Constants.ImportExport.FileFormatXlsx}", Encoding.UTF8),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.ModelBinder.Mvc;
|
||||
using Kreta.Web.Models.EditorTemplates;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class SZIRStatController : Controller
|
||||
{
|
||||
private readonly IFileServiceHelper fileServiceHelper;
|
||||
|
||||
public SZIRStatController(IFileServiceHelper fileServiceHelper)
|
||||
{
|
||||
this.fileServiceHelper = fileServiceHelper ?? throw new ArgumentNullException(nameof(fileServiceHelper));
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
var panelBarBaseModel = new PanelBarBaseModel { PanelName = "SZIRStatPanel" };
|
||||
var panelBarChildModelList = new List<PanelBarChildModel>();
|
||||
|
||||
SZIRStatHelper szirStatHelper = new SZIRStatHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var szirStatTipusok = Enum.GetValues(typeof(SzirStatTipusEnum)).OfType<SzirStatTipusEnum>().ToList();
|
||||
|
||||
foreach (SzirStatTipusEnum szirStatTipus in szirStatTipusok)
|
||||
{
|
||||
var data = new List<object>();
|
||||
string szirStatTipusNev = szirStatTipus.GetDisplayName(ClaimData.SelectedTanevID.Value);
|
||||
int szirStatTipusId = (int)szirStatTipus;
|
||||
if (szirStatTipus != SzirStatTipusEnum.osa1int)
|
||||
{
|
||||
Dictionary<int, string> szirStatFeladatellatasiHelyFileNevDictionary = szirStatHelper.GetKirSzirFeladatellatasiHelyList();
|
||||
foreach (var szirStatFeladatellatasiHelyId in szirStatFeladatellatasiHelyFileNevDictionary.Keys)
|
||||
{
|
||||
data.Add(new PanelBarChildDataModel
|
||||
{
|
||||
TipusId = szirStatTipusId,
|
||||
FeladatellatasiHelyId = szirStatFeladatellatasiHelyId,
|
||||
Description = szirStatFeladatellatasiHelyFileNevDictionary[szirStatFeladatellatasiHelyId]
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
data.Add(new PanelBarChildDataModel
|
||||
{
|
||||
TipusId = szirStatTipusId,
|
||||
FeladatellatasiHelyId = 0,
|
||||
Description = Core.Constants.General.Intezmeny
|
||||
});
|
||||
}
|
||||
panelBarChildModelList.Add(new PanelBarChildModel() { PartialViewName = "PanelBarDefaultView", PartialViewTitle = szirStatTipusNev, Data = data });
|
||||
}
|
||||
panelBarBaseModel.ChildModels = panelBarChildModelList;
|
||||
|
||||
return View("Index", panelBarBaseModel);
|
||||
}
|
||||
|
||||
public ActionResult LoadSZIRStatDokumentumPartial(SZIRStatDokumentumModel model)
|
||||
{
|
||||
SZIRStatCO co = new SZIRStatHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetSzirStatFileByTipusIdAndFeladatellatasiHelyId(model.SzirStatTipusId, model.FeladatellatasiHelyId);
|
||||
return PartialView("SZIRStat_Dokumentum_Partial", ConvertCoToModel(co));
|
||||
}
|
||||
|
||||
public ActionResult DeleteAndReLoadSZIRStatDokumentumPartial(SZIRStatDokumentumModel model)
|
||||
{
|
||||
SZIRStatCO co = new SZIRStatHelper(ConnectionTypeExtensions.GetSessionConnectionType(), fileServiceHelper).DeleteSzirStatFileAndGetSzirStatFileByTipusIdAndFeladatellatasiHelyId(model.SzirStatTipusId, model.FeladatellatasiHelyId);
|
||||
return PartialView("SZIRStat_Dokumentum_Partial", ConvertCoToModel(co));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult UploadFile([ModelBinder(typeof(AlapdokumentumFileUploadBinder))] IEnumerable<System.Web.HttpPostedFileBase> files, int SzirStatTipusId, int FeladatellatasiHelyId)
|
||||
{
|
||||
if (files != null && files.Any())
|
||||
{
|
||||
List<HttpPostedFileBase> uploadedFiles = files.ToList();
|
||||
var helper = new SZIRStatHelper(ConnectionTypeExtensions.GetSessionConnectionType(), fileServiceHelper);
|
||||
helper.Upload(uploadedFiles[0], ClaimData.IntezmenyGuid.Value, SzirStatTipusId, FeladatellatasiHelyId);
|
||||
}
|
||||
return Content("");
|
||||
}
|
||||
|
||||
public ActionResult DownloadFile(FormCollection form)
|
||||
{
|
||||
string dokumentumId = form["FileIdHiddenField"];
|
||||
|
||||
SZIRStatHelper helper = new SZIRStatHelper(ConnectionTypeExtensions.GetSessionConnectionType(), fileServiceHelper);
|
||||
|
||||
(string fajlnev, byte[] tartalom) = helper.GetFileData(int.Parse(dokumentumId));
|
||||
MemoryStream stream = new MemoryStream(tartalom);
|
||||
FileStreamResult result = File(stream, System.Web.MimeMapping.GetMimeMapping(fajlnev), fajlnev);
|
||||
return result;
|
||||
}
|
||||
|
||||
private SZIRStatDokumentumModel ConvertCoToModel(SZIRStatCO co)
|
||||
{
|
||||
return new SZIRStatDokumentumModel()
|
||||
{
|
||||
SzirStatTipusId = co.SzirStatTipusId,
|
||||
FeladatellatasiHelyId = co.FeladatellatasiHelyId,
|
||||
FeladatellatasiHelyNev = co.FeladatellatasiHelyNev,
|
||||
SzirStatFileId = co.SzirStatFileId,
|
||||
FileId = co.FileId,
|
||||
FileNev = co.FileNev,
|
||||
FeltoltesDatuma = co.FeltoltesDatuma,
|
||||
Statusz = co.Statusz
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using System.Web.Mvc;
|
||||
using Kreta.BusinessLogic.Classes.ExcelHelpers;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Resources;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Logic;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Security;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.Controllers
|
||||
{
|
||||
[MvcRoleClaimsAuthorize(true)]
|
||||
[MvcRolePackageDenyAuthorize(KretaClaimPackages.IsOnlyAlkalmozott.ClaimValue)]
|
||||
public class VeglegesTantargyfelosztasController : Controller
|
||||
{
|
||||
private readonly IKozpontiKretaHelper KozpontiKretaHelper;
|
||||
|
||||
public VeglegesTantargyfelosztasController(IKozpontiKretaHelper kozpontiKretaHelper)
|
||||
{
|
||||
KozpontiKretaHelper = kozpontiKretaHelper ?? throw new ArgumentNullException(nameof(kozpontiKretaHelper));
|
||||
}
|
||||
|
||||
// GET: Adatszolgaltatasok/VeglegesTantargyfelosztas
|
||||
[MvcRolePackageAuthorize(TanevEnum.AktEsKovTanev, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public ActionResult Index()
|
||||
{
|
||||
TantargyFelosztasSearchModel model = KozpontiKretaHelper.GetTTFEllenorzes(ClaimData.IntezmenyAzonosito, new TanevHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetTanevInfo());
|
||||
|
||||
var intezmeny = TtfLogic.GetIntezmenyAdatok();
|
||||
model.VeglegesTTF = intezmeny.VeglegesTTF;
|
||||
model.VeglegesESL = intezmeny.VeglegesESL;
|
||||
model.ElfogadottTTF = intezmeny.ElfogadottTTF;
|
||||
model.ElfogadottESL = intezmeny.ElfogadottESL;
|
||||
model.IntezmenyId = intezmeny.ID;
|
||||
model.VeglegesETTF = intezmeny.VeglegesETTF;
|
||||
|
||||
return View("Index", model);
|
||||
}
|
||||
|
||||
[MvcRolePackageAuthorize(TanevEnum.AktEsKovTanev, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public string ExportEgyszeruTantargyfelosztas()
|
||||
{
|
||||
var helper = new TTFExportHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var memoryStream = helper.ExportEgyszeruTTF();
|
||||
|
||||
if (memoryStream != null)
|
||||
{
|
||||
return Convert.ToBase64String(memoryStream.ToArray());
|
||||
}
|
||||
|
||||
return ImportExportCommonResource.NincsElegendoAdatARendszerbenAzExportalashoz;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[MvcValidateAjaxAntiForgeryToken]
|
||||
[MvcRolePackageAuthorize(TanevEnum.AktEsKovTanev, KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public string ExportLepedoTantargyfelosztas()
|
||||
{
|
||||
var helper = new TTFExportHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
var memoryStream = helper.ExportLepedoTTF();
|
||||
|
||||
if (memoryStream != null)
|
||||
{
|
||||
return Convert.ToBase64String(memoryStream.ToArray());
|
||||
}
|
||||
|
||||
return ImportExportCommonResource.NincsElegendoAdatARendszerbenAzExportalashoz;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue