173 lines
No EOL
6.3 KiB
Text
173 lines
No EOL
6.3 KiB
Text
@using Kreta.Web.Areas.Feljegyzes.Models
|
|
@using Kreta.Web.Helpers.Grid
|
|
@using Kreta.BusinessLogic.Classes
|
|
@using Kreta.Resources
|
|
@using Kreta.Web.Areas.Feljegyzes.Controllers
|
|
|
|
@section AddCss {
|
|
@Styles.Render(Constants.General.FeljegyzesekCSS)
|
|
}
|
|
|
|
@{
|
|
string gridName = FaliujsagBejegyzesekController.GridName;
|
|
|
|
string newModifyPopupName = FaliujsagBejegyzesekController.NewModifyPopupName;
|
|
string newModifyFormName = FaliujsagBejegyzesekController.NewModifyFormName;
|
|
}
|
|
@{
|
|
|
|
var functionList = new List<FunctionCommand>
|
|
{
|
|
new FunctionCommand { Name = CommonResource.Uj, ClientAction = "FaliujsagBejegyzesekHelper.openNewWindow" },
|
|
};
|
|
|
|
var rowFunctionList = new List<RowFunction>
|
|
{
|
|
new RowFunction { Name = CommonResource.Modositas, ClientAction = "FaliujsagBejegyzesekHelper.openModifyWindow", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Modositas },
|
|
new RowFunction { Name = CommonResource.Torles, ClientAction = "FaliujsagBejegyzesekHelper.deleteConfirmWindow", IconEnum = Kreta.Enums.ManualEnums.GridRowFunctionIconEnum.Torles }
|
|
};
|
|
|
|
var grid = Html.KretaGrid<FaliujsagBejegyzesekGridModel>
|
|
(
|
|
gridName,
|
|
new GridApiUrl("FaliujsagBejegyzesekApi", "GetFaliujsagBejegyzesekGrid"),
|
|
allowFilterable: false,
|
|
allowPaging: false,
|
|
pageSizes: null,
|
|
allowScrolling: true,
|
|
sort: sort => sort.Add(s => s.Kezdete).Descending()
|
|
)
|
|
.Sortable(sortable => sortable
|
|
.AllowUnsort(true)
|
|
.SortMode(GridSortMode.MultipleColumn))
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(c => c.ID).Hidden();
|
|
columns.Bound(c => c.Kezdete).Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]).Width("8%");
|
|
columns.Bound(c => c.Vege).Format(SDAFormat.Format[SDAFormat.FormatType.ShortDate]).Width("8%");
|
|
columns.Bound(c => c.FeljegyzoNeve).Width("20%");
|
|
columns.Bound(c => c.Targy).Width("20%").SetDisplayPropertyWithToolip("Targy");
|
|
columns.Bound(c => c.Tartalom).Width("24%").SetDisplayPropertyWithToolip("Tartalom");
|
|
columns.Bound(c => c.Cimzettek).SetDisplayPropertyWithToolip("Cimzettek");
|
|
|
|
})
|
|
.RowFunction(Html, rowFunctionList)
|
|
.FunctionCommand(Html, functionList);
|
|
}
|
|
|
|
<div>
|
|
@(grid)
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var FaliujsagBejegyzesekHelper = (function () {
|
|
var faliujsagBejegyzesekHelper = function () { }
|
|
|
|
var gridName = "@gridName";
|
|
var newModifyPopupName = "@newModifyPopupName";
|
|
var newModifyFormName = "@newModifyFormName";
|
|
|
|
var url = {
|
|
OpenNewModifyPopup: "@Url.Action("OpenNewModifyPopup", "FaliujsagBejegyzesek", new {area = "Feljegyzes" })",
|
|
Save: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new {controller = "FaliujsagBejegyzesekApi", action = "SaveFaliujsagBejegyzes" })",
|
|
Delete: "@Url.HttpRouteUrl(Constants.RouteKey.ActionApi, new {controller = "FaliujsagBejegyzesekApi", action = "DeleteFaliujsagBejegyzes" })"
|
|
};
|
|
|
|
faliujsagBejegyzesekHelper.openNewWindow = function () {
|
|
AjaxHelper.DoPost(url.OpenNewModifyPopup, null, popNewModifyWindow);
|
|
}
|
|
|
|
faliujsagBejegyzesekHelper.openModifyWindow = function (data) {
|
|
var postData = {
|
|
id: data.ID
|
|
};
|
|
AjaxHelper.DoPost(url.OpenNewModifyPopup, postData, popNewModifyWindow);
|
|
}
|
|
|
|
function popNewModifyWindow(data) {
|
|
var config = KretaWindowHelper.getWindowConfigContainer();
|
|
config.title = "@FeljegyzesekResource.FaliujsagBejegyzes";
|
|
config.content = data;
|
|
config.width = "1060px";
|
|
config.height = "800px";
|
|
|
|
var modal = KretaWindowHelper.createWindow(newModifyPopupName, config);
|
|
KretaWindowHelper.openWindow(modal, true);
|
|
}
|
|
|
|
faliujsagBejegyzesekHelper.newModifyPopupDelete = function () {
|
|
var data = $("#" + newModifyFormName).toObject();
|
|
deleteConfirm(data.Id);
|
|
}
|
|
|
|
faliujsagBejegyzesekHelper.deleteConfirmWindow = function (data) {
|
|
deleteConfirm(data.ID);
|
|
}
|
|
|
|
function deleteConfirm(id) {
|
|
var data = {
|
|
id: id
|
|
}
|
|
KretaWindowHelper.confirmWindow(
|
|
"@(CommonResource.Kerdes)",
|
|
"@(CommonResource.BiztosanTorli)",
|
|
deleteFeljegyzes,
|
|
data
|
|
);
|
|
}
|
|
|
|
function deleteFeljegyzes(data) {
|
|
AjaxHelper.DoValidationPost(
|
|
url.Delete,
|
|
newModifyFormName,
|
|
data,
|
|
refreshGrid,
|
|
feedbackError
|
|
);
|
|
}
|
|
|
|
faliujsagBejegyzesekHelper.newModifyPopupSave = function (popupGridName) {
|
|
var form = $('#' + newModifyFormName);
|
|
if (form.valid()) {
|
|
var data = form.toObject();
|
|
var selectedRows = KretaGridHelper.getSelectedRowsByGridName(popupGridName);
|
|
if (selectedRows.length === 0) {
|
|
KretaWindowHelper.warningWindow(
|
|
"@(CommonResource.Figyelmeztetes)",
|
|
"@(FeljegyzesekResource.ValasszonKiLegalabbEgyOsztalytCsoportot)"
|
|
);
|
|
} else {
|
|
var selectedIdList = [];
|
|
$.each(selectedRows,
|
|
function (index, value) {
|
|
selectedIdList.push(value.ID);
|
|
});
|
|
data.OsztalyCsoportIdList = selectedIdList;
|
|
AjaxHelper.DoValidationPost(
|
|
url.Save,
|
|
newModifyFormName,
|
|
data,
|
|
refreshGrid);
|
|
}
|
|
}
|
|
}
|
|
|
|
faliujsagBejegyzesekHelper.newModifyPopupCancel = function () {
|
|
KretaWindowHelper.destroyWindow(newModifyPopupName);
|
|
}
|
|
|
|
function feedbackError() {
|
|
var message = "@(CommonResource.Hiba)";
|
|
KretaWindowHelper.feedbackWindow("@(CommonResource.Hiba)", message, true, KretaWindowHelper.destroyAllWindow);
|
|
}
|
|
|
|
function refreshGrid() {
|
|
KretaWindowHelper.destroyAllWindow();
|
|
KretaGridHelper.refreshGrid(gridName);
|
|
}
|
|
|
|
return faliujsagBejegyzesekHelper;
|
|
})();
|
|
|
|
</script> |