| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- @{
- Layout = "~/Views/Shared/_FunctionLayout.cshtml";
- }
- @model IEnumerable<GreenTree.Nachtragsmanagement.Web.Models.Misc.MailNotificationDataModel>
- <script>
- var deleteId;
- var processId;
- var gridScrollHeight;
- var gridScrollOffset = 280;
- var resizeFinished;
- $(document).ready(function () {
- gridScrollHeight = $(window).height() - gridScrollOffset;
- setTimeout(function () {
- devGridViewMailNotifications.PerformCallback();
- }, 500);
- });
- $(window).resize(function () {
- clearTimeout(window.resizedFinished);
- window.resizedFinished = setTimeout(function () {
- gridScrollHeight = $(window).height() - gridScrollOffset;
- devGridViewMailNotifications.PerformCallback();
- }, 250);
- });
- function onToolbarItemClick(s, e) {
- if (!s || !e) return;
- if (IsExportToolbarCommand(e.item.name)) {
- $("#Format").val(e.item.name);
- $("#mailNotificationExportForm").submit();
- } else if (e.item.name == "ToggleColumnChooser") {
- if (devGridViewMailNotifications.IsCustomizationWindowVisible())
- devGridViewMailNotifications.HideCustomizationWindow();
- else
- devGridViewMailNotifications.ShowCustomizationWindow();
- }
- }
- function IsExportToolbarCommand(command) {
- return command == "Pdf" || command == "Xlsx" || command == "Xls";
- }
- function editMailNotification(id) {
- if (!id) return;
- $.ajax({
- url: '@Url.Action("EditMailNotification", "Misc")',
- data: { Id: id },
- success: function (response) {
- setTimeout(function () {
- $(".mailNotificationEditContainer").remove();
- $("body").append(response);
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- function confirmDelete(id) {
- if (!id) return;
- deleteId = id;
- $.ajax({
- type: "GET",
- url: '@Url.Action("GetMailNotification", "Misc")',
- data: { Id: id },
- success: function (response) {
- if (response == "notFound") return;
- var mailNotification = JSON.parse(response);
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteMailNotification);
- popupControl.SetHeaderText(popupControl.GetHeaderText().replace("{mailNotification}", mailNotification.NotificationPluginSystemNameDescription));
- $(".dialogTextMailNotification").text($(".dialogTextMailNotification").text().replace("{mailNotification}", mailNotification.NotificationPluginSystemNameDescription));
- popupControl.Show();
- }
- });
- }
- function deleteMailNotification() {
- $.ajax({
- type: "POST",
- url: '@Url.Action("DeleteMailNotification", "Misc")',
- data: { Id: deleteId },
- success: function (response) {
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteMailNotification);
- popupControl.Hide();
- setTimeout(function () {
- devGridViewMailNotifications.PerformCallback();
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- function confirmProcess(id) {
- if (!id) return;
- processId = id;
- $.ajax({
- type: "GET",
- url: '@Url.Action("GetMailNotification", "Misc")',
- data: { Id: id },
- success: function (response) {
- if (response == "notFound") return;
- var mailNotification = JSON.parse(response);
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlProcessMailNotification);
- popupControl.SetHeaderText(popupControl.GetHeaderText().replace("{mailNotification}", mailNotification.NotificationPluginSystemNameDescription));
- $(".dialogTextMailNotificationProcess").text($(".dialogTextMailNotificationProcess").text().replace("{mailNotification}", mailNotification.NotificationPluginSystemNameDescription));
- popupControl.Show();
- }
- });
- }
- function processMailNotification() {
- $.ajax({
- type: "POST",
- url: '@Url.Action("ProcessMailNotification", "Misc")',
- data: { Id: processId },
- success: function (response) {
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlProcessMailNotification);
- popupControl.Hide();
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- </script>
- @using (Html.BeginForm("ExportPartialMailNotifications", "Misc", FormMethod.Post, new { id = "mailNotificationExportForm" }))
- {
- @Html.Hidden("Format")
- }
- @Html.Partial("~/Views/Misc/_MailNotificationGridPartial.cshtml", Model)
- @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
- {
- PopupName = "devPopupControlDeleteMailNotification",
- Content = "<div class='dialogTextMailNotification' style='padding: 12px'>Sind Sie sicher, dass Sie die Benachrichtigung " +
- "\"{mailNotification}\" löschen möchten?</div>",
- HeaderText = "\"{mailNotification}\" löschen",
- YesFunction = "function (s, e) { deleteMailNotification(); }",
- YesButtonName = "devButtonDeleteMailNotificationYes",
- NoButtonName = "devButtonDeleteMailNotificationNo"
- })
- @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
- {
- PopupName = "devPopupControlProcessMailNotification",
- Content = "<div class='dialogTextMailNotificationProcess' style='padding: 12px'>Sind Sie sicher, dass Sie die Benachrichtigung " +
- "\"{mailNotification}\" sofort durchführen möchten?</div>",
- HeaderText = "\"{mailNotification}\" löschen",
- YesFunction = "function (s, e) { processMailNotification(); }",
- YesButtonName = "devButtonProcessMailNotificationYes",
- NoButtonName = "devButtonProcessMailNotificationNo"
- })
|