115 lines
No EOL
4.4 KiB
Text
115 lines
No EOL
4.4 KiB
Text
@using Kreta.Web.Areas.Adminisztracio.Models
|
|
@using Kreta.Web.Helpers.Grid
|
|
@using Kreta.BusinessLogic.Classes
|
|
|
|
@model TanulokFeltolteseModel
|
|
|
|
@{
|
|
var formName = "TanulokFeltolteseForm";
|
|
var gridName = "TanuloImportGrid";
|
|
}
|
|
|
|
@using (Html.KretaForm(formName))
|
|
{
|
|
@Html.KretaValidationSummary()
|
|
|
|
if (Model.IsSzakkepzoIntezmeny)
|
|
{
|
|
@Html.HiddenFor(x => x.IsJuttatasUpdate)
|
|
}
|
|
<div class="container-fluid">
|
|
|
|
@if (Model.Errors.Count > 0)
|
|
{
|
|
<div class="row">
|
|
@Html.Label("Hibák", new Dictionary<string, object> { { "class", "windowInputLabel labelError" } })
|
|
<br />
|
|
@Html.KretaTextArea("tanulohibak", Model.Errors, (Model.Errors.Count < 15) ? Model.Errors.Count : 15, new Dictionary<string, object>() { { "style", "color: red;" }, { "readonly", "readonly" } })
|
|
</div>
|
|
}
|
|
</div>
|
|
|
|
@(
|
|
Html.KretaGrid<KIRTanuloImportGridModel>(
|
|
gridName,
|
|
new GridApiUrl("KIRTanuloImport", "GetPreLoadedStudents", Constants.RouteKey.Default),
|
|
dataBoundAdditionalFunction: "KIRTanuloFeltoltesHelper.dataBound();",
|
|
allowFilterable: false,
|
|
allowSorting: false,
|
|
allowPaging: false,
|
|
showSorszam: false
|
|
)
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(c => c.ID).Width("10%");
|
|
columns.Bound(c => c.OktatasiAzonosito).Width("10%").Sortable(true);
|
|
columns.Bound(c => c.TanuloNeve);
|
|
columns.Bound(c => c.AnyjaNeve);
|
|
columns.Bound(c => c.SzuletesiHely).Sortable(true);
|
|
columns.Bound(c => c.SzuletesiIdo).Width("10%").Format(SDAFormat.Format[SDAFormat.FormatType.ShortDateAndTime]);
|
|
columns.Bound(c => c.Tankotelezett).Title(TanuloResource.Tankotelezett).Width("10%")
|
|
.ClientTemplate("<div class='gridCheckBox' align =\"center\" data-inputParentGrid='TanuloImportGrid'><input type='checkbox' id='TanuloImportGrid_Tankotelezett_#=ID#' data-rowInputName='Tankotelezett' class='k-checkbox' disabled='disabled' value='#= Tankotelezett#'# if (Tankotelezett) { #checked='checked'# } #/><label class='k-checkbox-label' for='TanuloImportGrid_Tankotelezett_#=ID#'></label></div>");
|
|
})
|
|
.AutoBind(true)
|
|
)
|
|
}
|
|
|
|
<script>
|
|
var KIRTanuloFeltoltesHelper = (function () {
|
|
var helper = function () { };
|
|
|
|
var gridName = "@gridName";
|
|
var url = {
|
|
SaveTanulok: "@Url.Action("SaveTanulok", "KIRTanuloImport")"
|
|
};
|
|
|
|
helper.RefreshGrid = function () {
|
|
KretaGridHelper.refreshGrid(gridName);
|
|
};
|
|
|
|
helper.dataBound = function () {
|
|
dataBound();
|
|
}
|
|
|
|
helper.Save = function () {
|
|
if ($('#IsJuttatasUpdate').length > 0) {
|
|
KretaWindowHelper.confirmWindow("@(CommonResource.Figyelmeztetes)", "@(AdminisztracioResource.JuttatasUpdateFigyelmeztetes)", saveTanulok, null, null, "@(CommonResource.Folytatas)", "@(CommonResource.Megse)");
|
|
}
|
|
else {
|
|
saveTanulok();
|
|
}
|
|
};
|
|
|
|
function saveTanulok() {
|
|
var isJuttatasUpdate = $('#IsJuttatasUpdate');
|
|
AjaxHelper.DoPost(url.SaveTanulok, (isJuttatasUpdate.length > 0) ? { isJuttatasUpdate: isJuttatasUpdate.prop('checked') } : null, successSave, failedSave);
|
|
}
|
|
|
|
function successSave(data) {
|
|
KretaWindowHelper.feedbackWindowWithLink(
|
|
"@CommonResource.Siker",
|
|
"@AdminisztracioResource.ATanulokImportalasaSikeresenMegtortent",
|
|
"@AdminisztracioResource.TovabbATanulokhoz",
|
|
data.tovabbUrl,
|
|
false,
|
|
function () {
|
|
KretaWindowHelper.destroyAllWindow();
|
|
});
|
|
};
|
|
|
|
function failedSave() {
|
|
KretaWindowHelper.feedbackWindow("@(CommonResource.Hiba)", "@(ErrorResource.HibaTortentATanulokMenteseSoran)", true);
|
|
};
|
|
|
|
function dataBound() {
|
|
if ($('#' + gridName).data("kendoGrid").dataSource.view().length == 0) {
|
|
$('#BtnOk').hide();
|
|
}
|
|
else {
|
|
$('#BtnOk').show();
|
|
}
|
|
};
|
|
|
|
return helper;
|
|
})();
|
|
</script> |