| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- @{
- Layout = "~/Views/Shared/_FunctionLayout.cshtml";
- }
- @model IEnumerable<GreenTree.Nachtragsmanagement.Web.Models.Deviation.DeviationDataModel>
- <script>
- var deleteId;
- function editDeviation(id) {
- if (!id) return;
- $.ajax({
- url: '@Url.Action("EditDeviation", "Deviation")',
- data: { Id: id },
- success: function (response) {
- setTimeout(function () {
- $(".deviationEditContainer").remove();
- $("body").append(response);
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- function confirmDelete(id) {
- if (!id) return;
- deleteId = id;
- $.ajax({
- type: "GET",
- url: '@Url.Action("GetDeviation", "Deviation")',
- data: { Id: id },
- success: function (response) {
- if (response == "notFound") return;
- var deviation = JSON.parse(response);
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteDeviation);
- popupControl.SetHeaderText(popupControl.GetHeaderText().replace("{deviation}", deviation.CustomNumber));
- $(".dialogText").text($(".dialogText").text().replace("{deviation}", deviation.CustomNumber));
- popupControl.Show();
- }
- });
- }
- function deleteDeviation() {
- $.ajax({
- type: "POST",
- url: '@Url.Action("DeleteDeviation", "Deviation")',
- data: { Id: deleteId },
- success: function (response) {
- var popupControl = MVCxClientPopupControl.Cast(devPopupControlDeleteDeviation);
- popupControl.Hide();
- setTimeout(function () {
- devGridViewDeviation.PerformCallback();
- }, 200);
- },
- error: function () {
- alert("error occured");
- }
- });
- }
- </script>
- @Html.Partial("~/Views/Deviations/_DeviationGridPartial.cshtml", Model)
- @Html.Partial("~/Views/Shared/_PopupDialogYesNo.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.YesNoDialogModel
- {
- PopupName = "devPopupControlDeleteDeviation",
- Content = "<div class='dialogText' style='padding: 12px'>Sind Sie sicher, dass Sie die Vertragsabweichung \"{deviation}\" löschen möchten?</div>",
- HeaderText = "\"{deviation}\" löschen",
- YesFunction = "function (s, e) { deleteDeviation(); }"
- })
|