@model MrCMS.Web.Apps.Ecommerce.Stock.Entities.Warehouse
@{
    var anyStock = ViewData["any-stock"] is bool && (bool)ViewData["any-stock"];
}
@using (Html.BeginForm("Edit", "Warehouse", FormMethod.Post))
{
    <fieldset>
        <legend>
            Update warehouse Details
            <span class="btn-group display-inline pull-right">
                <button type="submit" class="btn btn-primary">Save</button>
            </span>
        </legend>
        <div class="form-group">
            @Html.LabelFor(warehouse => warehouse.Name)
            @Html.TextBoxFor(warehouse => warehouse.Name, new { @class = "form-control" })
            @Html.ValidationMessageFor(warehouse => warehouse.Name)
        </div>
    </fieldset>
}
@if (!anyStock)
{
    Html.RenderAction("GenerateStock", "Warehouse", new { id = Model.Id });
}
else
{
    @Html.ActionLink("Manage Stock", "Index", "WarehouseStock", new { warehouseId = Model.Id }, new { @class = "btn btn-default" })
}