469 lines
22 KiB
Text
469 lines
22 KiB
Text
@using Kreta.Web.Security
|
|
@using Kreta.Enums.ManualEnums
|
|
@using Kreta.Resources
|
|
@using Kreta.Web.Areas.Tantargy.Models;
|
|
@using Kreta.Web.Helpers.Grid;
|
|
|
|
@model TantargyFelosztasModel
|
|
|
|
@section AddSearchPanel {
|
|
@using (Html.SearchPanelSideBar("searchForm", "TantargyFelosztasGrid"))
|
|
{
|
|
@Html.HiddenFor(x => x.IsFromSzervezet)
|
|
|
|
if (!Model.IsFromSzervezet && ClaimData.IsVegyes)
|
|
{
|
|
@Html.KretaComboBoxFor(x => x.SearchFeladatKategoriaId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetFeladatKategoriaSzuro" }), "Text", "Value").AutoBind(true).RenderSearchPanelSideBar()
|
|
}
|
|
|
|
@Html.KretaComboBoxFor(x => x.SearchOsztalCsoport, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetOsztalyCsoportListByEvfolyam", isDualisKepzohelyiCsoport = Model.IsFromSzervezet, tanarId = ClaimData.FelhasznaloId, szervezetAdatokHalmaza = (int)SzervezetAdatokHalmazaEnum.SzervezetEsAlSzervezetek }), "Text", "Value", useGroup: true).RenderSearchPanelSideBar()
|
|
|
|
if (!Model.IsFromSzervezet)
|
|
{
|
|
@Html.KretaCheckBoxFor(x => x.Osztalybontasokkal).RenderSearchPanelSideBar()
|
|
@Html.KretaCheckBoxFor(x => x.KapcsolodoCsoportokkal).RenderSearchPanelSideBar()
|
|
}
|
|
|
|
@Html.KretaComboBoxFor(x => x.SearchTanar, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetTanar", isFromSzervezet = Model.IsFromSzervezet }), "Text", "Value").RenderSearchPanelSideBar()
|
|
|
|
if (!Model.IsFromSzervezet)
|
|
{
|
|
@Html.KretaComboBoxFor(x => x.SearchTantargy, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetTantargy" }), "Text", "Value").RenderSearchPanelSideBar()
|
|
@Html.KretaComboBoxFor(x => x.SearchFeladatellatasihely, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetFeladatellatasiHelyek" }), "Text", "Value").RenderSearchPanelSideBar()
|
|
@Html.KretaNumericFor(x => x.SearchOraszam).Min(0).Max(Kreta.Core.Constants.General.TantargyfelosztasImportMaxOraszam).Step(0.25).RenderSearchPanelSideBar()
|
|
}
|
|
else
|
|
{
|
|
@Html.KretaTextBoxFor(x => x.DualisKepzohelyNeve).RenderSearchPanelSideBar()
|
|
@Html.KretaTextBoxFor(x => x.DualisKepzohelyAdoszama).RenderSearchPanelSideBar()
|
|
}
|
|
}
|
|
}
|
|
|
|
@section AddTip {
|
|
<ul id="tipList" style="display: none;">
|
|
<li>@(TantargyResource.Tipp) @(TantargyResource.AzIntezmenyRovidNeveJelenikMegAKretaRendszerFelsoSorabanHaTulHosszuAzIntezmenyNeveKerjukAdjonMegRovidNevet)</li>
|
|
<li>@(TantargyResource.Tipp) @(TantargyResource.AzIntezmenyAdataiAKretaRendszerTelepitesekorAutomatikusanBekerulnekASzoftverbe)</li>
|
|
<li>@(TantargyResource.Tipp) @(TantargyResource.AmennyibenAzIntezmenyiAdatokonValtoztatniSzuksegesKerjukVegyeFelAKapcsolatotFenntartojavalIsIlletveJelezzeAKirNek)</li>
|
|
</ul>
|
|
}
|
|
|
|
@{
|
|
List<RowFunction> TTFelosztasRowFunctionList = new List<RowFunction>();
|
|
List<RowFunction> TTFelosztasConditionalRowFunctionList = new List<RowFunction>();
|
|
if (ClaimManager.HasPackage("Adminisztrator", "Dualis_Admin", "IsSzakiranyuOktatasertFelelos") && !ClaimData.IsSelectedTanevIsElozo)
|
|
{
|
|
(Model.IsFromSzervezet ? TTFelosztasConditionalRowFunctionList : TTFelosztasRowFunctionList).Add(new RowFunction { Name = CommonResource.Modositas, ClientAction = "TantargyFelosztasHelper.Modify", IconEnum = GridRowFunctionIconEnum.Modositas });
|
|
}
|
|
|
|
TTFelosztasRowFunctionList.Add(new RowFunction { Name = CommonResource.Adatok, ClientAction = "TantargyFelosztasHelper.Detail", IconEnum = GridRowFunctionIconEnum.Adatok });
|
|
|
|
List<FunctionCommand> TTFelosztasFunctionCommandList = new List<FunctionCommand>();
|
|
|
|
if (ClaimManager.HasPackage("Adminisztrator", "Dualis_Admin", "IsSzakiranyuOktatasertFelelos") && !ClaimData.IsSelectedTanevIsElozo)
|
|
{
|
|
(Model.IsFromSzervezet ? TTFelosztasConditionalRowFunctionList : TTFelosztasRowFunctionList).Add(new RowFunction { Name = CommonResource.Torles, ClientAction = "TantargyFelosztasHelper.Delete", IconEnum = GridRowFunctionIconEnum.Torles });
|
|
|
|
TTFelosztasFunctionCommandList.Add(new FunctionCommand { Name = CommonResource.Uj, ClientAction = "TantargyFelosztasHelper.New" });
|
|
TTFelosztasFunctionCommandList.Add(new FunctionCommand { Name = CommonResource.KijeloltekTorlese, ClientAction = "TantargyFelosztasHelper.DeleteSelected", Classes = "kendo-gridFunctionKommandRed" });
|
|
}
|
|
|
|
if (ClaimManager.HasPackage("Fenntarto") && !ClaimData.IsSelectedTanevIsElozo)
|
|
{
|
|
if (Model.VeglegesTTF)
|
|
{
|
|
TTFelosztasFunctionCommandList.Add(new FunctionCommand { Name = TantargyResource.Elutasitas, ClientAction = "TantargyFelosztasHelper.Elutasitas" });
|
|
TTFelosztasFunctionCommandList.Add(new FunctionCommand { Name = TantargyResource.Elfogadas, ClientAction = "TantargyFelosztasHelper.Elfogadas" });
|
|
}
|
|
}
|
|
|
|
TTFelosztasFunctionCommandList.Add(new FunctionCommand
|
|
{
|
|
Name = TantargyResource.Export.ToUpper(),
|
|
NestedCommands = new List<FunctionCommand>
|
|
{
|
|
new FunctionCommand { Name = ImportExportCommonResource.Export, ClientAction = "TantargyFelosztasHelper.getExport" },
|
|
}
|
|
});
|
|
|
|
if (!Model.IsFromSzervezet)
|
|
{
|
|
var exports = TTFelosztasFunctionCommandList.Last().NestedCommands;
|
|
exports.Add(new FunctionCommand { Name = TantargyResource.ExportEgyszeru, ClientAction = "TantargyFelosztasHelper.SimpleExport" });
|
|
exports.Add(new FunctionCommand { Name = TantargyResource.Exportkereszttablas, ClientAction = "TantargyFelosztasHelper.LepedoExport" });
|
|
exports.Add(new FunctionCommand { Name = TantargyResource.ExportKereszttablasOsztalyokkal, ClientAction = "TantargyFelosztasHelper.LepedoOsztalyExport" });
|
|
}
|
|
|
|
var grid = Html.KretaGrid<TantargyFelosztasGridModel>
|
|
(
|
|
name: "TantargyFelosztasGrid",
|
|
getUrl: new GridApiUrl(Model.ApiControllerName, "GetTantargyFelosztasok", new Dictionary<string, string>() { { "isFromSzervezet", Model.IsFromSzervezet.ToString() } }),
|
|
allowFilterable: false,
|
|
allowPaging: true,
|
|
allowScrolling: true,
|
|
dataParameterFunction: "searchForm"
|
|
)
|
|
|
|
//tantargyFelosztasHelper.Detail
|
|
.SelectBoxColumn(Html, string.Empty)
|
|
.LinkButtonColumn("", x => x.TanarElotagNelkul, "TantargyFelosztasHelper.ModifyOrOpenInfo", GridButtonsEnum.Reszletek, customField: "Tanar")
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(x => x.Tanev).Width("10%");
|
|
columns.Bound(x => x.OsztalyCsoport);
|
|
columns.Bound(x => x.Tantargy);
|
|
columns.Bound(x => x.DualisKepzohelyNeve).Visible(Model.IsFromSzervezet);
|
|
columns.Bound(x => x.DualisKepzohelyAdoszama).Visible(Model.IsFromSzervezet);
|
|
columns.Bound(x => x.OsszevontOra_BNAME).Width("10%").Visible(!Model.IsFromSzervezet);
|
|
columns.Bound(x => x.NemzetisegiOra_BNAME).Width("10%").Visible(!Model.IsFromSzervezet);
|
|
columns.Bound(x => x.MegbizasiOraszam).Width("10%").Visible(!Model.IsFromSzervezet);
|
|
columns.Bound(x => x.TuloraSzam).Width("10%").Visible(!Model.IsFromSzervezet);
|
|
|
|
columns.Bound(x => x.Oraszam).Width("10%").ClientTemplate("#=TantargyFelosztasHelper.calculateOraszam(data)#")
|
|
.ClientFooterTemplate(TantargyResource.OldalonOsszesen +": #= TantargyFelosztasHelper.calculateOraszamOsszes()#").Visible(!Model.IsFromSzervezet);
|
|
})
|
|
.FunctionCommand(Html, TTFelosztasFunctionCommandList)
|
|
.Sortable(sortable => sortable
|
|
.AllowUnsort(true)
|
|
.SortMode(GridSortMode.MultipleColumn));
|
|
|
|
if (Model.IsFromSzervezet)
|
|
{
|
|
grid
|
|
.RowFunction(Html, TTFelosztasRowFunctionList, iconCount: TTFelosztasRowFunctionList.Count())
|
|
.ConditionalRowFunction(Html, TTFelosztasConditionalRowFunctionList, "TantargyFelosztasHelper.isSzerkesztheto", iconCount: TTFelosztasConditionalRowFunctionList.Count());
|
|
}
|
|
else
|
|
{
|
|
grid
|
|
.RowFunction(Html, TTFelosztasRowFunctionList);
|
|
}
|
|
}
|
|
|
|
<div>
|
|
@(grid)
|
|
</div>
|
|
@if (!Model.IsFromSzervezet)
|
|
{
|
|
<div style="font-weight: 700; text-align: right; margin-right: 10vw;">@TantargyResource.Osszesen: @(((double)ViewBag.Oraszam).ToString("0.##")) (@(((double)ViewBag.TtfKorrekcioOraszam).ToString("0.##")))</div>
|
|
}
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
if (!CommonUtils.isNullOrUndefined("@ClaimData.FelhelySzuro") && !CommonUtils.isNullOrUndefined($("#SearchFeladatellatasihely").data("kendoComboBox"))) {
|
|
$("#SearchFeladatellatasihely").data("kendoComboBox").value("@ClaimData.FelhelySzuro");
|
|
}
|
|
});
|
|
var TantargyFelosztasHelper = (function () {
|
|
var tantargyFelosztasHelper = function () { };
|
|
|
|
var searchFormName = "searchForm";
|
|
var gridName = "TantargyFelosztasGrid";
|
|
|
|
var url = {
|
|
OpenTantargyfelosztasFelvetelePopUp: "@Url.Action("OpenTantargyFelosztasFelvetelePopUp", Model.ControllerName, new { area = "Tantargy" })",
|
|
OpenTantargyfelosztasAdatokPopUp: "@Url.Action("OpenTantargyFelosztasAdatokPopUp", Model.ControllerName, new { area = "Tantargy" })",
|
|
DeleteTantargyFelosztas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "DeleteTantargyFelosztas" })",
|
|
DeleteSelectedTantargyFelosztas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new {controller = Model.ApiControllerName, action= "DeleteSelectedTantargyFelosztas" })",
|
|
OpenTantargyFelosztasModisitasPopUp: "@Url.Action("OpenTantargyFelosztasModositasPopUp", Model.ControllerName, new { area = "Tantargy", IsFromSzervezet = Model.IsFromSzervezet })",
|
|
ModifyFelosztas: "@Url.HttpRouteUrl("ActionApi", new { controller = Model.ApiControllerName, action = "ModifyTantargyFelosztas" })",
|
|
ModifyConfirmContent: "@Url.HttpRouteUrl("ActionApi", new { controller = Model.ApiControllerName, action = "ModifyTantargyFelosztasConfirmContent" })",
|
|
SimpleExport: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "ExportEgyszeruTantargyfelosztas" })",
|
|
LepedoExport: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.TantargyFelosztasApi, action = "ExportLepedoTantargyfelosztas" })",
|
|
LepedoOsztalyExport: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.TantargyFelosztasApi, action = "ExportLepedoOsztalyTantargyfelosztas" })",
|
|
ValidateTantargyFelosztasModify: "@Url.HttpRouteUrl("ActionApi", new { controller = Model.ApiControllerName, action = "ValidateTantargyFelosztasModify" })",
|
|
|
|
Elfogadas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.TantargyFelosztasApi, action = "Elfogadas" })",
|
|
Elutasitas: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.TantargyFelosztasApi, action = "Elutasitas" })",
|
|
OpenElutasitasWindow: "@Url.Action("OpenElutasitasWindow","TantargyFelosztas", new { area = "Tantargy" })",
|
|
StoreSelectedTanar: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "StoreSelectedTanar" })",
|
|
GetExport: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Model.ApiControllerName, action = "GetExport" })",
|
|
}
|
|
|
|
tantargyFelosztasHelper.New = function () {
|
|
openTantargyFelosztasFelveteleWindow();
|
|
};
|
|
|
|
tantargyFelosztasHelper.Delete = function (d) {
|
|
KretaWindowHelper.confirmWindow("@(CommonResource.Torles)", "@(TantargyResource.BiztosanTorliAFelosztast)", function () { manageDelete(d.ID); });
|
|
};
|
|
|
|
tantargyFelosztasHelper.DeleteSelected = function () {
|
|
var selectedRows = KretaGridHelper.getSelectedRowsByGridName(gridName);
|
|
if (selectedRows.length > 0) {
|
|
KretaWindowHelper.confirmWindow("@(CommonResource.Torles)", "@(CommonResource.BiztosanTorolniSzeretneAKijeloltElemeket)", function () { deleteSelected(selectedRows); });
|
|
}
|
|
else {
|
|
KretaWindowHelper.feedbackWindow("@(IntezmenyResource.Torles)", "@(IntezmenyResource.AKijeloltElemekTorlesehezJeloljonKiLegalabbEgyElemet)", true, KretaWindowHelper.destroyAllWindow);
|
|
}
|
|
}
|
|
|
|
function deleteSelected(selectedRows) {
|
|
var parameters = [];
|
|
if (CommonUtils.parseBool("@Model.IsFromSzervezet") && !selectedRows.every((x) => tantargyFelosztasHelper.isSzerkesztheto(x)))
|
|
{
|
|
KretaWindowHelper.warningWindow("@(CommonResource.Figyelmeztetes)", "@(IntezmenyResource.NincsMindenKijeloltElemhezSzerkesztesTorlesJogosultsaga)");
|
|
return;
|
|
}
|
|
$.each(selectedRows, function (index, value) {
|
|
parameters.push(value.ID);
|
|
});
|
|
|
|
AjaxHelper.DoPost(url.DeleteSelectedTantargyFelosztas, parameters, deleteSelectedResponseOk, deleteSelectedResponseError);
|
|
}
|
|
|
|
function deleteSelectedResponseError(data) {
|
|
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
|
AjaxHelper.ShowError(data);
|
|
}
|
|
|
|
function deleteSelectedResponseOk() {
|
|
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow, "@(!Model.IsFromSzervezet ? CommonResource.AMuveletSikeresenMegtortentAModositastKuldjeElAFentartojanak : CommonResource.AMuveletSikeresenMegtortent)");
|
|
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
|
}
|
|
|
|
tantargyFelosztasHelper.Modify = function (d) {
|
|
refreshGrid();
|
|
openTantargyFelosztasModositasaWindow(d.ID);
|
|
};
|
|
|
|
tantargyFelosztasHelper.Detail = function (d) {
|
|
openTantargyFelosztasAdatokWindow(d.ID);
|
|
};
|
|
tantargyFelosztasHelper.CloseWindow = function () {
|
|
closeAllWindow();
|
|
};
|
|
|
|
tantargyFelosztasHelper.ValidateFelosztas = function () {
|
|
AjaxHelper.DoPostElement(url.ValidateTantargyFelosztasModify, "tantargyFelosztasModositasForm", modifyFelosztasValidator);
|
|
}
|
|
|
|
function modifyFelosztasValidator(duplicated) {
|
|
if (duplicated) {
|
|
KretaWindowHelper.confirmWindow("@(CommonResource.Kerdes)", "@(TantargyResource.AModositaniKivantTantargyfelosztasMarSzerepel)", TantargyFelosztasHelper.ModifyFelosztas);
|
|
}
|
|
else {
|
|
TantargyFelosztasHelper.ModifyFelosztas();
|
|
}
|
|
};
|
|
|
|
tantargyFelosztasHelper.ModifyFelosztas = function () {
|
|
AjaxHelper.DoPostElement(url.ModifyConfirmContent, "tantargyFelosztasModositasForm", modifyFelosztasConfirm)
|
|
};
|
|
|
|
function modifyFelosztasConfirm(content) {
|
|
if (content) {
|
|
KretaWindowHelper.confirmWindow(
|
|
"@CommonResource.Figyelem",
|
|
content,
|
|
function () {
|
|
AjaxHelper.DoPostElement(url.ModifyFelosztas, "tantargyFelosztasModositasForm", sikeresModositas);
|
|
},
|
|
null,
|
|
null,
|
|
"@CommonResource.Tovabb",
|
|
"@CommonResource.Megse"
|
|
);
|
|
}
|
|
else {
|
|
AjaxHelper.DoPostElement(url.ModifyFelosztas, "tantargyFelosztasModositasForm", sikeresModositas);
|
|
}
|
|
};
|
|
|
|
tantargyFelosztasHelper.SimpleExport = function () {
|
|
KretaGridHelper.getExportBySearchForm(gridName, url.SimpleExport, searchFormName);
|
|
}
|
|
|
|
tantargyFelosztasHelper.LepedoExport = function () {
|
|
KretaGridHelper.getExportBySearchForm(gridName, url.LepedoExport, searchFormName);
|
|
}
|
|
|
|
tantargyFelosztasHelper.LepedoOsztalyExport = function () {
|
|
KretaGridHelper.getExportBySearchForm(gridName, url.LepedoOsztalyExport, searchFormName);
|
|
}
|
|
|
|
tantargyFelosztasHelper.FormazottExport = function () {
|
|
AjaxHelper.ShowIndicator();
|
|
setTimeout(AjaxHelper.DoPost("@Url.Action("ExportFormazottTantargyfelosztas", "TantargyFelosztas", new { area = "Tantargy" })", null, savefile), 1000);
|
|
}
|
|
|
|
tantargyFelosztasHelper.getExport = function () {
|
|
KretaGridHelper.getExportBySearchForm(gridName, url.GetExport, searchFormName);
|
|
}
|
|
|
|
function savefile(e) {
|
|
if (e.isBase64()) {
|
|
var dataUri = "data:text/plain;base64," + e;
|
|
|
|
kendo.saveAs({
|
|
dataURI: dataUri,
|
|
fileName: "@(TantargyResource.Tantargyfelosztas_Export)_@(DateTime.Now.ToString("yyyy_MM_dd")).xlsx"
|
|
});
|
|
} else {
|
|
KretaWindowHelper.warningWindow("@(CommonResource.Figyelem)", e);
|
|
}
|
|
|
|
setTimeout(AjaxHelper.HideIndicator(), 2000);
|
|
}
|
|
|
|
tantargyFelosztasHelper.Elfogadas = function () {
|
|
elfogadas();
|
|
}
|
|
|
|
tantargyFelosztasHelper.Elutasitas = function () {
|
|
elutasitas();
|
|
}
|
|
|
|
tantargyFelosztasHelper.SaveElutasitas = function () {
|
|
AjaxHelper.DoPostElement(url.Elutasitas, "ElutasitasMenteseForm", sikeresElutasitas);
|
|
}
|
|
|
|
tantargyFelosztasHelper.CloseElutasitasWindow = function () {
|
|
closeAllWindow();
|
|
}
|
|
|
|
function manageDelete(id) {
|
|
AjaxHelper.DoPost(url.DeleteTantargyFelosztas, id, function () { refreshGrid(); sikeresTorles(); });
|
|
};
|
|
function closeAllWindow() {
|
|
KretaWindowHelper.destroyAllWindow();
|
|
};
|
|
function openTantargyFelosztasAdatokWindow(id) {
|
|
AjaxHelper.DoPost(url.OpenTantargyfelosztasAdatokPopUp, { "id": id, "isFromSzervezet": "@Model.IsFromSzervezet" }, popFelosztasAdatokWindow);
|
|
};
|
|
|
|
function popFelosztasAdatokWindow(data) {
|
|
|
|
var config = KretaWindowHelper.getWindowConfigContainer();
|
|
config.title = "@(TantargyResource.TantargyfelosztasAdatok)";
|
|
config.content = data;
|
|
|
|
var modal = KretaWindowHelper.createWindow("tantargyFelosztasAdatokWindow", config);
|
|
KretaWindowHelper.openWindow(modal, true);
|
|
};
|
|
|
|
function openTantargyFelosztasModositasaWindow(id) {
|
|
AjaxHelper.DoPost(url.OpenTantargyFelosztasModisitasPopUp, { "id": id }, popFelosztasModositasWindow);
|
|
};
|
|
|
|
function popFelosztasModositasWindow(data) {
|
|
|
|
var config = KretaWindowHelper.getWindowConfigContainer();
|
|
config.title = "@(TantargyResource.TantargyfelosztasModositasa)";
|
|
config.content = data;
|
|
|
|
var modal = KretaWindowHelper.createWindow("tantargyFelosztasModositasWindow", config);
|
|
KretaWindowHelper.openWindow(modal, true);
|
|
};
|
|
|
|
function openTantargyFelosztasFelveteleWindow() {
|
|
AjaxHelper.DoPost(url.OpenTantargyfelosztasFelvetelePopUp, null, popNewFelosztasWindow);
|
|
};
|
|
|
|
function popNewFelosztasWindow(data) {
|
|
|
|
var config = KretaWindowHelper.getWindowConfigContainer();
|
|
config.title = "@(TantargyResource.TantargyfelosztasFelvetele)";
|
|
config.content = data;
|
|
|
|
var modal = KretaWindowHelper.createWindow("tantargyFelosztasFelveteleWindow", config);
|
|
KretaWindowHelper.openWindow(modal, true);
|
|
};
|
|
|
|
function refreshGrid() {
|
|
KretaGridHelper.refreshGrid("TantargyFelosztasGrid");
|
|
};
|
|
|
|
function sikeresModositas() {
|
|
KretaWindowHelper.successFeedBackWindow(closeAllWindow, "@(CommonResource.AMuveletSikeresenMegtortentAModositastKuldjeElAFentartojanak)");
|
|
refreshGrid();
|
|
};
|
|
|
|
function sikeresTorles() {
|
|
KretaWindowHelper.successFeedBackWindow(null, "@(CommonResource.AMuveletSikeresenMegtortentAModositastKuldjeElAFentartojanak)");
|
|
};
|
|
|
|
function elfogadas() {
|
|
AjaxHelper.DoPost(url.Elfogadas, null, sikeresElfogadas);
|
|
};
|
|
|
|
function sikeresElfogadas() {
|
|
KretaWindowHelper.feedbackWindow("@(CommonResource.Siker)", "@(TantargyResource.SikeresElfogadas)", false, function () { location.reload(true) });
|
|
};
|
|
|
|
function elutasitas() {
|
|
AjaxHelper.DoPost(url.OpenElutasitasWindow, null, popElutasitasWindow);
|
|
};
|
|
|
|
function popElutasitasWindow(data) {
|
|
|
|
var config = KretaWindowHelper.getWindowConfigContainer();
|
|
config.title = "@(TantargyResource.ElutasitasIndoklasa)";
|
|
config.content = data;
|
|
|
|
var modal = KretaWindowHelper.createWindow("TTFElutasitasWindow", config);
|
|
KretaWindowHelper.openWindow(modal, true);
|
|
};
|
|
|
|
function sikeresElutasitas() {
|
|
KretaWindowHelper.feedbackWindow("@(CommonResource.Siker)", "@(TantargyResource.SikeresElutasitas)", false, function () { location.reload(true) });
|
|
};
|
|
|
|
tantargyFelosztasHelper.onDataChange = function () {
|
|
if ($.isNumeric($('#TanarId').val())) {
|
|
AjaxHelper.DoPost(url.StoreSelectedTanar, $('#TanarId').val());
|
|
KretaGridHelper.refreshGridSearchPanel("TantargyFelosztasFelvetelGrid", "tantargyFelosztasForm");
|
|
}
|
|
else {
|
|
$('#TanarId').data('kendoComboBox').value('');
|
|
}
|
|
}
|
|
|
|
tantargyFelosztasHelper.calculateOraszam = function (data) {
|
|
if (data.TtfKorrekcioOraszam > 0) {
|
|
return `${data.Oraszam} (${data.TtfKorrekcioOraszam} )`;
|
|
}
|
|
else {
|
|
return `${data.Oraszam}`;
|
|
}
|
|
};
|
|
|
|
tantargyFelosztasHelper.calculateOraszamOsszes = function () {
|
|
var dataSource = KretaGridHelper.getKendoGridData(gridName).dataSource.data();
|
|
|
|
if (dataSource && dataSource.length > 0) {
|
|
var oraszamOsszes = 0;
|
|
var ttfKorrekcioOraszamOssz = 0;
|
|
|
|
$.each(dataSource, function (_, value) {
|
|
oraszamOsszes = (Number(oraszamOsszes) + Number(value.Oraszam)).toFixed(2);
|
|
ttfKorrekcioOraszamOssz = (Number(ttfKorrekcioOraszamOssz) + Number(value.TtfKorrekcioOraszam)).toFixed(2);
|
|
});
|
|
|
|
if (ttfKorrekcioOraszamOssz > 0) {
|
|
return `${Number(oraszamOsszes)} (${Number(ttfKorrekcioOraszamOssz)})`;
|
|
}
|
|
else {
|
|
return `${Number(oraszamOsszes)}`;
|
|
}
|
|
|
|
}
|
|
return 0;
|
|
};
|
|
|
|
tantargyFelosztasHelper.isSzerkesztheto = function (data) {
|
|
return CommonUtils.parseBool(data.IsSzerkesztheto);
|
|
}
|
|
|
|
tantargyFelosztasHelper.ModifyOrOpenInfo = function (data) {
|
|
if (tantargyFelosztasHelper.isSzerkesztheto(data)) {
|
|
tantargyFelosztasHelper.Modify(data);
|
|
}
|
|
else {
|
|
tantargyFelosztasHelper.Detail(data);
|
|
}
|
|
}
|
|
|
|
return tantargyFelosztasHelper;
|
|
})();
|
|
</script>
|