@model AffiliateModel @using Telerik.Web.Mvc.UI; @Html.ValidationSummary(false) @Html.HiddenFor(model => model.Id) @Html.SmartStore().TabStrip().Name("affiliate-edit").Items(x => { x.Add().Text(T("Admin.Affiliates.Info").Text).Content(TabInfo()).Selected(true); if (Model.Id > 0) { x.Add().Text(T("Admin.Affiliates.Customers").Text).Content(TabCustomers()); x.Add().Text(T("Admin.Affiliates.Orders").Text).Content(TabOrders()); } // generate an event EngineContext.Current.Resolve().Publish(new TabStripCreated(x, "affiliate-edit", this.Html, this.Model)); }) @helper TabInfo() { @if (Model.Id > 0) { }
@Html.SmartLabelFor(model => model.Id) @Model.Id
@Html.SmartLabelFor(model => model.Url) @Model.Url
@Html.SmartLabelFor(model => model.Active) @Html.EditorFor(model => model.Active) @Html.ValidationMessageFor(model => model.Active)
@Html.EditorFor(model => model.Address, "Address") } @helper TabCustomers() { @(Html.Telerik().Grid() .Name("customers-grid") .Columns(columns => { columns.Bound(x => x.Id); columns.Bound(x => x.Email) .Template(x => Html.ActionLink(x.Email, "Edit", "Customer", new { id = x.Id }, new { })) .ClientTemplate("\"><#= Email #>"); columns.Bound(x => x.Username) .Visible(Model.UsernamesEnabled); columns.Bound(x => x.FullName); columns.Bound(x => x.Id) .Template(x => Html.ActionLink(T("Admin.Common.View").Text, "Edit", "Customer", new { id = x.Id }, new { })) .ClientTemplate("\">" + T("Admin.Common.View").Text + "") .Title(T("Admin.Common.View").Text); }) .Pageable(settings => settings.PageSize(Model.GridPageSize).Position(GridPagerPosition.Both)) .DataBinding(dataBinding => { dataBinding.Ajax().Select("AffiliatedCustomerList", "Affiliate", new { affiliateId = Model.Id }); }) .PreserveGridState() .EnableCustomBinding(true)) } @helper TabOrders() { @(Html.Telerik().Grid() .Name("order-grid") .Columns(columns => { columns.Bound(x => x.Id) .Template(x => Html.ActionLink(x.Id.ToString(), "Edit", "Order", new { id = x.Id }, new { })) .ClientTemplate("\"><#= Id #>"); columns.Bound(x => x.OrderStatus); columns.Bound(x => x.PaymentStatus); columns.Bound(x => x.ShippingStatus); columns.Bound(x => x.OrderTotal) .RightAlign(); columns.Bound(x => x.CreatedOn); }) .Pageable(settings => settings.PageSize(Model.GridPageSize).Position(GridPagerPosition.Both)) .DataBinding(dataBinding => { dataBinding.Ajax().Select("AffiliatedOrderList", "Affiliate", new { affiliateId = Model.Id }); }) .PreserveGridState() .EnableCustomBinding(true)) }