@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 { } @{ List TTFelosztasRowFunctionList = new List(); List TTFelosztasConditionalRowFunctionList = new List(); 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 TTFelosztasFunctionCommandList = new List(); 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 { 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 ( name: "TantargyFelosztasGrid", getUrl: new GridApiUrl(Model.ApiControllerName, "GetTantargyFelosztasok", new Dictionary() { { "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); } }
@(grid)
@if (!Model.IsFromSzervezet) {
@TantargyResource.Osszesen: @(((double)ViewBag.Oraszam).ToString("0.##")) (@(((double)ViewBag.TtfKorrekcioOraszam).ToString("0.##")))
}