protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { Size size = StringPlus.SplitToSize(ConfigSystem.GetValueByCache("ProductNormalImageSize"), '|', SettingConstant.ProductThumbSize.Width, SettingConstant.ProductThumbSize.Height); this.hfProductImagesThumbSize.Value = size.Width + "," + size.Height; this.hfIsOpenSku.Value = ConfigSystem.GetValueByCache("Shop_AddProduct_OpenSku"); this.hfIsOpenFit.Value = ConfigSystem.GetValueByCache("Shop_AddProduct_OpenFit"); this.hfIsOpenRelated.Value = ConfigSystem.GetValueByCache("Shop_AddProduct_OpenRelated"); this.txtDisplaySequence.Text = (this.productBll.MaxSequence() + 1).ToString(); this.BindPackageInfo(); SupplierInfo info = new SupplierInfo(); this.drpSupplier.DataSource = info.GetModelList(""); DataSet allList = info.GetAllList(); if (!DataSetTools.DataSetIsNull(allList)) { this.drpSupplier.DataSource = allList; this.drpSupplier.DataTextField = "Name"; this.drpSupplier.DataValueField = "SupplierId"; this.drpSupplier.DataBind(); } this.drpSupplier.Items.Insert(0, new ListItem("无", "0")); this.drpSupplier.SelectedIndex = 0; } }
private void BindProductBaseInfo() { SupplierInfo info = new SupplierInfo(); this.drpSupplier.DataSource = info.GetModelList(""); DataSet allList = info.GetAllList(); if (!DataSetTools.DataSetIsNull(allList)) { this.drpSupplier.DataSource = allList; this.drpSupplier.DataTextField = "Name"; this.drpSupplier.DataValueField = "SupplierId"; this.drpSupplier.DataBind(); } this.drpSupplier.Items.Insert(0, new ListItem("无", "0")); this.drpSupplier.SelectedIndex = 0; Maticsoft.Model.Shop.Products.ProductInfo model = new Maticsoft.BLL.Shop.Products.ProductInfo().GetModel(this.ProductId); if (model != null) { Maticsoft.BLL.Shop.Products.ProductCategories categories = new Maticsoft.BLL.Shop.Products.ProductCategories(); this.hfCategoryId.Value = model.CategoryId.ToString(); DataSet listByProductId = categories.GetListByProductId(model.ProductId); StringBuilder builder = new StringBuilder(); StringBuilder builder2 = new StringBuilder(); for (int i = 0; i < listByProductId.Tables[0].Rows.Count; i++) { builder.Append(listByProductId.Tables[0].Rows[i]["CategoryId"] + "_" + listByProductId.Tables[0].Rows[i]["CategoryPath"]); builder.Append(","); Maticsoft.Model.Shop.Products.CategoryInfo info4 = this.categoryManage.GetModel(Globals.SafeInt(listByProductId.Tables[0].Rows[i]["CategoryId"].ToString(), 0)); if (info4 != null) { builder2.Append(this.categoryManage.GetFullNameByCache(info4.CategoryId)); builder2.Append(" "); } } this.Hidden_SelectValue.Value = builder.ToString().TrimEnd(new char[] { ',' }); this.Hidden_SelectName.Value = this.LitPName.Text = builder2.ToString(); this.rptSelectCategory.DataSource = categories.GetListByProductId(model.ProductId); this.rptSelectCategory.DataBind(); if (model.RegionId.HasValue) { this.ajaxRegion.Area_iID = model.RegionId.Value; this.ajaxRegion.SelectedValue = model.RegionId.Value.ToString(); } this.txtSeoImageAlt.Text = model.SeoImageAlt; this.txtSeoImageTitle.Text = model.SeoImageTitle; this.txtMeta_Title.Text = model.Meta_Title; this.txtMeta_Keywords.Text = model.Meta_Keywords; this.txtMeta_Description.Text = model.Meta_Description; this.txtUrlRule.Text = model.SeoUrl; this.txtSalePrice.Text = model.LowestSalePrice.ToString("F"); this.rblUpselling.SelectedValue = model.SaleStatus.ToString(); if ((model.SupplierId > 0) && (this.drpSupplier.Items.FindByValue(model.SupplierId.ToString()) != null)) { this.drpSupplier.SelectedValue = model.SupplierId.ToString(); } } }