| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- @{
- Layout = "~/Views/Shared/_FunctionLayout.cshtml";
- }
- @model IEnumerable<GreenTree.Nachtragsmanagement.Web.Models.Deviation.DeviationDataModel>
- <script>
- var deleteId;
- function saveDeviation() {
- var form = $("#deviationEditForm");
- $(form).submit(function (e) {
- $.ajax({
- type: "POST",
- url: '@Url.Action("EditDeviation", "Admin")',
- data: form.serialize(),
- success: function (response) {
- setTimeout(function () {
- $(".deviationEditContainer").remove();
- if (response == "success") {
- devGridViewDeviation.PerformCallback();
- } else {
- $("body").append(response);
- }
- }, 200);
- }
- });
- e.preventDefault();
- });
- form.submit();
- }
- function editDeviation(id) {
- if (!id) return;
- $.ajax({
- url: '@Url.Action("EditDeviation", "Admin")',
- 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(); }"
- })
|