@model CustomerModel @using Telerik.Web.Mvc.UI; @using SmartStore.Core.Domain.Orders; @Html.ValidationSummary(false) @Html.HiddenFor(model => model.Id) @Html.SmartStore().TabStrip().Name("customer-edit").Items(x => { var tabInfo = x.Add().Text(T("Admin.Customers.Customers.Info").Text).Content(TabInfo()).Selected(true); var tabCustomerRoles = x.Add().Text(T("Admin.Customers.Customers.CustomerRoles").Text).Content(TabCustomerRoles()); TabBuilder tabOrders = null; if (Model.Id > 0) tabOrders = x.Add().Text(T("Admin.Customers.Customers.Orders").Text).Content(TabOrders()); TabBuilder tabRewardPoints = null; if (Model.DisplayRewardPointsHistory) tabRewardPoints = x.Add().Text(T("Admin.Customers.Customers.RewardPoints").Text).Content(TabRewardPoints()); TabBuilder tabAddresses = null; if (Model.Id > 0) tabAddresses = x.Add().Text(T("Admin.Customers.Customers.Addresses").Text).Content(TabAddresses()); TabBuilder tabShoppingCart = null; if (Model.Id > 0) tabShoppingCart = x.Add().Text(T("Admin.Customers.Customers.CurrentShoppingCart").Text).Content(TabCurrentShoppingCart()); TabBuilder tabWishlist = null; if (Model.Id > 0) tabWishlist = x.Add().Text(T("Admin.Customers.Customers.CurrentWishlist").Text).Content(TabCurrentWishlist()); TabBuilder tabImpersonate = null; if (Model.Id > 0) tabImpersonate = x.Add().Text(T("Admin.Customers.Customers.Impersonate").Text).Content(TabImpersonate()); //generate an event EngineContext.Current.Resolve().Publish(new TabStripCreated(x, "customer-edit", this.Html, this.Model)); }) @helper TabInfo() { if (Model.CountryEnabled && Model.StateProvinceEnabled) { } @if (Model.Id != 0) { } @if (Model.UsernamesEnabled) { if (Model.Id == 0 || Model.AllowUsersToChangeUsernames) { } else { } } @if (Model.Id > 0 && Model.AssociatedExternalAuthRecords.Count > 0) { } @if (Model.GenderEnabled) { } @if (Model.DateOfBirthEnabled) { } @if (Model.CompanyEnabled) { } @if (Model.CustomerNumberEnabled) { } @if (Model.StreetAddressEnabled) { } @if (Model.StreetAddress2Enabled) { } @if (Model.ZipPostalCodeEnabled) { } @if (Model.CityEnabled) { } @if (Model.CountryEnabled) { } @if (Model.CountryEnabled && Model.StateProvinceEnabled) { } @if (Model.PhoneEnabled) { } @if (Model.FaxEnabled) { } @if (Model.AllowCustomersToSetTimeZone) { } @if (Model.AffiliateId != 0) { } @if (Model.DisplayVatNumber) { } @if (Model.Id > 0) { } @if (Model.Id > 0) { } @if (Model.Id > 0) { } @if (Model.Id > 0 && Model.LastVisitedPage.HasValue()) { }
@Html.SmartLabelFor(model => model.Id) @Html.DisplayFor(model => model.Id) @Html.ValidationMessageFor(model => model.Id)
@Html.SmartLabelFor(model => model.Username) @Html.EditorFor(model => model.Username) @Html.ValidationMessageFor(model => model.Username)
@Html.SmartLabelFor(model => model.Username) @Model.Username @Html.HiddenFor(model => model.Username)
@Html.SmartLabelFor(model => model.Email) @Html.EditorFor(model => model.Email) @Html.ValidationMessageFor(model => model.Email)
@Html.SmartLabelFor(model => model.Password) @Html.EditorFor(model => model.Password) @Html.ValidationMessageFor(model => model.Password) @if (Model.Id > 0) { }
@Html.SmartLabelFor(model => model.AssociatedExternalAuthRecords) @(Html.Telerik().Grid(Model.AssociatedExternalAuthRecords) .Name("externalauthrecords-grid") .Columns(columns => { columns.Bound(x => x.AuthMethodName) .Width(100); columns.Bound(x => x.Email) .Width(100); columns.Bound(x => x.ExternalIdentifier) .Width(300); }) .Footer(false))
@Html.SmartLabelFor(model => model.Gender)
@Html.SmartLabelFor(model => model.FirstName) @Html.EditorFor(model => model.FirstName) @Html.ValidationMessageFor(model => model.FirstName)
@Html.SmartLabelFor(model => model.LastName) @Html.EditorFor(model => model.LastName) @Html.ValidationMessageFor(model => model.LastName)
@Html.SmartLabelFor(model => model.DateOfBirth) @Html.EditorFor(model => model.DateOfBirth) @Html.ValidationMessageFor(model => model.DateOfBirth)
@Html.SmartLabelFor(model => model.Company) @Html.EditorFor(model => model.Company) @Html.ValidationMessageFor(model => model.Company)
@Html.SmartLabelFor(model => model.CustomerNumber) @Html.EditorFor(model => model.CustomerNumber) @Html.ValidationMessageFor(model => model.CustomerNumber)
@Html.SmartLabelFor(model => model.StreetAddress) @Html.EditorFor(model => model.StreetAddress) @Html.ValidationMessageFor(model => model.StreetAddress)
@Html.SmartLabelFor(model => model.StreetAddress2) @Html.EditorFor(model => model.StreetAddress2) @Html.ValidationMessageFor(model => model.StreetAddress2)
@Html.SmartLabelFor(model => model.ZipPostalCode) @Html.EditorFor(model => model.ZipPostalCode) @Html.ValidationMessageFor(model => model.ZipPostalCode)
@Html.SmartLabelFor(model => model.City) @Html.EditorFor(model => model.City) @Html.ValidationMessageFor(model => model.City)
@Html.SmartLabelFor(model => model.CountryId) @Html.DropDownList("CountryId", Model.AvailableCountries)
@Html.SmartLabelFor(model => model.StateProvinceId) @Html.DropDownList("StateProvinceId", Model.AvailableStates)
@Html.SmartLabelFor(model => model.Phone) @Html.EditorFor(model => model.Phone) @Html.ValidationMessageFor(model => model.Phone)
@Html.SmartLabelFor(model => model.Fax) @Html.EditorFor(model => model.Fax) @Html.ValidationMessageFor(model => model.Fax)
@Html.SmartLabelFor(model => model.AdminComment) @Html.TextAreaFor(model => model.AdminComment) @Html.ValidationMessageFor(model => model.AdminComment)
@Html.SmartLabelFor(model => model.IsTaxExempt) @Html.EditorFor(model => model.IsTaxExempt) @Html.ValidationMessageFor(model => model.IsTaxExempt)
@Html.SmartLabelFor(model => model.TimeZoneId) @Html.DropDownList("TimeZoneId", Model.AvailableTimeZones) @Html.ValidationMessageFor(model => model.TimeZoneId)
@Html.SmartLabelFor(model => model.AffiliateId) @Model.AffiliateFullName
@Html.SmartLabelFor(model => model.VatNumber) @Html.EditorFor(model => model.VatNumber) (@string.Format(T("Admin.Customers.Customers.Fields.VatNumberStatus").Text, Model.VatNumberStatusNote)) @Html.ValidationMessageFor(model => model.VatNumber)
@Html.SmartLabelFor(model => model.Active) @Html.EditorFor(model => model.Active) @Html.ValidationMessageFor(model => model.Active)
@Html.SmartLabelFor(model => model.LastIpAddress) @Html.DisplayFor(model => model.LastIpAddress)
@Html.SmartLabelFor(model => model.CreatedOn) @Html.DisplayFor(model => model.CreatedOn)
@Html.SmartLabelFor(model => model.LastActivityDate) @Html.DisplayFor(model => model.LastActivityDate)
@Html.SmartLabelFor(model => model.LastVisitedPage) @Model.LastVisitedPage.Truncate(128, "...")
} @helper TabCustomerRoles() { if (Model.AvailableCustomerRoles != null && Model.AvailableCustomerRoles.Count > 0) { foreach (var customerRole in Model.AvailableCustomerRoles) { } } else { @T("Admin.Customers.Customers.Fields.CustomerRoles.NoRoles") } } @helper TabOrders() { var gridPageSize = EngineContext.Current.Resolve().GridPageSize; @(Html.Telerik().Grid() .Name("order-grid") .Columns(columns => { columns.Bound(x => x.Id); columns.Bound(x => x.OrderTotal) .RightAlign(); columns.Bound(x => x.OrderStatus); columns.Bound(x => x.PaymentStatus); columns.Bound(x => x.ShippingStatus); columns.Bound(x => x.StoreName); columns.Bound(x => x.CreatedOn); columns.Bound(x => x.Id) .Template(x => Html.ActionLink(T("Admin.Common.View").Text, "Edit", "Order", new { id = x.Id }, new { })) .ClientTemplate("\">" + T("Admin.Common.View").Text + "") .Centered() .Title(T("Admin.Common.View").Text); }) .Pageable(settings => settings.PageSize(gridPageSize).Position(GridPagerPosition.Both)) .DataBinding(dataBinding => { dataBinding.Ajax().Select("OrderList", "Customer", new { customerId = Model.Id }); }) .PreserveGridState() .EnableCustomBinding(true)) } @helper TabRewardPoints() { @(Html.Telerik().Grid().Name("customer-rewardpoints-grid") .DataKeys(keys => { keys.Add(x => x.Id).RouteKey("rewardPointsHistoryId"); }) .DataBinding(binding => { binding.Ajax().Select("RewardPointsHistorySelect", "Customer", new { customerId = Model.Id }); }) .Columns(columns => { columns.Bound(x => x.Points); columns.Bound(x => x.PointsBalance).ReadOnly(); columns.Bound(x => x.Message); columns.Bound(x => x.CreatedOn).ReadOnly(); }))
@T("Admin.Customers.Customers.RewardPoints.AddTitle")
@Html.SmartLabelFor(model => model.AddRewardPointsValue) @Html.EditorFor(model => model.AddRewardPointsValue) @Html.ValidationMessageFor(model => model.AddRewardPointsValue)
@Html.SmartLabelFor(model => model.AddRewardPointsMessage) @Html.TextAreaFor(model => model.AddRewardPointsMessage) @Html.ValidationMessageFor(model => model.AddRewardPointsMessage)
 
} @helper TabAddresses() { @(Html.Telerik().Grid().Name("customer-addresses-grid") .DataKeys(keys => { keys.Add(x => x.Id).RouteKey("addressId"); }) .DataBinding(binding => { binding.Ajax() .Select("AddressesSelect", "Customer", new { customerId = Model.Id }) .Delete("AddressDelete", "Customer", new { customerId = Model.Id }); }) .Columns(columns => { columns.Bound(x => x.FirstName); columns.Bound(x => x.LastName); columns.Bound(x => x.Email); columns.Bound(x => x.PhoneNumber); columns.Bound(x => x.FaxNumber); columns.Bound(x => x.AddressHtml) .Encoded(false); columns.Bound(x => x.Id) .ClientTemplate("\">" + T("Admin.Common.Edit").Text + "") .Title(T("Admin.Common.Edit").Text); columns.Command(commands => { commands.Delete().Localize(T); }) .Title(T("Admin.Common.Delete").Text); }))
} @helper TabCurrentShoppingCart() {
@(Html.Telerik().Grid() .Name("currentshoppingcart-grid") .Columns(columns => { columns.Bound(sci => sci.ProductName) .Template(x => @Html.LabeledProductName(x.ProductId, x.ProductName, x.ProductTypeName, x.ProductTypeLabelHint)) .ClientTemplate(@Html.LabeledProductName("ProductId", "ProductName")); columns.Bound(sci => sci.Quantity).Centered().Width(100); columns.Bound(sci => sci.UnitPrice).RightAlign().Width(120); columns.Bound(sci => sci.Total).RightAlign().Width(120); columns.Bound(sci => sci.Store).Width(300); columns.Bound(sci => sci.UpdatedOn).Width(200); }) .DataBinding(dataBinding => dataBinding.Ajax() .Select("GetCartList", "Customer", new { customerId = Model.Id, cartTypeId = (int)ShoppingCartType.ShoppingCart })) )
} @helper TabCurrentWishlist() {
@(Html.Telerik().Grid() .Name("currentwishlist-grid") .Columns(columns => { columns.Bound(sci => sci.ProductName) .Template(x => @Html.LabeledProductName(x.ProductId, x.ProductName, x.ProductTypeName, x.ProductTypeLabelHint)) .ClientTemplate(@Html.LabeledProductName("ProductId", "ProductName")); columns.Bound(sci => sci.Quantity).Centered().Width(100); columns.Bound(sci => sci.UnitPrice).RightAlign().Width(120); columns.Bound(sci => sci.Total).RightAlign().Width(120); columns.Bound(sci => sci.Store).Width(300); columns.Bound(sci => sci.UpdatedOn).Width(200); }) .DataBinding(dataBinding => dataBinding.Ajax() .Select("GetCartList", "Customer", new { customerId = Model.Id, cartTypeId = (int)ShoppingCartType.Wishlist })) )
} @helper TabImpersonate() {

@T("Admin.Customers.Customers.Impersonate.Description1")

@T("Admin.Customers.Customers.Impersonate.Description2")

}