Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title" id="myModalLabel">Confirm Delete</h4>
- </div>
- <div class="modal-body">
- <p>You are about to delete one track, this procedure is irreversible.</p>
- <p>Do you want to proceed?</p>
- <p class="return-url"></p>
- <p class="debug-url"></p>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <a class="btn btn-danger btn-ok">Delete</a>
- </div>
- </div>
- </div>
- </div>
- <table class="table">
- <tr>
- <th>@Html.DisplayNameFor(model => model.OrderItemProductNodeProductTitle)</th>
- <th>@Html.DisplayNameFor(model => model.OrderItemProductNodeTitle)</th>
- <th>@Html.DisplayNameFor(model => model.OrderItemProductNodeDescription)</th>
- <th>@Html.DisplayNameFor(model => model.OrderItemProductNodeNumber)</th>
- <th>@Html.DisplayNameFor(model => model.ToolOrderCode)</th>
- <th>@Html.DisplayNameFor(model => model.AmountRequired)</th>
- <th></th>
- </tr>
- @foreach (var item in Model)
- {
- <tr>
- <td>@Html.DisplayFor(modelItem => item.OrderItemProductNodeProductTitle)</td>
- <td>@Html.DisplayFor(modelItem => item.OrderItemProductNodeTitle)</td>
- <td>@Html.DisplayFor(modelItem => item.OrderItemProductNodeDescription)</td>
- <td>@Html.DisplayFor(modelItem => item.OrderItemProductNodeNumber)</td>
- <td>@Html.DisplayFor(modelItem => item.ToolOrderCode)</td>
- <td>@Html.DisplayFor(modelItem => item.AmountRequired)</td>
- <td>
- <a href="@Url.Action("EditOrderItem", new { orderId = item.Id })" class="btn btn-warning"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
- <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>
- </td>
- </tr>
- }
- </table>
- $('#confirm-delete').on('show.bs.modal', function (e) {
- var button = $(e.relatedTarget);
- var modal = $(this);
- var deleteUrl = button.data('href');
- var returnUrl = button.data("return-url");
- modal.find('.btn-ok').attr('href', deleteUrl);
- modal.find('.return-url').html('From URL: <strong>' + returnUrl + '</strong>');
- modal.find('.debug-url').html('Delete URL: <strong>' + deleteUrl + '</strong>');
- })
- $('.btn-ok').click(function (e) {
- e.preventDefault();
- var url = $(this).attr('href');
- $.ajax({
- url: url,
- type: "POST",
- success: function (result) {
- $('#tabItems').html(result);
- }
- });
- $('#confirm-delete').modal('hide');
- })
- //пробовал делать скрытие модального окна и в методе "success" результат тот же
- $('#confirm-delete').modal('hide');
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">@ViewBag.Caption</h3>
- </div>
- <div class="panel-body">
- <dl class="dl-horizontal">
- <dt>@Html.DisplayNameFor(model => model.OrderId)</dt>
- <dd>@Html.DisplayFor(model => model.OrderId)</dd>
- <dt>@Html.DisplayNameFor(model => model.OrderUnitFullName)</dt>
- <dd>@Html.DisplayFor(model => model.OrderUnitFullName)</dd>
- <dt>@Html.DisplayNameFor(model => model.LastChange)</dt>
- <dd>@Html.DisplayFor(model => model.LastChange)</dd>
- </dl>
- <ul class="nav nav-tabs">
- <li class="active">
- @Ajax.ActionLink("Список позиций", "GetOrderItems", "Order", new { orderId = Model.OrderId },
- new AjaxOptions { UpdateTargetId = "Result" }, new { @role = "presentation" })
- </li>
- <li>
- @Ajax.ActionLink("История изменений", "GetOrderHistory", "Order", new { orderId = Model.OrderId },
- new AjaxOptions { UpdateTargetId = "Result" }, new { @role = "presentation" })
- </li>
- <li>
- @Ajax.ActionLink("Замены инструмента", "GetItemHistory", "Order", new { orderId = Model.OrderId },
- new AjaxOptions { UpdateTargetId = "Result" }, new { @role = "presentation" })
- </li>
- </ul>
- <div id="Result">
- @Html.Partial("Items", Model.Item)
- </div>
- </div>
- </div>
- <div id="tabItems">
- @using (Ajax.BeginForm("AddOrderItem", "Order", null, new AjaxOptions { UpdateTargetId = "tabItems", HttpMethod = "Post" }, new { id = "AddItem" }))
- {
- @Html.AntiForgeryToken()
- <div class="nav">
- <div class="navbar-form navbar-left">
- @Html.ValidationSummary(true, "", new { @class = "text-danger" })
- @Html.HiddenFor(model => model.OrderId, new { id="OrderId" })
- <div class="form-group">
- @Html.EditorFor(model => model.ProductId, new { htmlAttributes = new { id = "ProductId", @class = "form-control select2",
- data_url = @Url.Action("GetProductList", "Order"), data_placeholder = "Select an product" } })
- @Html.ValidationMessageFor(model => model.ProductId, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- @Html.EditorFor(model => model.ProductNodeId, new { htmlAttributes = new { id = "ProductNodeId", @class = "form-control select2",
- data_url = @Url.Action("GetProductNodeList", "Order") } })
- @Html.ValidationMessageFor(model => model.ProductNodeId, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- @Html.EditorFor(model => model.ToolId, new { htmlAttributes = new { id="ToolId", @class = "form-control select2",
- data_url = @Url.Action("GetToolList", "Order") } })
- @Html.ValidationMessageFor(model => model.ToolId, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- @Html.EditorFor(model => model.AmountRequired, new { htmlAttributes = new { id="AmountRequired", @class = "form-control" } })
- @Html.ValidationMessageFor(model => model.AmountRequired, "", new { @class = "text-danger" })
- </div>
- <div class="form-group">
- <a href="#" id="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
- </div>
- </div>
- </div>
- }
- @Html.Partial("_ItemsList", Model.ListItems)
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement