@model GreenTree.Strohrmann.ERP.Web.Models.Business.MaterialModel

@{
    ViewData["Title"] = "Neues Material";
}

<h1>Material erstellen</h1>

<h4>Neues Material</h4>
<hr />

<form asp-action="Create">
    <div asp-validation-summary="ModelOnly" class="text-danger"></div>
    <div class="card-deck">
        <div class="card card-maxw bg-light">
            <div class="card-header pb-1">
                <h6>Allgemein</h6>
            </div>
            <div class="card-body">
                <div class="form-group">
                    <label asp-for="Name" class="control-label"></label>
                    <input asp-for="Name" class="form-control" />
                    <span asp-validation-for="Name" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="Description" class="control-label"></label>
                    <input asp-for="Description" class="form-control" />
                    <span asp-validation-for="ItemNumber" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="NetValue" class="control-label"></label>
                    <div class="input-group">
                        <div class="input-group-prepend">
                            <span class="input-group-text">€</span>
                        </div>
                        <input asp-for="NetValue" type="number" min="0.00" class="form-control" />
                    </div>
                    <span asp-validation-for="NetValue" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="card card-maxw bg-light">
            <div class="card-header pb-1">
                <h6>Bemaßung</h6>
            </div>
            <div class="card-body">
                <div class="form-group">
                    <label asp-for="DefaultUnit" class="control-label"></label>
                    @Html.DropDownListFor(m => m.DefaultUnit.Id, 
                        (IEnumerable<SelectListItem>)ViewData["AvailableUnits"], 
                        new { @class = "form-control" })
                    <span asp-validation-for="DefaultUnit" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="Height" class="control-label"></label>
                    <input asp-for="Height" class="form-control" />
                    <span asp-validation-for="Height" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="Width" class="control-label"></label>
                    <input asp-for="Width" class="form-control" />
                    <span asp-validation-for="Width" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="Depth" class="control-label"></label>
                    <input asp-for="Depth" class="form-control" />
                    <span asp-validation-for="Depth" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="PackageSize" class="control-label"></label>
                    <input asp-for="PackageSize" value="1" class="form-control" />
                    <span asp-validation-for="PackageSize" class="text-danger"></span>
                </div>
            </div>
        </div>
        <div class="card card-maxw bg-light">
            <div class="card-header pb-1">
                <h6>Herstellerdaten</h6>
            </div>
            <div class="card-body">
                <div class="form-group">
                    <label asp-for="Supplier" class="control-label"></label>
                    @Html.DropDownListFor(m => m.Supplier.Id, 
                        (IEnumerable<SelectListItem>)ViewData["AvailableSuppliers"], 
                        new { @class = "form-control selectpicker", data_live_search = "true", data_style = "selectpicker-form" })
                    <span asp-validation-for="DefaultUnit" class="text-danger"></span>
                </div>
                <div class="form-group">
                    <label asp-for="ItemNumber" class="control-label"></label>
                    <input asp-for="ItemNumber" class="form-control" />
                    <span asp-validation-for="ItemNumber" class="text-danger"></span>
                </div>
            </div>
        </div>
    </div>

    <hr />

    <div class="form-group d-flex mt-3">
        <input type="submit" value="Erstellen" class="btn btn-primary" />
        <div class="align-self-center ml-3">
            <a asp-action="Index">Zurück zur Liste</a>
        </div>
    </div>
</form>