diff --git a/SportsStore/SportsStore.WebUI/Views/Admin/Edit.cshtml b/SportsStore/SportsStore.WebUI/Views/Admin/Edit.cshtml index 9c7bbd8..6d7c0f7 100644 --- a/SportsStore/SportsStore.WebUI/Views/Admin/Edit.cshtml +++ b/SportsStore/SportsStore.WebUI/Views/Admin/Edit.cshtml @@ -1,15 +1,45 @@ @model SportsStore.Domain.Entities.Product @{ - ViewBag.Title = "Edit"; + ViewBag.Title = "Admin: Edit" + Model.Name; Layout = "~/Views/Shared/_AdminLayout.cshtml"; } -

Edit @Model.Name

+
+
+

Edit @Model.Name

+
+ + @using (Html.BeginForm()) + { +
+ @Html.HiddenFor(m => m.ProductID) + @foreach (var property in ViewData.ModelMetadata.Properties) + { + if (property.PropertyName != "ProductID") + { +
+ + @if (property.PropertyName == "Description") + { + @Html.TextArea(property.PropertyName, null, + new { @class = "form-control", rows = 5 }) + } + else + { + @Html.TextBox(property.PropertyName, null, + new { @class = "form-control" }) + } +
+ } + } +
+ + + } +
-@using (Html.BeginForm()) -{ - @Html.EditorForModel() - - @Html.ActionLink("Cancel and return to List", "List") -}