TreeConfirm.cshtml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. @*
  2. For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
  3. *@
  4. @using SuperAdmin.Models.View;
  5. @model PartialViewModel;
  6. <link rel="stylesheet" type="text/css" href="~/css/model.css">
  7. <script>
  8. $('#myContent').modal('hide');
  9. </script>
  10. <div class="modal-content">
  11. <div class="modal-header">
  12. <h4 class="modal-title" id="modalLabelService">Response</h4>
  13. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  14. <span aria-hidden="true">×</span>
  15. </button>
  16. </div>
  17. <div class="modal-body">
  18. <div>
  19. <h3>
  20. @Model.message
  21. </h3>
  22. </div>
  23. </div>
  24. <div class="modal-footer">
  25. <button id="closeBtn" type="button" class="btn grey btn-outline-secondary" data-dismiss="modal">Close</button>
  26. <button type="button" id="btnAgree" class="btn btn-outline-primary">Agree</button>
  27. </div>
  28. </div>
  29. <script>
  30. $("#btnAgree").on("click", function () {
  31. $.ajax({
  32. type: "POST",
  33. url: urlConfig("@Model.url"),
  34. headers: { 'RequestVerificationToken': $('input[name=__RequestVerificationToken]').val() },
  35. data: {
  36. "__RequestVerificationToken": $('input[name=__RequestVerificationToken]').val(),
  37. "id": "@Model.id",
  38. },
  39. success: function (data) {
  40. $.ajax({
  41. type: "POST",
  42. url: urlConfig("/Partial/TreeResponse"),
  43. data: {
  44. "ids": data.ids,
  45. "message": data.message
  46. },
  47. success: function (data) {
  48. $('#informModel').html(data);
  49. $('#myInform').modal({ "backdrop": "static", keyboard: true });
  50. $('#myInform').modal('show');
  51. },
  52. failure: function (data) {
  53. alert(data);
  54. },
  55. error: function (data) {
  56. alert(data);
  57. }
  58. });
  59. },
  60. failure: function (data) {
  61. alert(data);
  62. },
  63. error: function (data) {
  64. alert(data);
  65. }
  66. });
  67. })
  68. </script>