@using Kreta.Web.Areas.Tanulo.Models
@using Kreta.Web.Helpers.Grid
@using Kreta.BusinessLogic.Classes
@using Kreta.Resources
@model OsztalyTanuloiSearchModel
@{
const string HetesekController = Constants.Controllers.Hetesek;
const string HetesekApiController = Constants.ApiControllers.HetesekApi;
const string gridName = "HetesekGrid";
const string searchFormName = "HetesekSearchForm";
const string warningMessage = "WarningMessage";
}
@section AddSearchPanel {
@using (Html.SearchPanelSideBar(searchFormName, gridName))
{
@Html.KretaComboBoxFor(x => x.OsztalyCsoport, Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new { controller = Constants.ApiControllers.ComboBoxHelperApi, action = "GetTanitottOsztalyokList", isVegyes = true })).AutoBind(true).RenderSearchPanelSideBar()
}
}
@Html.KretaButton("ValidateHetes", HetesResource.HetesekMentese, clickEventName: "function() {HetesekHelper.validateHetes()}", htmlAttributes: new Dictionary { { "style", "background-color:#54a5d1" } })
@Html.KretaButton("DeleteFutureHetesInOsztalyCsoport", HetesResource.JovobeliHetesekTorleseAzOsztalyban, clickEventName: "function() {HetesekHelper.deleteFutureHetesInOsztalyCsoport()}", htmlAttributes: new Dictionary { { "style", "background-color:#a94442" } })
@string.Format(HetesResource.KerjukAzAdatokSzerkesztesehezKattintsonAHetesTanulokOszlopMegfeeloMezojebeEgyHetreMaximumXHetesJelolhetoKi, Kreta.Web.Constants.General.HetesekMaximalisSzama.ToString())
@HetesResource.NemMentettModositasokVannakAFeluleten
@(
Html.KretaGrid(
gridName,
getUrl: new GridApiUrl(HetesekApiController, "GetHetesekGrid", new Dictionary()),
dataParameterFunction: searchFormName,
allowPaging: false,
pageSizes: null,
allowSorting: false,
showSorszam: false,
batchEdit: true,
allowScrolling: true,
dataBoundAdditionalFunction: "HetesekHelper.changeGridView();"
)
.Columns(columns =>
{
columns.Bound(c => c.HetSorszam).Width("10%");
columns.Bound(c => c.HetKezdoNap).Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]).Width("10%");
columns.Bound(c => c.HetUtolsoNap).Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]).Width("10%");
columns.Bound(c => c.Hetirend).Width("10%");
columns.Bound(c => c.Tanulok).ClientTemplate("#=HetesekHelper.TanuloTemplate(Tanulok,HetSorszam)#").EditorTemplateName("HetesTanuloTemplate")
.EditorViewData(new { gridId = gridName, dataSourceFunction = "HetesekHelper.TanulokForMultiSelect", hetSorszamPropName = "HetSorszam", tanulokPropName = "Tanulok" }).HtmlAttributes(new { data_resetable = "" }).Width("34%");
columns.Command(command => command.Custom("Delete").Text(" ").Click("function(e) {HetesekHelper.hetesDelete(e)}")).Width("5%");
columns.Command(command => command.Custom("AutoSet").Text(HetesResource.AutomatikusBeallitasEttolAHettol).Click("function(e) {HetesekHelper.hetesSet(e)}")).Width("21%");
})
.Editable(editable => editable.Mode(GridEditMode.InCell).DisplayDeleteConfirmation(false))
.Events(e => e.Edit("function(e) {HetesekHelper.hetesEdit(e)}").Save("function(e) {HetesekHelper.hetesSave(e)}"))
)