Advertisement
Guest User

widok

a guest
Jan 30th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. @using tin_pja_bookapp.Models
  2. @model tin_pja_bookapp.Models.BookViewModel
  3.  
  4. @{
  5. ViewBag.Title = "Edit";
  6. }
  7.  
  8. <h1>Edytowanie</h1>
  9. <div class="textfield">
  10.  
  11. @using (Html.BeginForm(null, null, FormMethod.Post, new { name = "valid", onsubmit = "return validateCRUD()" }))
  12. {
  13. @Html.AntiForgeryToken()
  14.  
  15.  
  16. @Html.ValidationSummary(true, "", new { })
  17. @Html.HiddenFor(model => model.IdBook)
  18.  
  19. <b>Tytul</b>
  20.  
  21. @Html.EditorFor(model => model.Name, new { htmlAttributes = new { id="str" } })
  22. @Html.ValidationMessageFor(model => model.Name, "", new { })
  23. <br />
  24.  
  25. <b>Opis</b><br />
  26.  
  27. @Html.EditorFor(model => model.Description, new { htmlAttributes = new { } })
  28. @Html.ValidationMessageFor(model => model.Description, "", new { })
  29. <br />
  30. <b>Autor</b>
  31.  
  32. @Html.DropDownList("CurrentIdAuthor", null, htmlAttributes: new { })
  33. @Html.ValidationMessageFor(model => model.CurrentIdAuthor, "", new { })
  34. <br />
  35.  
  36. <b>Gatunki</b>
  37. foreach (var t in (IEnumerable<TypeViewModel>)ViewBag.Types)
  38. {
  39. <label for="@t.Name">@t.Name</label>
  40. if (Model.Types.Any(tt => tt.Name == t.Name))
  41. {
  42. <input id="@t.Name" name="@t.Name" value="@t.IdType" type="checkbox" checked />
  43. }
  44. else
  45. {
  46. <input id="@t.Name" name="@t.Name" value="@t.IdType" type="checkbox" />
  47. }
  48. }
  49.  
  50. <br />
  51. <input type="submit" value="Save" />
  52. }
  53.  
  54. <div>
  55. @Html.ActionLink("Back to List", "Index")
  56. </div>
  57.  
  58. </div>
  59. @section Scripts {
  60. @Scripts.Render("~/bundles/jqueryval")
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement