202 lines
No EOL
8.8 KiB
Text
202 lines
No EOL
8.8 KiB
Text
@using Kreta.Web.Helpers.Grid;
|
|
@using Kreta.Web.Areas.KirImportExport.Models.KirImport
|
|
@using Kreta.Enums.ManualEnums
|
|
@using Kreta.Resources
|
|
@using Kreta.BusinessLogic.Classes
|
|
@model KirSearchModel
|
|
|
|
@{
|
|
var searchFormName = "searchForm";
|
|
var gridName = "KirTanuloImportGrid";
|
|
}
|
|
|
|
@Scripts.Render("~/bundles/KirSzinkronHelper")
|
|
|
|
@section AddSearchPanel {
|
|
|
|
@using (Html.SearchPanelSideBar(searchFormName, gridName))
|
|
{
|
|
@(Html.KretaComboBoxFor(x => x.KirTelephelyId, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.KirTanuloImportApi, action = "GetKirTelephelyList" }))
|
|
.AutoBind(true)
|
|
.SelectedIndex(0)
|
|
.Events(e => e.DataBound("KirTanuloImportHelper.fillGrid"))
|
|
.RenderSearchPanelSideBar())
|
|
@Html.KretaTextBoxFor(model => model.NevSearch).RenderSearchPanelSideBar()
|
|
@Html.KretaTextBoxFor(x => x.OktatasiAzonositoSearch).RenderSearchPanelSideBar()
|
|
@Html.KretaRangeDatePickerSideBar(x => x.SzuletesiDatumTol, x => x.SzuletesiDatumIg)
|
|
@Html.KretaTextBoxFor(model => model.SzuletesiHelySearch).RenderSearchPanelSideBar()
|
|
@Html.KretaComboBoxFor(x => x.StatuszSearch, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = "ComboBoxHelperEnumApi", action = "GetKirSzerkesztehetoEnumList" }), "Text", "Value").AutoBind(true).RenderSearchPanelSideBar()
|
|
}
|
|
}
|
|
|
|
<div>
|
|
@(
|
|
Html.KretaGrid<KirGridModel>
|
|
(
|
|
name: gridName,
|
|
getUrl: new GridApiUrl(Constants.ApiControllers.KirTanuloImportApi, "GetKirTanulokGrid"),
|
|
dataParameterFunction: searchFormName,
|
|
errorHandlerFunction: "KirTanuloImportHelper.feedbackGridError"
|
|
)
|
|
.SelectBoxColumn(Html, string.Empty)
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(c => c.Nev);
|
|
columns.Bound(c => c.OktatasiAzonosito);
|
|
columns.Bound(c => c.SzuletesiIdo).Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]);
|
|
columns.Bound(c => c.SzuletesiHely);
|
|
columns.Bound(c => c.ValtozottString);
|
|
})
|
|
.ConditionalRowFunction(Html, new List<RowFunction> {
|
|
new RowFunction { Name = IntezmenyResource.Adatok, ClientAction= "KirTanuloImportHelper.checkLoginBeforeOpenTanuloInfoWindow", IconEnum = GridRowFunctionIconEnum.Adatok }
|
|
}, "KirTanuloImportHelper.isVisible")
|
|
.ConditionalRowFunction(Html, new List<RowFunction> {
|
|
new RowFunction { Name = IntezmenyResource.Modositas, ClientAction= "KirTanuloImportHelper.checkLoginBeforeOpenOpenTanuloComparePopup", IconEnum = GridRowFunctionIconEnum.Modositas }
|
|
}, "KirTanuloImportHelper.isEditable")
|
|
.FunctionCommand(Html, new List<FunctionCommand> {
|
|
new FunctionCommand { Name = KirImportExportResource.KijeloltekSzinkronizalasa, ClientAction = "KirTanuloImportHelper.modifySelected" }
|
|
})
|
|
.Sortable(sortable => sortable
|
|
.AllowUnsort(true)
|
|
.SortMode(GridSortMode.MultipleColumn))
|
|
.AutoBind(false)
|
|
)
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var KirTanuloImportHelper = (function () {
|
|
var kirTanuloImportHelper = function () { };
|
|
|
|
var gridName = "@gridName";
|
|
var searchFormName = "@searchFormName";
|
|
var gridNameList = "TanuloAlapadatokGrid" + ",TanuloElerhetosegAdatokGrid" + ",TanuloJogviszonyAdatokGrid";
|
|
|
|
var url = {
|
|
OpenTanuloKretaKirOsszehasonlitasPopup: "@Url.Action("OpenTanuloComparePopup", Constants.Controllers.KirTanulo, new { area = Constants.Areas.KirImportExport })",
|
|
OpenTanuloInfoPopUp: "@Url.Action("OpenTanuloInfoPopUp", Constants.Controllers.KirTanulo, new { area = Constants.Areas.KirImportExport })",
|
|
KirLoginCheck: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.KirAuthenticationApi, action = "KirLoginCheck" })",
|
|
ToIndex: "@Url.Action("Index", Constants.Controllers.KirTanulo, new { area = Constants.Areas.KirImportExport })",
|
|
Modify: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.KirTanuloImportApi, action = "ModifyTanulo" })",
|
|
UpdateSelected: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.KirTanuloImportApi, action = "ModifySelected" })"
|
|
}
|
|
|
|
kirTanuloImportHelper.fillGrid = function () {
|
|
var grid = $('#'+gridName).data('kendoGrid');
|
|
grid.dataSource.read();
|
|
}
|
|
|
|
kirTanuloImportHelper.isVisible = function (rowData) {
|
|
return rowData.Szerkesztheto != @((int)KirEditableEnum.Uj);
|
|
}
|
|
|
|
kirTanuloImportHelper.isEditable = function (rowData) {
|
|
return rowData.Szerkesztheto == @((int)KirEditableEnum.ModositasraVar);
|
|
}
|
|
|
|
kirTanuloImportHelper.checkLoginBeforeOpenTanuloInfoWindow = function (rowData) {
|
|
AjaxHelper.DoPost(url.KirLoginCheck, {}, openTanuloInfoWindow(rowData.ID), feedbackError);
|
|
}
|
|
|
|
function openTanuloInfoWindow(tanuloId) {
|
|
AjaxHelper.DoPost(url.OpenTanuloInfoPopUp, { TanuloId: tanuloId }, popUpInfoWindow);
|
|
}
|
|
|
|
kirTanuloImportHelper.checkLoginBeforeOpenOpenTanuloComparePopup = function (rowData) {
|
|
AjaxHelper.DoPost(url.KirLoginCheck, {}, openTanuloComparePopup(rowData.ID), feedbackError);
|
|
}
|
|
|
|
function openTanuloComparePopup(tanuloId) {
|
|
AjaxHelper.DoPost(url.OpenTanuloKretaKirOsszehasonlitasPopup, { TanuloId: tanuloId }, popUpTanuloCompare);
|
|
}
|
|
|
|
kirTanuloImportHelper.feedbackGridError = function ()
|
|
{
|
|
AjaxHelper.DoPost(url.KirLoginCheck, {}, undefined, feedbackError);
|
|
}
|
|
|
|
kirTanuloImportHelper.modifyAddSave = function () {
|
|
KirSzinkronHelper.collectSzinkronData(gridNameList, url.Modify);
|
|
}
|
|
|
|
kirTanuloImportHelper.tanuloInfoCancel = function () {
|
|
KretaWindowHelper.destroyWindow("tanuloInfoWindow");
|
|
}
|
|
|
|
kirTanuloImportHelper.propertiesCancel = function () {
|
|
KretaWindowHelper.destroyWindow("popUpTanuloCompare");
|
|
}
|
|
|
|
kirTanuloImportHelper.modifySelected = function () {
|
|
var selectedRows = KretaGridHelper.getSelectedRowsByGridName(gridName);
|
|
|
|
if (selectedRows.length > 0) {
|
|
KretaWindowHelper.confirmWindow("@(IntezmenyResource.Figyelmeztetes)", "@(KirImportExportResource.KijeloltElemekFrissitveLesznekAKirbenTalalhatoBizonyosAdatokkalBiztosFolytatjaASzinkronizalast)", function () { modifySelected(selectedRows); });
|
|
}
|
|
else {
|
|
KretaWindowHelper.feedbackWindow("@(IntezmenyResource.Figyelmeztetes)", "@(KirImportExportResource.ASzinkronizalashozLegalabbEgyElemetSzuksegesKijelolni)", true, KretaWindowHelper.destroyAllWindow);
|
|
}
|
|
}
|
|
|
|
function modifySelected(selectedRows) {
|
|
var parameters = [];
|
|
|
|
$.each(selectedRows, function (index, value) {
|
|
parameters.push({
|
|
"OktatasiAzonosito": value.OktatasiAzonosito,
|
|
"FelhasznaloId": value.ID,
|
|
});
|
|
});
|
|
|
|
AjaxHelper.DoPost(url.UpdateSelected, parameters, modifySelectedResponseOk, modifySelectedesponseError);
|
|
}
|
|
|
|
function modifySelectedesponseError(data) {
|
|
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
|
AjaxHelper.ShowError(data);
|
|
}
|
|
|
|
function modifySelectedResponseOk(data) {
|
|
KretaWindowHelper.successFeedBackWindow(KretaWindowHelper.destroyAllWindow, data.Message);
|
|
KretaGridHelper.refreshGridSearchPanel(gridName, searchFormName);
|
|
}
|
|
|
|
function feedbackError() {
|
|
window.location.replace(url.ToIndex);
|
|
}
|
|
|
|
function popUpTanuloCompare(data) {
|
|
var config = KretaWindowHelper.getWindowConfigContainer();
|
|
config.title = "Tanulo";
|
|
config.content = data;
|
|
|
|
var modal = KretaWindowHelper.createWindow("popUpTanuloCompare", config);
|
|
KretaWindowHelper.openWindow(modal, true);
|
|
}
|
|
|
|
function popUpInfoWindow(data) {
|
|
var config = KretaWindowHelper.getWindowConfigContainer();
|
|
config.title = "@(AlkalmazottResource.AlkalmazottAdatai)";
|
|
config.content = data;
|
|
|
|
var modal = KretaWindowHelper.createWindow("tanuloInfoWindow", config);
|
|
KretaWindowHelper.openWindow(modal, true);
|
|
}
|
|
|
|
return kirTanuloImportHelper;
|
|
})();
|
|
</script>
|
|
|
|
<style>
|
|
.selectedKirSzinkronData {
|
|
background-color: rgb(153, 255, 153);
|
|
}
|
|
|
|
.selectableDiv {
|
|
cursor: pointer
|
|
}
|
|
|
|
.selectedKirSzinkronData :hover {
|
|
background-color: rgb(153, 255, 153);
|
|
}
|
|
</style> |