Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.14 KB | None | 0 0
  1. <div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  2. <div class="modal-dialog">
  3. <div class="modal-content">
  4.  
  5. <div class="modal-header">
  6. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  7. <h4 class="modal-title" id="myModalLabel">Confirm Delete</h4>
  8. </div>
  9.  
  10. <div class="modal-body">
  11. <p>You are about to delete one track, this procedure is irreversible.</p>
  12. <p>Do you want to proceed?</p>
  13. <p class="return-url"></p>
  14. <p class="debug-url"></p>
  15.  
  16. </div>
  17.  
  18. <div class="modal-footer">
  19. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  20. <a class="btn btn-danger btn-ok">Delete</a>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25.  
  26. <table class="table">
  27. <tr>
  28. <th>@Html.DisplayNameFor(model => model.OrderItemProductNodeProductTitle)</th>
  29. <th>@Html.DisplayNameFor(model => model.OrderItemProductNodeTitle)</th>
  30. <th>@Html.DisplayNameFor(model => model.OrderItemProductNodeDescription)</th>
  31. <th>@Html.DisplayNameFor(model => model.OrderItemProductNodeNumber)</th>
  32. <th>@Html.DisplayNameFor(model => model.ToolOrderCode)</th>
  33. <th>@Html.DisplayNameFor(model => model.AmountRequired)</th>
  34. <th></th>
  35. </tr>
  36.  
  37. @foreach (var item in Model)
  38. {
  39. <tr>
  40. <td>@Html.DisplayFor(modelItem => item.OrderItemProductNodeProductTitle)</td>
  41. <td>@Html.DisplayFor(modelItem => item.OrderItemProductNodeTitle)</td>
  42. <td>@Html.DisplayFor(modelItem => item.OrderItemProductNodeDescription)</td>
  43. <td>@Html.DisplayFor(modelItem => item.OrderItemProductNodeNumber)</td>
  44. <td>@Html.DisplayFor(modelItem => item.ToolOrderCode)</td>
  45. <td>@Html.DisplayFor(modelItem => item.AmountRequired)</td>
  46. <td>
  47. <a href="@Url.Action("EditOrderItem", new { orderId = item.Id })" class="btn btn-warning"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
  48. <a href="#" data-href="@Url.Action("DeleteOrderItem", new { itemId = item.Id })" class="btn btn-danger" data-toggle="modal" data-target="#confirm-delete"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a>
  49. </td>
  50. </tr>
  51. }
  52. </table>
  53.  
  54. $('#confirm-delete').on('show.bs.modal', function (e) {
  55. var button = $(e.relatedTarget);
  56. var modal = $(this);
  57. var deleteUrl = button.data('href');
  58. var returnUrl = button.data("return-url");
  59. modal.find('.btn-ok').attr('href', deleteUrl);
  60. modal.find('.return-url').html('From URL: <strong>' + returnUrl + '</strong>');
  61. modal.find('.debug-url').html('Delete URL: <strong>' + deleteUrl + '</strong>');
  62. })
  63. $('.btn-ok').click(function (e) {
  64. e.preventDefault();
  65. var url = $(this).attr('href');
  66. $.ajax({
  67. url: url,
  68. type: "POST",
  69. success: function (result) {
  70. $('#tabItems').html(result);
  71. }
  72. });
  73. $('#confirm-delete').modal('hide');
  74. })
  75.  
  76. //пробовал делать скрытие модального окна и в методе "success" результат тот же
  77. $('#confirm-delete').modal('hide');
  78.  
  79. <div class="panel panel-default">
  80. <div class="panel-heading">
  81. <h3 class="panel-title">@ViewBag.Caption</h3>
  82. </div>
  83. <div class="panel-body">
  84. <dl class="dl-horizontal">
  85. <dt>@Html.DisplayNameFor(model => model.OrderId)</dt>
  86. <dd>@Html.DisplayFor(model => model.OrderId)</dd>
  87. <dt>@Html.DisplayNameFor(model => model.OrderUnitFullName)</dt>
  88. <dd>@Html.DisplayFor(model => model.OrderUnitFullName)</dd>
  89. <dt>@Html.DisplayNameFor(model => model.LastChange)</dt>
  90. <dd>@Html.DisplayFor(model => model.LastChange)</dd>
  91. </dl>
  92.  
  93. <ul class="nav nav-tabs">
  94. <li class="active">
  95. @Ajax.ActionLink("Список позиций", "GetOrderItems", "Order", new { orderId = Model.OrderId },
  96. new AjaxOptions { UpdateTargetId = "Result" }, new { @role = "presentation" })
  97. </li>
  98. <li>
  99. @Ajax.ActionLink("История изменений", "GetOrderHistory", "Order", new { orderId = Model.OrderId },
  100. new AjaxOptions { UpdateTargetId = "Result" }, new { @role = "presentation" })
  101. </li>
  102. <li>
  103. @Ajax.ActionLink("Замены инструмента", "GetItemHistory", "Order", new { orderId = Model.OrderId },
  104. new AjaxOptions { UpdateTargetId = "Result" }, new { @role = "presentation" })
  105. </li>
  106. </ul>
  107. <div id="Result">
  108. @Html.Partial("Items", Model.Item)
  109. </div>
  110. </div>
  111. </div>
  112.  
  113. <div id="tabItems">
  114. @using (Ajax.BeginForm("AddOrderItem", "Order", null, new AjaxOptions { UpdateTargetId = "tabItems", HttpMethod = "Post" }, new { id = "AddItem" }))
  115. {
  116. @Html.AntiForgeryToken()
  117. <div class="nav">
  118. <div class="navbar-form navbar-left">
  119. @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  120. @Html.HiddenFor(model => model.OrderId, new { id="OrderId" })
  121.  
  122. <div class="form-group">
  123. @Html.EditorFor(model => model.ProductId, new { htmlAttributes = new { id = "ProductId", @class = "form-control select2",
  124. data_url = @Url.Action("GetProductList", "Order"), data_placeholder = "Select an product" } })
  125. @Html.ValidationMessageFor(model => model.ProductId, "", new { @class = "text-danger" })
  126. </div>
  127.  
  128. <div class="form-group">
  129. @Html.EditorFor(model => model.ProductNodeId, new { htmlAttributes = new { id = "ProductNodeId", @class = "form-control select2",
  130. data_url = @Url.Action("GetProductNodeList", "Order") } })
  131. @Html.ValidationMessageFor(model => model.ProductNodeId, "", new { @class = "text-danger" })
  132. </div>
  133.  
  134. <div class="form-group">
  135. @Html.EditorFor(model => model.ToolId, new { htmlAttributes = new { id="ToolId", @class = "form-control select2",
  136. data_url = @Url.Action("GetToolList", "Order") } })
  137. @Html.ValidationMessageFor(model => model.ToolId, "", new { @class = "text-danger" })
  138. </div>
  139.  
  140. <div class="form-group">
  141. @Html.EditorFor(model => model.AmountRequired, new { htmlAttributes = new { id="AmountRequired", @class = "form-control" } })
  142. @Html.ValidationMessageFor(model => model.AmountRequired, "", new { @class = "text-danger" })
  143. </div>
  144.  
  145. <div class="form-group">
  146. <a href="#" id="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
  147. </div>
  148. </div>
  149. </div>
  150. }
  151. @Html.Partial("_ItemsList", Model.ListItems)
  152. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement