2021-09-23 12:48:39 +10:00
|
|
|
@model SportsStore.Domain.Entities.Product
|
|
|
|
|
|
|
|
@{
|
2021-09-23 16:29:18 +10:00
|
|
|
ViewBag.Title = "Admin: Edit" + Model.Name;
|
2021-09-23 12:48:39 +10:00
|
|
|
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
|
|
|
}
|
|
|
|
|
2021-09-23 16:29:18 +10:00
|
|
|
<div class="panel">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3>Edit @Model.Name</h3>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@using (Html.BeginForm())
|
|
|
|
{
|
|
|
|
<div class="panel-body">
|
|
|
|
@Html.HiddenFor(m => m.ProductID)
|
|
|
|
@foreach (var property in ViewData.ModelMetadata.Properties)
|
|
|
|
{
|
|
|
|
if (property.PropertyName != "ProductID")
|
|
|
|
{
|
|
|
|
<div class="form-group">
|
|
|
|
<label>@(property.DisplayName ?? property.PropertyName)</label>
|
|
|
|
@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" })
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="panel-footer">
|
|
|
|
<input type="submit" value="Save" class="btn btn-primary" />
|
|
|
|
@Html.ActionLink("Cancel and return to List", "Index", null,
|
|
|
|
new { @class = "btn btn-default" })
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
2021-09-23 12:48:39 +10:00
|
|
|
|