Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model List<Diplom.Models.ViewModel>
- <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
- @using (Ajax.BeginForm("CreditCPU", "Credit", new AjaxOptions() { HttpMethod = "POST", OnComplete = "sendPost" }))
- {
- <form>
- <section style="margin-top:30px">
- <div class="modal-content">
- <div class="modal-header">
- <h1>Введите данные</h1>
- </div>
- @if (Model.FirstOrDefault(x => x.id == 1).uniqId != 0)
- {
- <input class="form-control invisible" name="idCpu" value="@Model.FirstOrDefault(x => x.id == 1).uniqId" />
- }
- <div class="modal-body">
- <table class="table table-condensed table-striped table-bordered">
- <tr>
- <td>Наименование:</td>
- <td><input name="nameCpu" type="text" id="nameCpu" class="form-control" value="@Model.FirstOrDefault(x => x.id==1).Name"></td>
- </tr>
- <tr>
- <td>Разьем:</td>
- <td>
- <select name="socketid" id="socketid" class="form-control">
- @foreach (var item in Model)
- {
- if (item.socket != null)
- {
- <option value="@item.id" id="@item.id">@item.socket</option>
- }
- }
- </select>
- </td>
- </tr>
- <tr>
- <td>Ядер,шт:</td>
- <td><input type="text" name="cores" id="cores" class="form-control" value="@Model.FirstOrDefault(x => x.id==1).core"></td>
- </tr>
- <tr>
- <td>Стоимость</td>
- <td><input type="text" name="price" id="price" class="form-control" value="@Decimal.Round(Model.FirstOrDefault(x => x.id==1).price.GetValueOrDefault(),2)"></td>
- </tr>
- <tr>
- <td>Количество:</td>
- <td><input type="text" name="count" id="count" class="form-control" value="@Model.FirstOrDefault(x => x.id==1).count"></td>
- </tr>
- <tr>
- <td>Производитель:</td>
- <td>
- <select name="idManufacture" id="idManufacture" class="form-control">
- @foreach (var item in Model)
- {
- if (item.brand != null)
- {
- <option value="@item.id">@item.brand</option>
- }
- }
- </select>
- </td>
- </tr>
- </table>
- </div>
- <div class="modal-footer">
- <button class="btn btn-default" data-dismiss="modal">Закрыть</button>
- <button class="btn btn-primary cpuform" type="submit">Сохранить</button>
- </div>
- </div>
- </section>
- </form>
- }<script> $(document).ready(function () {
- $("#socketid").val(@Model.FirstOrDefault(x => x.id == 1).idsocket);
- });
- $(document).ready(function () {
- $("#idManufacture").val(@Model.FirstOrDefault(x => x.id == 1).idbrand);
- });
- <div id="modDialog" class="modal fade">
- <div id="dialogContent" class="modal-dialog"></div></div>
- function sendPost(e) {
- $("#dialogContent").modal('hide');
- $("#modDialog").modal('hide');
- }
- $('.modal').remove();
- $('.modal-backdrop').remove();
- $('body').removeClass("modal-open");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement