init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,159 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using System.Web.Http.Results;
|
||||
using Kendo.Mvc;
|
||||
using Kendo.Mvc.Infrastructure;
|
||||
using Kendo.Mvc.UI;
|
||||
using Kreta.BusinessLogic.Classes.ComboBox;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.BusinessLogic.Security;
|
||||
using Kreta.BusinessLogic.Utils;
|
||||
using Kreta.Enums;
|
||||
using Kreta.Framework;
|
||||
using Kreta.Framework.Util;
|
||||
using Kreta.Web.Areas.Adatszolgaltatasok.Models;
|
||||
using Kreta.Web.Helpers;
|
||||
using Kreta.Web.Helpers.Error;
|
||||
using Kreta.Web.Helpers.Grid;
|
||||
using Kreta.Web.Security;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Web.Areas.Adatszolgaltatasok.ApiControllers
|
||||
{
|
||||
[ApiRoleClaimsAuthorize(true)]
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public class TTFApiController : ApiController
|
||||
{
|
||||
private readonly IKozpontiKretaHelper KozpontiKretaHelper;
|
||||
|
||||
public TTFApiController(IKozpontiKretaHelper kozpontiKretaHelper)
|
||||
{
|
||||
KozpontiKretaHelper = kozpontiKretaHelper ?? throw new ArgumentNullException(nameof(kozpontiKretaHelper));
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public DataSourceResult GetTantargyFelosztasok(string data, [ModelBinder(typeof(ModelBinder.DataSourceRequestModelBinder))] DataSourceRequest request)
|
||||
{
|
||||
TantargyFelosztasSearchModel model = JsonConvert.DeserializeObject<TantargyFelosztasSearchModel>(data);
|
||||
|
||||
var helper = new TantargyFelosztasHelper(ConnectionTypeExtensions.GetSessionConnectionType());
|
||||
|
||||
helper.GridParameters = Converter.GridParameter(request);
|
||||
List<int> tantargyIds = model.SearchTantargy.HasValue ? new List<int> { model.SearchTantargy.Value } : null;
|
||||
var dataSet = helper.GetTantargyFelosztasData(model.SearchTanar, model.SearchOsztalyCsoport, tantargyIds, evfolyamId: model.SearchEvfolyam, foglalkozasTipusId: model.SearchFoglalkozasTipusa, feladatellatasiHelyId: model.SearchFeladatellatasihely, oraszam: model.SearchOraszam);
|
||||
|
||||
var dataSourceResult = dataSet.ToDataSourceResult();
|
||||
if (dataSourceResult != null && dataSet.Tables.Count == 1)
|
||||
{
|
||||
dataSourceResult.AggregateResults = new List<AggregateResult>
|
||||
{
|
||||
new AggregateResult(dataSet.Tables[0].ExtendedProperties["Oraszam_SUM"], new SumFunction { SourceField = "Oraszam" })
|
||||
};
|
||||
}
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public TantargyFelosztasSearchModel Veglegesites()
|
||||
{
|
||||
try
|
||||
{
|
||||
TantargyFelosztasSearchModel model = KozpontiKretaHelper.PostTTFEllenorzes(ClaimData.IntezmenyAzonosito, new TanevHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetTanevInfo());
|
||||
|
||||
return model;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new StatusError(
|
||||
HttpStatusCode.BadRequest,
|
||||
StringResourcesUtil.GetString(4049) /*Hiba történt a művelet közben*/)
|
||||
{
|
||||
UnHandledException = e
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[ApiValidateAjaxAntiForgeryToken]
|
||||
public TantargyFelosztasSearchModel GetStatus()
|
||||
{
|
||||
try
|
||||
{
|
||||
TantargyFelosztasSearchModel model = KozpontiKretaHelper.GetTTFEllenorzes(ClaimData.IntezmenyAzonosito, new TanevHelper(ConnectionTypeExtensions.GetSessionConnectionType()).GetTanevInfo());
|
||||
|
||||
return model;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new StatusError(
|
||||
HttpStatusCode.BadRequest,
|
||||
StringResourcesUtil.GetString(4049) /*Hiba történt a művelet közben*/)
|
||||
{
|
||||
UnHandledException = e
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public JsonResult<List<ComboBoxListItem>> GetTanar([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
var helper = new TanarHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
var dictionary = helper.GetAlkalmazottNevek(oktatasiAzonositoval: true);
|
||||
var dropdownListItems = new List<ComboBoxListItem>();
|
||||
|
||||
foreach (var item in dictionary)
|
||||
{
|
||||
var sli = new ComboBoxListItem() { Text = item.Value, Value = item.Key };
|
||||
dropdownListItems.Add(sli);
|
||||
}
|
||||
return Json(dropdownListItems);
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public JsonResult<List<ComboBoxListItem>> GetTanev([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
var helper = new TanevHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
var dictionary = helper.GetTanevekForDDL("");
|
||||
var dropdownListItems = new List<ComboBoxListItem>();
|
||||
|
||||
foreach (var item in dictionary)
|
||||
{
|
||||
var sli = new ComboBoxListItem() { Text = item.Value, Value = item.Key };
|
||||
dropdownListItems.Add(sli);
|
||||
}
|
||||
return Json(dropdownListItems);
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public JsonResult<List<ComboBoxListItem>> GetEvfolyamok([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
return Json(((int)GeneratedAdatszotarTipusEnum.EvfolyamTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToComboBoxItemList());
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public JsonResult<List<ComboBoxListItem>> GetFoglalkozasTipusok([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
return Json(((int)GeneratedAdatszotarTipusEnum.FoglalkozasTipus).GetItemsByType(ClaimData.SelectedTanevID.Value, true).ToComboBoxItemList());
|
||||
}
|
||||
|
||||
[ApiRolePackageAuthorize(KretaClaimPackages.Adminisztrator.ClaimValue)]
|
||||
public JsonResult<List<ComboBoxListItem>> GetFeladatellatasiHelyek([DataSourceRequest] DataSourceRequest request)
|
||||
{
|
||||
var helper = new FeladatEllatasiHelyHelper(ConnectionTypeExtensions.GetActiveSessionConnectionType());
|
||||
var dictionary = helper.GetFeladatEllatasiHelyDDl(StringResourcesUtils.GetString(364));
|
||||
var dropdownListItems = new List<ComboBoxListItem>();
|
||||
|
||||
foreach (var item in dictionary)
|
||||
{
|
||||
var sli = new ComboBoxListItem() { Text = item.Value, Value = item.Key };
|
||||
dropdownListItems.Add(sli);
|
||||
}
|
||||
return Json(dropdownListItems);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue