@model SMS_MVCDTO.Models.ViewModels.NewProductViewModel

@{
    ViewData["Title"] = "Edit";
}

<partial name="_Notification" />


<h1> Update Product details</h1>
<hr />
    

<div class="col-md-4">
    @using (Html.BeginForm("Edit", "Product"))
    {

        <div class="form-group">
            @Html.HiddenFor(x => x.UpdateProduct.Data.Barcode, new {@class = "form-control"})
        </div>
        
        <div class="form-group">
            @Html.HiddenFor(x => x.UpdateProduct.Data.Id, new {@class = "form-control"})
        </div>

        <div class="form-group">
            @Html.LabelFor(x => x.UpdateProduct.Data.Name, new {@class = "control-label"})
            @Html.TextBoxFor(x => x.UpdateProduct.Data.Name, new {@class = "form-control"})
            @Html.ValidationMessageFor(x => x.UpdateProduct.Data.Name,"", new {@class="text-danger"})
        </div>

        <div class="form-group">
            @Html.LabelFor(x => x.UpdateProduct.Data.Description, new {@class = "control-label"})
            @Html.TextBoxFor(x => x.UpdateProduct.Data.Description, new {@class = "form-control"})
            @Html.ValidationMessageFor(x => x.UpdateProduct.Data.Description,"", new {@class="text-danger"})
        </div>

        <div class="form-group">
            @Html.LabelFor(x => x.UpdateProduct.Data.SellingPrice, new {@class = "control-label"})
            @Html.TextBoxFor(x => x.UpdateProduct.Data.SellingPrice, new {@class = "form-control"})
            @Html.ValidationMessageFor(x => x.UpdateProduct.Data.SellingPrice,"", new {@class="text-danger"})
        </div>

        <div class="form-group">
            @Html.LabelFor(x => x.UpdateProduct.Data.Quantity, new {@class = "control-label"})
            @Html.TextBoxFor(x => x.UpdateProduct.Data.Quantity, new {@class = "form-control"})
            @Html.ValidationMessageFor(x => x.UpdateProduct.Data.Quantity,"", new {@class="text-danger"})
        </div>

        <div class="form-group">
            @Html.LabelFor(x => x.UpdateProduct.Data.ReorderLevel, new {@class = "control-label"})
            @Html.TextBoxFor(x => x.UpdateProduct.Data.ReorderLevel, new {@class = "form-control"})
            @Html.ValidationMessageFor(x => x.UpdateProduct.Data.ReorderLevel,"", new {@class="text-danger"})
        </div>

        <div>
            @Html.LabelFor(x => x.PCategory, new {@class = "control-label"})
            @Html.DropDownListFor(x => x.UpdateProduct.Data.Category, new SelectList(Model.PCategory,"Data.CategoryCode","Data.Name"),"Select Category" ,new {@class = "form-control"})
            @Html.ValidationMessageFor(x => x.UpdateProduct.Data.Category,"", new {@class="text-danger"})

        </div>

        <div class="form-group">
            <button type="submit" class="btn btn-success">Add</button>
        </div>
    }
</div>
@section scripts {
    @{
        await Html.RenderPartialAsync("_ValidationScriptsPartial");
    }
}