@using NorthwindRazorAPI.Domain; @model NorthwindRazor.PartialModels.AddEditProductsPartialModel <form method="post"> <input type="hidden" asp-for="@Model.ReturnUrl" /> <div> <fieldset> <legend></legend> <table> @if (Model.Operation == CrudOperation.Update) { <tr> <td class="editor-label"><label asp-for="Products.ProductID"></label>:</td> <td></td> <td class="editor-field"><input asp-for="Products.ProductID" readonly="readonly" /></td> <td></td> </tr> } <tr> <td class="editor-label"><label asp-for="Products.ProductName"></label>:</td> <td><span style="color: red;">*</span></td> <td class="editor-field"><input asp-for="Products.ProductName" /></td> <td class="editor-field"><span asp-validation-for="Products.ProductName"></span></td> </tr> <tr> <td class="editor-label"><label asp-for="Products.SupplierID"></label>:</td> <td></td> <td class="editor-field"><select id="supplierID" asp-for="Products.SupplierID" asp-items="@(new SelectList(Model.SuppliersDropDownListData, "SupplierID", "CompanyName"))"><option value="">Select One</option></select></td> <td class="editor-field"><span asp-validation-for="Products.SupplierID"></span></td> </tr> <tr> <td class="editor-label"><label asp-for="Products.CategoryID"></label>:</td> <td></td> <td class="editor-field"><select id="categoryID" asp-for="Products.CategoryID" asp-items="@(new SelectList(Model.CategoriesDropDownListData, "CategoryID", "CategoryName"))"><option value="">Select One</option></select></td> <td class="editor-field"><span asp-validation-for="Products.CategoryID"></span></td> </tr> <tr> <td class="editor-label"><label asp-for="Products.QuantityPerUnit"></label>:</td> <td></td> <td class="editor-field"><input asp-for="Products.QuantityPerUnit" /></td> <td class="editor-field"><span asp-validation-for="Products.QuantityPerUnit"></span></td> </tr> <tr> <td class="editor-label"><label asp-for="Products.UnitPrice"></label>:</td> <td></td> <td class="editor-field"><input asp-for="Products.UnitPrice" /></td> <td class="editor-field"><span asp-validation-for="Products.UnitPrice"></span></td> </tr> <tr> <td class="editor-label"><label asp-for="Products.UnitsInStockHidden"></label>:</td> <td></td> <td class="editor-field"><input asp-for="Products.UnitsInStockHidden" /></td> <td class="editor-field"><span asp-validation-for="Products.UnitsInStockHidden"></span></td> </tr> <tr> <td class="editor-label"><label asp-for="Products.UnitsOnOrderHidden"></label>:</td> <td></td> <td class="editor-field"><input asp-for="Products.UnitsOnOrderHidden" /></td> <td class="editor-field"><span asp-validation-for="Products.UnitsOnOrderHidden"></span></td> </tr> <tr> <td class="editor-label"><label asp-for="Products.ReorderLevelHidden"></label>:</td> <td></td> <td class="editor-field"><input asp-for="Products.ReorderLevelHidden" /></td> <td class="editor-field"><span asp-validation-for="Products.ReorderLevelHidden"></span></td> </tr> <tr> <td class="editor-label"><label asp-for="Products.Discontinued"></label>:</td> <td><span style="color: red;">*</span></td> <td class="editor-field"><input asp-for="Products.Discontinued" type="checkbox" /></td> <td class="editor-field"><span asp-validation-for="Products.Discontinued"></span></td> </tr> <tr> <td colspan="2"></td> <td colspan="2"> <br /> @if (Model.Operation == CrudOperation.Add) { <input type="submit" asp-page-handler="Add" value="Add" class="button-150" /> } else { <input type="submit" asp-page-handler="Update" value="Update" class="button-150" /> } @if(Model.ReturnUrl != null) { <input type="button" value ="Cancel" onclick="window.location='@Model.ReturnUrl'; return false;" class="button-100" /> } else { <input type="button" value="Cancel" onclick="window.location='Index'; return false;" class="button-100" /> } </td> </tr> </table> </fieldset> </div> </form>