private void LoadWrapStyles() { WrapGroup wrapGroup = WrapGroupDataSource.Load(this.WrapGroupId); if (wrapGroup != null) { _WrapStyles = wrapGroup.WrapStyles; } }
protected void Page_Init(object sender, EventArgs e) { int wrapGroupId = AlwaysConvert.ToInt(Request.QueryString["WrapGroupId"]); _WrapGroup = WrapGroupDataSource.Load(wrapGroupId); if (_WrapGroup == null) { Response.Redirect("Default.aspx"); } Caption.Text = string.Format(Caption.Text, _WrapGroup.Name); _IconPath = AbleCommerce.Code.PageHelper.GetAdminThemeIconPath(this.Page); FindAssignProducts1.AssignmentValue = _WrapGroup.Id; FindAssignProducts1.OnAssignProduct += new AssignProductEventHandler(FindAssignProducts1_AssignProduct); FindAssignProducts1.OnLinkCheck += new AssignProductEventHandler(FindAssignProducts1_LinkCheck); FindAssignProducts1.OnCancel += new EventHandler(FindAssignProducts1_CancelButton); }
protected void Page_Load(object sender, EventArgs e) { int wrapGroupId = AlwaysConvert.ToInt(Request.QueryString["WrapGroupId"]); _WrapGroup = WrapGroupDataSource.Load(wrapGroupId); if (_WrapGroup == null) { Response.Redirect("Default.aspx"); } _WrapGroup.WrapStyles.Sort("OrderBy"); if (!Page.IsPostBack) { Name.Text = _WrapGroup.Name; ViewState["Caption"] = Caption.Text; Caption.Text = string.Format(Caption.Text, _WrapGroup.Name); //INITIALIZE THE ADD WRAP GROUP DIALOG AddWrapStyleDialog addDialog = AbleCommerce.Code.PageHelper.RecursiveFindControl(this, "AddWrapStyleDialog1") as AddWrapStyleDialog; if (addDialog != null) { addDialog.WrapGroupId = wrapGroupId; } } }
private void ProcessRules(BreadCrumbItem breadCrumbItem) { int id; if (breadCrumbItem.Url == "#") { return; } switch (breadCrumbItem.Url.ToLowerInvariant()) { case "~/admin/orders/shipments/editshipment.aspx": id = AlwaysConvert.ToInt(Request.QueryString["OrderShipmentId"]); breadCrumbItem.Url += "?OrderShipmentId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, id); break; case "~/admin/products/editproduct.aspx": case "~/admin/products/variants/variants.aspx": case "~/admin/products/variants/options.aspx": case "~/admin/products/digitalgoods/digitalgoods.aspx": case "~/admin/products/kits/editkit.aspx": case "~/admin/products/assets/images.aspx": case "~/admin/products/editproducttemplate.aspx": case "~/admin/products/specials/default.aspx": int categoryId = AbleCommerce.Code.PageHelper.GetCategoryId(); id = AbleCommerce.Code.PageHelper.GetProductId(); Product product = ProductDataSource.Load(id); if (categoryId > 0) { breadCrumbItem.Url += "?CategoryId=" + categoryId + "&ProductId=" + id; } else { breadCrumbItem.Url += "?ProductId=" + id; } breadCrumbItem.Title = string.Format(breadCrumbItem.Title, product.Name); break; case "~/admin/orders/vieworder.aspx": case "~/admin/orders/edit/editorderitems.aspx": case "~/admin/orders/viewdigitalgoods.aspx": case "~/admin/orders/payments/default.aspx": case "~/admin/orders/shipments/default.aspx": id = AbleCommerce.Code.PageHelper.GetOrderId(); Order order = OrderDataSource.Load(id); breadCrumbItem.Url += "?OrderNumber=" + order.OrderNumber; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, order.OrderNumber); break; case "~/admin/marketing/coupons/editcoupon.aspx": id = AlwaysConvert.ToInt(Request.QueryString["CouponId"]); Coupon coupon = CouponDataSource.Load(id); breadCrumbItem.Url += "?CouponId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, coupon.Name); break; case "~/admin/products/variants/editoption.aspx": case "~/admin/products/variants/editchoices.aspx": id = AlwaysConvert.ToInt(Request.QueryString["OptionId"]); Option option = OptionDataSource.Load(id); breadCrumbItem.Url += "?OptionId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, option.Name); break; case "~/admin/products/giftwrap/editwrapgroup.aspx": id = AlwaysConvert.ToInt(Request.QueryString["WrapGroupId"]); WrapGroup wrapGroup = WrapGroupDataSource.Load(id); breadCrumbItem.Url += "?WrapGroupId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, wrapGroup.Name); break; case "~/admin/marketing/email/managelist.aspx": id = AlwaysConvert.ToInt(Request.QueryString["EmailListId"]); EmailList emailList = EmailListDataSource.Load(id); if (emailList != null) { breadCrumbItem.Url += "?EmailListId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, emailList.Name); } break; case "~/admin/marketing/discounts/editdiscount.aspx": id = AlwaysConvert.ToInt(Request.QueryString["VolumeDiscountId"]); VolumeDiscount discount = VolumeDiscountDataSource.Load(id); breadCrumbItem.Url += "?VolumeDiscountId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, discount.Name); break; case "~/admin/catalog/editwebpage.aspx": id = AbleCommerce.Code.PageHelper.GetWebpageId(); Webpage webpage = WebpageDataSource.Load(id); breadCrumbItem.Url += "?WebpageId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, webpage.Name); break; case "~/admin/catalog/editLink.aspx": id = AbleCommerce.Code.PageHelper.GetLinkId(); Link link = LinkDataSource.Load(id); breadCrumbItem.Url += "?LinkId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, link.Name); break; case "~/admin/people/users/edituser.aspx": id = AlwaysConvert.ToInt(Request.QueryString["UserId"]); User user = UserDataSource.Load(id); breadCrumbItem.Url += "?UserId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, user.UserName); break; case "~/admin/digitalgoods/editdigitalgood.aspx": case "~/admin/digitalgoods/serialkeyproviders/defaultprovider/configure.aspx": id = AlwaysConvert.ToInt(Request.QueryString["DigitalGoodId"]); DigitalGood dg = DigitalGoodDataSource.Load(id); if (dg != null) { breadCrumbItem.Url += "?DigitalGoodId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, dg.Name); } break; case "~/admin/products/producttemplates/editproducttemplate.aspx": id = AlwaysConvert.ToInt(Request.QueryString["ProductTemplateId"]); ProductTemplate template = ProductTemplateDataSource.Load(id); if (template == null) { InputField field = InputFieldDataSource.Load(AlwaysConvert.ToInt(Request.QueryString["InputFieldId"])); if (field != null) { template = field.ProductTemplate; id = template.Id; } } if (template != null) { breadCrumbItem.Url += "?ProductTemplateId=" + id; breadCrumbItem.Title = string.Format(breadCrumbItem.Title, template.Name); } else { } break; case "~/admin/reports/dailyabandonedbaskets.aspx": id = AlwaysConvert.ToInt(Request.QueryString["BasketId"]); Basket basket = BasketDataSource.Load(id); if (basket != null) { breadCrumbItem.Url += "?ReportDate=" + basket.User.LastActivityDate.Value.ToShortDateString(); } break; } // resolve relative urls if (breadCrumbItem.Url.StartsWith("~/")) { breadCrumbItem.Url = Page.ResolveUrl(breadCrumbItem.Url); } }