Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using tin_pja_bookapp.Models
- @model tin_pja_bookapp.Models.BookViewModel
- @{
- ViewBag.Title = "Edit";
- }
- <h1>Edytowanie</h1>
- <div class="textfield">
- @using (Html.BeginForm(null, null, FormMethod.Post, new { name = "valid", onsubmit = "return validateCRUD()" }))
- {
- @Html.AntiForgeryToken()
- @Html.ValidationSummary(true, "", new { })
- @Html.HiddenFor(model => model.IdBook)
- <b>Tytul</b>
- @Html.EditorFor(model => model.Name, new { htmlAttributes = new { id="str" } })
- @Html.ValidationMessageFor(model => model.Name, "", new { })
- <br />
- <b>Opis</b><br />
- @Html.EditorFor(model => model.Description, new { htmlAttributes = new { } })
- @Html.ValidationMessageFor(model => model.Description, "", new { })
- <br />
- <b>Autor</b>
- @Html.DropDownList("CurrentIdAuthor", null, htmlAttributes: new { })
- @Html.ValidationMessageFor(model => model.CurrentIdAuthor, "", new { })
- <br />
- <b>Gatunki</b>
- foreach (var t in (IEnumerable<TypeViewModel>)ViewBag.Types)
- {
- <label for="@t.Name">@t.Name</label>
- if (Model.Types.Any(tt => tt.Name == t.Name))
- {
- <input id="@t.Name" name="@t.Name" value="@t.IdType" type="checkbox" checked />
- }
- else
- {
- <input id="@t.Name" name="@t.Name" value="@t.IdType" type="checkbox" />
- }
- }
- <br />
- <input type="submit" value="Save" />
- }
- <div>
- @Html.ActionLink("Back to List", "Index")
- </div>
- </div>
- @section Scripts {
- @Scripts.Render("~/bundles/jqueryval")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement