@model MrCMS.Web.Apps.Ecommerce.Entities.Users.Address
@{
    var countryOptions = ViewData["country-options"] as List<SelectListItem> ?? new List<SelectListItem>();
}

@using (Html.BeginForm("Edit", "UserAccountEditAddress", new { id = Model.Id }, FormMethod.Post))
{
    <div class="row">
        <div class="col-xs-12">
            <div class="form-group">
                @Html.LabelFor(address => address.FirstName)
                @Html.TextBoxFor(address => address.FirstName, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.FirstName)
            </div>
            <div class="form-group">
                @Html.LabelFor(address => address.LastName)
                @Html.TextBoxFor(address => address.LastName, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.LastName)
            </div>
            <div class="form-group">
                @Html.LabelFor(address => address.Company)
                @Html.TextBoxFor(address => address.Company, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.Company)
            </div>
            <div class="form-group">
                @Html.LabelFor(address => address.PhoneNumber)
                @Html.TextBoxFor(address => address.PhoneNumber, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.PhoneNumber)
            </div>
            <div class="form-group">
                @Html.LabelFor(address => address.Address1)
                @Html.TextBoxFor(address => address.Address1, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.Address1)
            </div>
            <div class="form-group">
                @Html.LabelFor(address => address.Address2)
                @Html.TextBoxFor(address => address.Address2, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.Address2)
            </div>
            <div class="form-group">
                @Html.LabelFor(address => address.City)
                @Html.TextBoxFor(address => address.City, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.City)
            </div>
            <div class="form-group">
                @Html.LabelFor(address => address.StateProvince)
                @Html.TextBoxFor(address => address.StateProvince, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.StateProvince)
            </div>
            <div class="form-group">
                @Html.LabelFor(address => address.PostalCode)
                @Html.TextBoxFor(address => address.PostalCode, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.PostalCode)
            </div>
            <div class="form-group">
                @Html.LabelFor(address => address.CountryCode)
                @Html.DropDownListFor(address => address.CountryCode, countryOptions, new { @class = "form-control" })
                @Html.ValidationMessageFor(address => address.CountryCode)
            </div>
        </div>
    </div>

    <button type="submit" class="btn btn-primary">@Resource("Save")</button>
}