37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
@model Vidly.ViewModels.MovieFormViewModel
|
|
@{
|
|
ViewBag.Title = "New";
|
|
Layout = "~/Views/Shared/_Layout.cshtml";
|
|
}
|
|
|
|
|
|
@if (Model.Movie.Id == null || Model.Movie.Id == 0)
|
|
{
|
|
<h2>New Movie</h2>
|
|
}
|
|
else
|
|
{
|
|
<h2>Edit Movie</h2>
|
|
}
|
|
|
|
@using (Html.BeginForm("Save", "Movies"))
|
|
{
|
|
<div class="form-group">
|
|
@Html.LabelFor(m => m.Movie.Name)
|
|
@Html.TextBoxFor(m => m.Movie.Name, new { @class = "form-control" })
|
|
</div>
|
|
<div class="form-group">
|
|
@Html.LabelFor(m => m.Movie.ReleaseDate)
|
|
@Html.TextBoxFor(m => m.Movie.ReleaseDate, "{0:d MMM yyyy}", new { @class = "form-control" })
|
|
</div>
|
|
<div class="form-group">
|
|
@Html.LabelFor(m => m.Movie.MovieGenreId)
|
|
@Html.DropDownListFor(m => m.Movie.MovieGenreId, new SelectList(Model.MovieGenres, "Id", "Name"), "Select Genre Type", new { @class = "form-control" })
|
|
</div>
|
|
<div class="form-group">
|
|
@Html.LabelFor(m => m.Movie.NumberInStock)
|
|
@Html.TextBoxFor(m => m.Movie.NumberInStock, new { @class = "form-control" })
|
|
</div>
|
|
@Html.HiddenFor(m=>m.Movie.Id)
|
|
<button type="submit" class="btn btn-primary">Save</button>
|
|
} |