- @Html.DropDownListFor(model => model.BillingAddress.AddressId,
- new SelectList(Model.AvailableAddresses, "AddressId", "Name", !string.IsNullOrEmpty(Model.BillingAddress.AddressId) ? Model.BillingAddress.AddressId : string.Empty), new { @class = "form-control jsChangeAddress address-dropdown" })
-
-
- @Html.ValidationMessageFor(model => Model.BillingAddress.AddressId)
+ if (!(bool)ViewData["IsReadOnly"])
+ {
+
+
+
+ @Html.DropDownListFor(model => model.BillingAddress.AddressId,
+ new SelectList(Model.AvailableAddresses, "AddressId", "Name", !string.IsNullOrEmpty(Model.BillingAddress.AddressId) ? Model.BillingAddress.AddressId : string.Empty), new { @class = "form-control jsChangeAddress address-dropdown" })
+
+
+ @Html.ValidationMessageFor(model => Model.BillingAddress.AddressId)
+
+
+
+ }
+ else
+ {
+
+
+
+ @Html.DropDownListFor(model => model.BillingAddress.AddressId,
+ new SelectList(Model.AvailableAddresses, "AddressId", "Name", !string.IsNullOrEmpty(Model.BillingAddress.AddressId) ? Model.BillingAddress.AddressId : string.Empty), new { @class = "form-control jsChangeAddress address-dropdown" })
+
+ Or add new address
+
+ @Html.ValidationMessageFor(model => Model.BillingAddress.AddressId)
+
+
+
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.FirstName)
+ @Html.TextBoxFor(model => model.BillingAddress.FirstName, new { @class = "form-control" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.FirstName)
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.LastName)
+ @Html.TextBoxFor(model => model.BillingAddress.LastName, new { @class = "form-control" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.LastName)
+
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.Email)
+ @Html.TextBoxFor(model => model.BillingAddress.Email, new { @class = "form-control" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.Email)
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.Line1)
+ @Html.TextBoxFor(model => model.BillingAddress.Line1, new { @class = "form-control" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.Line1)
+
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.PostalCode)
+ @Html.TextBoxFor(model => model.BillingAddress.PostalCode, new { @class = "form-control jsChangeTaxAddress" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.PostalCode)
+
+
+ @Html.LabelFor(model => model.BillingAddress.City)
+ @Html.TextBoxFor(model => model.BillingAddress.City, new { @class = "form-control jsChangeTaxAddress" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.City)
+
+
+
+ @Html.EditorFor(model => model.BillingAddress.CountryRegion, Model.BillingAddress.CountryRegion)
+
+
+ @Html.LabelFor(model => model.BillingAddress.CountryCode)
+ @Html.DropDownListFor(model => model.BillingAddress.CountryCode, new SelectList(Model.BillingAddress.CountryOptions, "Code", "Name", Model.BillingAddress.CountryCode), new { @class = "form-control jsChangeCountry jsChangeTaxAddress" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.CountryCode)
+ @Html.Hidden("address-htmlfieldprefix", "BillingAddress.CountryRegion")
+ }
+ }
+ else
+ {
+
+
+ @Html.LabelFor(model => model.BillingAddress.FirstName)
+ @Html.TextBoxFor(model => model.BillingAddress.FirstName, new { @class = "form-control" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.FirstName)
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.LastName)
+ @Html.TextBoxFor(model => model.BillingAddress.LastName, new { @class = "form-control" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.LastName)
+
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.Email)
+ @Html.TextBoxFor(model => model.BillingAddress.Email, new { @class = "form-control" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.Email)
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.Line1)
+ @Html.TextBoxFor(model => model.BillingAddress.Line1, new { @class = "form-control" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.Line1)
+
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.PostalCode)
+ @Html.TextBoxFor(model => model.BillingAddress.PostalCode, new { @class = "form-control jsChangeTaxAddress" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.PostalCode)
+
+
+
+ @Html.LabelFor(model => model.BillingAddress.City)
+ @Html.TextBoxFor(model => model.BillingAddress.City, new { @class = "form-control jsChangeTaxAddress" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.City)
+
+
+
+ @Html.EditorFor(model => model.BillingAddress.CountryRegion, Model.BillingAddress.CountryRegion)
+
+
+ @Html.LabelFor(model => model.BillingAddress.CountryCode)
+ @Html.DropDownListFor(model => model.BillingAddress.CountryCode, new SelectList(Model.BillingAddress.CountryOptions, "Code", "Name", Model.BillingAddress.CountryCode), new { @class = "form-control jsChangeCountry jsChangeTaxAddress" })
+ @Html.ValidationMessageFor(model => model.BillingAddress.CountryCode)
+ @Html.Hidden("address-htmlfieldprefix", "BillingAddress.CountryRegion")
}
- else
- {
-
-
- @Html.LabelFor(model => model.BillingAddress.FirstName)
- @Html.TextBoxFor(model => model.BillingAddress.FirstName, new { @class = "form-control" })
- @Html.ValidationMessageFor(model => model.BillingAddress.FirstName)
-
-
-
- @Html.LabelFor(model => model.BillingAddress.LastName)
- @Html.TextBoxFor(model => model.BillingAddress.LastName, new { @class = "form-control" })
- @Html.ValidationMessageFor(model => model.BillingAddress.LastName)
-
-
-
-
- @Html.LabelFor(model => model.BillingAddress.Email)
- @Html.TextBoxFor(model => model.BillingAddress.Email, new { @class = "form-control" })
- @Html.ValidationMessageFor(model => model.BillingAddress.Email)
-
-
-
- @Html.LabelFor(model => model.BillingAddress.Line1)
- @Html.TextBoxFor(model => model.BillingAddress.Line1, new { @class = "form-control" })
- @Html.ValidationMessageFor(model => model.BillingAddress.Line1)
-
-
-
-
- @Html.LabelFor(model => model.BillingAddress.PostalCode)
- @Html.TextBoxFor(model => model.BillingAddress.PostalCode, new { @class = "form-control jsChangeTaxAddress" })
- @Html.ValidationMessageFor(model => model.BillingAddress.PostalCode)
-
-
-
- @Html.LabelFor(model => model.BillingAddress.City)
- @Html.TextBoxFor(model => model.BillingAddress.City, new { @class = "form-control jsChangeTaxAddress" })
- @Html.ValidationMessageFor(model => model.BillingAddress.City)
-
-
-
- @Html.EditorFor(model => model.BillingAddress.CountryRegion, Model.BillingAddress.CountryRegion)
-
-
- @Html.LabelFor(model => model.BillingAddress.CountryCode)
- @Html.DropDownListFor(model => model.BillingAddress.CountryCode, new SelectList(Model.BillingAddress.CountryOptions, "Code", "Name", Model.BillingAddress.CountryCode), new { @class = "form-control jsChangeCountry jsChangeTaxAddress" })
- @Html.ValidationMessageFor(model => model.BillingAddress.CountryCode)
- @Html.Hidden("address-htmlfieldprefix", "BillingAddress.CountryRegion")
-
- }