| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- @{
- Layout = "~/Views/Shared/_FunctionLayout.cshtml";
- }
- @model IEnumerable<GreenTree.Nachtragsmanagement.Web.Models.Appendix.CategoryDataModel>
- <script>
- var deleteId;
- function editCategory(id) {
- if (!id) return;
- $.ajax({
- url: '@Url.Action("EditCategory", "Appendix")',
- data: { Id: id },
- success: function (response) {
- setTimeout(function () {
- $(".categoryEditContainer").remove();
- $("body").append(response);
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- function confirmDelete(id) {
- if (!id) return;
- deleteId = id;
- $.ajax({
- type: "GET",
- url: '@Url.Action("GetCategory", "Appendix")',
- data: { Id: id },
- success: function (response) {
- if (response == "notFound") return;
- var category = JSON.parse(response);
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteCategory);
- popupControl.SetHeaderText(popupControl.GetHeaderText().replace("{category}", category.Description));
- $(".dialogText").text($(".dialogText").text().replace("{category}", category.Description));
- popupControl.Show();
- }
- });
- }
- function deleteCategory() {
- $.ajax({
- type: "POST",
- url: '@Url.Action("DeleteCategory", "Appendix")',
- data: { Id: deleteId },
- success: function (response) {
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteCategory);
- popupControl.Hide();
- setTimeout(function () {
- devGridViewCategory.PerformCallback();
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- </script>
- @Html.Partial("~/Views/Appendix/_CategoryListPartial.cshtml", Model)
- @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
- {
- PopupName = "devPopupControlDeleteCategory",
- Content = "<div class='dialogText' style='padding: 12px'>Sind Sie sicher, dass Sie die Kategorie \"{category}\" löschen möchten?</div>",
- HeaderText = "\"{category}\" löschen",
- YesFunction = "function (s, e) { deleteCategory(); }"
- })
|