public void BindData() { SupplierInfo supplierById = SupplierHelper.GetSupplierById(this.supplierId); ManagerInfo managerInfo = ManagerHelper.FindManagerByStoreIdAndRoleId(this.supplierId, -2); if (supplierById == null || managerInfo == null) { base.Response.Redirect("SupplierList.aspx"); } else { this.lblManageId.Text = managerInfo.ManagerId.ToString(); Literal literal = this.lblUserName; Literal literal2 = this.lblUserName2; string text2 = literal.Text = (literal2.Text = managerInfo.UserName); TrimTextBox trimTextBox = this.txtSupplierName; Literal literal3 = this.lblSupplierName; text2 = (trimTextBox.Text = (literal3.Text = supplierById.SupplierName)); string text4 = "正常 <a href=\"javascript:void(0);\" onclick=\"updatesupperstate(2)\">冻结</a>"; if (supplierById.Status != 1) { text4 = "冻结 <a href=\"javascript:void(0);\" onclick=\"updatesupperstate(1)\">恢复</a>"; } this.lblStatus.Text = text4; this.hidOldImages.Value = supplierById.Picture; this.txtContactMan.Text = supplierById.ContactMan; this.txtTel.Text = supplierById.Tel; this.dropRegion.SetSelectedRegionId(supplierById.RegionId); this.txtAddress.Text = supplierById.Address; this.editDescription.Text = supplierById.Introduce; } }
protected void Page_Load(object sender, System.EventArgs e) { int.TryParse(base.Request.QueryString["productId"], out this.productId); int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId); if (!this.Page.IsPostBack) { System.Collections.Generic.IList<int> list = null; System.Collections.Generic.IList<int> list2 = null; System.Collections.Generic.Dictionary<int, System.Collections.Generic.IList<int>> attrs; ProductInfo productDetails = ProductHelper.GetProductDetails(this.productId, out attrs, out list, out list2); if (productDetails == null) { base.GotoResourceNotFound(); return; } if (!string.IsNullOrEmpty(base.Request.QueryString["categoryId"])) { this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryId); this.ViewState["ProductCategoryId"] = this.categoryId; this.lnkEditCategory.NavigateUrl = "Supplier_ProductSelectCategory.aspx?categoryId=" + this.categoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } else { this.litCategoryName.Text = CatalogHelper.GetFullCategory(productDetails.CategoryId); this.ViewState["ProductCategoryId"] = productDetails.CategoryId; this.lnkEditCategory.NavigateUrl = "Supplier_ProductSelectCategory.aspx?categoryId=" + productDetails.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } System.Web.UI.WebControls.HyperLink expr_146 = this.lnkEditCategory; expr_146.NavigateUrl = expr_146.NavigateUrl + "&productId=" + productDetails.ProductId.ToString(System.Globalization.CultureInfo.InvariantCulture); this.litralProductTag.SelectedValue = list2; if (list2.Count > 0) { foreach (int current in list2) { TrimTextBox expr_19E = this.txtProductTag; expr_19E.Text = expr_19E.Text + current.ToString() + ","; } this.txtProductTag.Text = this.txtProductTag.Text.Substring(0, this.txtProductTag.Text.Length - 1); } this.dropProductTypes.DataBind(); this.dropProductLines.DataBind(); this.dropBrandCategories.DataBind(); this.LoadProduct(productDetails, attrs); System.Data.DataTable dataTable = Methods.Supplier_PtGet(this.productId); if (dataTable != null && dataTable.Rows.Count > 0) { System.Data.DataRow dataRow = dataTable.Rows[0]; int num = (int)dataRow["checkstatus"]; if (num == 3) { this.btnSave.Visible = false; } } } }
protected void Page_Load(object sender, System.EventArgs e) { if (!int.TryParse(this.Page.Request.QueryString["ProductId"], out this.productId)) { base.GotoResourceNotFound(); return; } int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId); if (!this.Page.IsPostBack) { ProductInfo product = SubSiteProducthelper.GetProduct(this.productId); if (product == null) { base.GotoResourceNotFound(); return; } if (!string.IsNullOrEmpty(base.Request.QueryString["categoryId"])) { this.litCategoryName.Text = SubsiteCatalogHelper.GetFullCategory(this.categoryId); this.ViewState["ProductCategoryId"] = this.categoryId; this.lnkEditCategory.NavigateUrl = "SelectMyCategory.aspx?categoryId=" + this.categoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } else { this.litCategoryName.Text = SubsiteCatalogHelper.GetFullCategory(product.CategoryId); this.ViewState["ProductCategoryId"] = product.CategoryId; this.lnkEditCategory.NavigateUrl = "SelectMyCategory.aspx?categoryId=" + product.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } System.Web.UI.WebControls.HyperLink expr_148 = this.lnkEditCategory; expr_148.NavigateUrl = expr_148.NavigateUrl + "&productId=" + product.ProductId.ToString(System.Globalization.CultureInfo.InvariantCulture); System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>(); list = SubSiteProducthelper.GetProductTags(this.productId); this.litralProductTag.SelectedValue = list; if (list.Count > 0) { foreach (int current in list) { TrimTextBox expr_1B4 = this.txtProductTag; expr_1B4.Text = expr_1B4.Text + current.ToString() + ","; } this.txtProductTag.Text = this.txtProductTag.Text.Substring(0, this.txtProductTag.Text.Length - 1); } this.dropProductTypes.Enabled = false; this.dropProductTypes.DataBind(); this.dropProductTypes.SelectedValue = product.TypeId; this.dropProductLines.Enabled = false; this.dropProductLines.DataBind(); this.dropProductLines.SelectedValue = new int?(product.LineId); this.dropBrandCategories.Enabled = false; this.dropBrandCategories.DataBind(); this.dropBrandCategories.SelectedValue = product.BrandId; this.LoadProudct(product); } }
protected void Page_Load(object sender, System.EventArgs e) { int.TryParse(base.Request.QueryString["productId"], out this.productId); int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId); this.btnRemark.Click += new System.EventHandler(this.btnRemark_Click); if (!this.Page.IsPostBack) { System.Collections.Generic.IList <int> list = null; System.Collections.Generic.IList <int> list2 = null; System.Collections.Generic.Dictionary <int, System.Collections.Generic.IList <int> > attrs; ProductInfo productDetails = ProductHelper.GetProductDetails(this.productId, out attrs, out list, out list2); if (productDetails == null) { base.GotoResourceNotFound(); return; } if (!string.IsNullOrEmpty(base.Request.QueryString["categoryId"])) { this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryId); this.ViewState["ProductCategoryId"] = this.categoryId; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + this.categoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } else { this.litCategoryName.Text = CatalogHelper.GetFullCategory(productDetails.CategoryId); this.ViewState["ProductCategoryId"] = productDetails.CategoryId; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + productDetails.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } System.Web.UI.WebControls.HyperLink expr_15D = this.lnkEditCategory; expr_15D.NavigateUrl = expr_15D.NavigateUrl + "&productId=" + productDetails.ProductId.ToString(System.Globalization.CultureInfo.InvariantCulture); if (list != null && list.Count > 0) { this.ViewState["distributorUserIds"] = list; this.hlinkDistributor.NavigateUrl = "../distribution/ManageDistributor.aspx?LineId=" + productDetails.LineId.ToString(System.Globalization.CultureInfo.InvariantCulture); this.hlinkDistributor.Text = string.Format("{0}位分销商", list.Count); } this.litralProductTag.SelectedValue = list2; if (list2.Count > 0) { foreach (int current in list2) { TrimTextBox expr_21B = this.txtProductTag; expr_21B.Text = expr_21B.Text + current.ToString() + ","; } this.txtProductTag.Text = this.txtProductTag.Text.Substring(0, this.txtProductTag.Text.Length - 1); } this.dropProductTypes.DataBind(); this.dropProductLines.DataBind(); this.dropBrandCategories.DataBind(); this.BindMemberRanks(); this.LoadProduct(productDetails, attrs); } }
private void LoadProduct(ProductInfo product, System.Collections.Generic.Dictionary<int, System.Collections.Generic.IList<int>> attrs) { this.dropProductTypes.SelectedValue = product.TypeId; this.dropProductLines.SelectedValue = new int?(product.LineId); this.hdlineId.Value = product.LineId.ToString(); this.dropBrandCategories.SelectedValue = product.BrandId; this.txtDisplaySequence.Text = product.DisplaySequence.ToString(); this.txtProductName.Text = Globals.HtmlDecode(product.ProductName); this.txtProductCode.Text = product.ProductCode; this.txtUnit.Text = product.Unit; if (product.MarketPrice.HasValue) { this.txtMarketPrice.Text = product.MarketPrice.Value.ToString("F2"); } this.txtShortDescription.Text = product.ShortDescription; this.fckDescription.Text = product.Description; this.txtTitle.Text = product.Title; this.txtMetaDescription.Text = product.MetaDescription; this.txtMetaKeywords.Text = product.MetaKeywords; this.txtLowestSalePrice.Text = product.LowestSalePrice.ToString("F2"); this.chkPenetration.Checked = (product.PenetrationStatus == PenetrationStatus.Already); if (product.SaleStatus == ProductSaleStatus.OnSale) { this.radOnSales.Checked = true; } else { if (product.SaleStatus == ProductSaleStatus.UnSale) { this.radUnSales.Checked = true; } else { this.radInStock.Checked = true; } } this.uploader1.UploadedImageUrl = product.ImageUrl1; this.uploader2.UploadedImageUrl = product.ImageUrl2; this.uploader3.UploadedImageUrl = product.ImageUrl3; this.uploader4.UploadedImageUrl = product.ImageUrl4; this.uploader5.UploadedImageUrl = product.ImageUrl5; if (attrs != null && attrs.Count > 0) { System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); stringBuilder.Append("<xml><attributes>"); foreach (int current in attrs.Keys) { stringBuilder.Append("<item attributeId=\"").Append(current.ToString(System.Globalization.CultureInfo.InvariantCulture)).Append("\" usageMode=\"").Append(((int)ProductTypeHelper.GetAttribute(current).UsageMode).ToString()).Append("\" >"); foreach (int current2 in attrs[current]) { stringBuilder.Append("<attValue valueId=\"").Append(current2.ToString(System.Globalization.CultureInfo.InvariantCulture)).Append("\" />"); } stringBuilder.Append("</item>"); } stringBuilder.Append("</attributes></xml>"); this.txtAttributes.Text = stringBuilder.ToString(); } this.chkSkuEnabled.Checked = product.HasSKU; if (product.HasSKU) { System.Text.StringBuilder stringBuilder2 = new System.Text.StringBuilder(); stringBuilder2.Append("<xml><productSkus>"); foreach (string current3 in product.Skus.Keys) { SKUItem sKUItem = product.Skus[current3]; string text = string.Concat(new string[] { "<item skuCode=\"", sKUItem.SKU, "\" salePrice=\"", sKUItem.SalePrice.ToString("F2"), "\" costPrice=\"", (sKUItem.CostPrice > 0m) ? sKUItem.CostPrice.ToString("F2") : "", "\" purchasePrice=\"", sKUItem.PurchasePrice.ToString("F2"), "\" qty=\"", sKUItem.Stock.ToString(System.Globalization.CultureInfo.InvariantCulture), "\" alertQty=\"", sKUItem.AlertStock.ToString(System.Globalization.CultureInfo.InvariantCulture), "\" weight=\"", (sKUItem.Weight > 0m) ? sKUItem.Weight.ToString(System.Globalization.CultureInfo.InvariantCulture).Replace(".0000", ".00") : "", "\">" }); text += "<skuFields>"; foreach (int current4 in sKUItem.SkuItems.Keys) { string str = string.Concat(new string[] { "<sku attributeId=\"", current4.ToString(System.Globalization.CultureInfo.InvariantCulture), "\" valueId=\"", sKUItem.SkuItems[current4].ToString(System.Globalization.CultureInfo.InvariantCulture), "\" />" }); text += str; } text += "</skuFields>"; if (sKUItem.MemberPrices.Count > 0) { text += "<memberPrices>"; foreach (int current5 in sKUItem.MemberPrices.Keys) { text += string.Format("<memberGrande id=\"{0}\" price=\"{1}\" />", current5.ToString(System.Globalization.CultureInfo.InvariantCulture), sKUItem.MemberPrices[current5].ToString("F2")); } text += "</memberPrices>"; } if (sKUItem.DistributorPrices.Count > 0) { text += "<distributorPrices>"; foreach (int current6 in sKUItem.DistributorPrices.Keys) { text += string.Format("<distributorGrande id=\"{0}\" price=\"{1}\" />", current6.ToString(System.Globalization.CultureInfo.InvariantCulture), sKUItem.DistributorPrices[current6].ToString("F2")); } text += "</distributorPrices>"; } text += "</item>"; stringBuilder2.Append(text); } stringBuilder2.Append("</productSkus></xml>"); this.txtSkus.Text = stringBuilder2.ToString(); } SKUItem defaultSku = product.DefaultSku; this.txtSku.Text = product.SKU; this.txtSalePrice.Text = defaultSku.SalePrice.ToString("F2"); this.txtCostPrice.Text = ((defaultSku.CostPrice > 0m) ? defaultSku.CostPrice.ToString("F2") : ""); this.txtPurchasePrice.Text = defaultSku.PurchasePrice.ToString("F2"); this.txtStock.Text = defaultSku.Stock.ToString(System.Globalization.CultureInfo.InvariantCulture); this.txtAlertStock.Text = defaultSku.AlertStock.ToString(System.Globalization.CultureInfo.InvariantCulture); this.txtWeight.Text = ((defaultSku.Weight > 0m) ? defaultSku.Weight.ToString(System.Globalization.CultureInfo.InvariantCulture).Replace(".0000", ".00") : ""); if (defaultSku.MemberPrices.Count > 0) { this.txtMemberPrices.Text = "<xml><gradePrices>"; foreach (int current7 in defaultSku.MemberPrices.Keys) { TrimTextBox expr_87B = this.txtMemberPrices; expr_87B.Text += string.Format("<grande id=\"{0}\" price=\"{1}\" />", current7.ToString(System.Globalization.CultureInfo.InvariantCulture), defaultSku.MemberPrices[current7].ToString("F2")); } TrimTextBox expr_8DC = this.txtMemberPrices; expr_8DC.Text += "</gradePrices></xml>"; } if (defaultSku.DistributorPrices.Count > 0) { this.txtDistributorPrices.Text = "<xml><gradePrices>"; foreach (int current8 in defaultSku.DistributorPrices.Keys) { TrimTextBox expr_938 = this.txtDistributorPrices; expr_938.Text += string.Format("<grande id=\"{0}\" price=\"{1}\" />", current8.ToString(System.Globalization.CultureInfo.InvariantCulture), defaultSku.DistributorPrices[current8].ToString("F2")); } TrimTextBox expr_999 = this.txtDistributorPrices; expr_999.Text += "</gradePrices></xml>"; } }
private void LoadProduct(ProductInfo product, System.Collections.Generic.Dictionary <int, System.Collections.Generic.IList <int> > attrs) { this.dropProductTypes.SelectedValue = product.TypeId; this.dropBrandCategories.SelectedValue = product.BrandId; bool isSetCommission = product.IsSetCommission; if (isSetCommission) { this.cbIsSetCommission.Checked = false; this.txtFirstCommission.Enabled = true; this.txtSecondCommission.Enabled = true; this.txtThirdCommission.Enabled = true; this.txtFirstCommission.Text = product.FirstCommission.ToString("F2"); this.txtSecondCommission.Text = product.SecondCommission.ToString("F2"); this.txtThirdCommission.Text = product.ThirdCommission.ToString("F2"); } else { CategoryInfo category = CatalogHelper.GetCategory(this.categoryid); if (category != null) { this.txtFirstCommission.Text = category.FirstCommission; this.txtSecondCommission.Text = category.SecondCommission; this.txtThirdCommission.Text = category.ThirdCommission; } } this.txtDisplaySequence.Text = product.DisplaySequence.ToString(); this.txtProductName.Text = Globals.HtmlDecode(product.ProductName); this.txtProductShortName.Text = Globals.HtmlDecode(product.ProductShortName); this.txtProductCode.Text = product.ProductCode; this.txtUnit.Text = product.Unit; if (product.MarketPrice.HasValue) { this.txtMarketPrice.Text = product.MarketPrice.Value.ToString("F2"); } this.txtShortDescription.Text = product.ShortDescription; this.fckDescription.Text = product.Description; if (product.SaleStatus == ProductSaleStatus.OnSale) { this.radOnSales.Checked = true; } else if (product.SaleStatus == ProductSaleStatus.UnSale) { this.radUnSales.Checked = true; } else { this.radInStock.Checked = true; } this.ChkisfreeShipping.Checked = product.IsfreeShipping; string text = string.Concat(new string[] { product.ImageUrl1, ",", product.ImageUrl2, ",", product.ImageUrl3, ",", product.ImageUrl4, ",", product.ImageUrl5 }); this.ucFlashUpload1.Value = text.Replace(",,", ",").Replace(",,", ",").Trim(new char[] { ',' }); if (attrs != null && attrs.Count > 0) { System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); stringBuilder.Append("<xml><attributes>"); foreach (int current in attrs.Keys) { stringBuilder.Append("<item attributeId=\"").Append(current.ToString(System.Globalization.CultureInfo.InvariantCulture)).Append("\" usageMode=\"").Append(((int)ProductTypeHelper.GetAttribute(current).UsageMode).ToString()).Append("\" >"); foreach (int current2 in attrs[current]) { stringBuilder.Append("<attValue valueId=\"").Append(current2.ToString(System.Globalization.CultureInfo.InvariantCulture)).Append("\" />"); } stringBuilder.Append("</item>"); } stringBuilder.Append("</attributes></xml>"); this.txtAttributes.Text = stringBuilder.ToString(); } if (product.HasSKU && product.Skus.Keys.Count > 0) { System.Text.StringBuilder stringBuilder2 = new System.Text.StringBuilder(); stringBuilder2.Append("<xml><productSkus>"); foreach (string current3 in product.Skus.Keys) { SKUItem sKUItem = product.Skus[current3]; string text2 = string.Concat(new string[] { "<item skuCode=\"", sKUItem.SKU, "\" salePrice=\"", sKUItem.SalePrice.ToString("F2"), "\" costPrice=\"", (sKUItem.CostPrice > 0m) ? sKUItem.CostPrice.ToString("F2") : "", "\" qty=\"", sKUItem.Stock.ToString(System.Globalization.CultureInfo.InvariantCulture), "\" weight=\"", (sKUItem.Weight > 0m) ? sKUItem.Weight.ToString("F2") : "", "\">" }); text2 += "<skuFields>"; foreach (int current4 in sKUItem.SkuItems.Keys) { string str = string.Concat(new string[] { "<sku attributeId=\"", current4.ToString(System.Globalization.CultureInfo.InvariantCulture), "\" valueId=\"", sKUItem.SkuItems[current4].ToString(System.Globalization.CultureInfo.InvariantCulture), "\" />" }); text2 += str; } text2 += "</skuFields>"; if (sKUItem.MemberPrices.Count > 0) { text2 += "<memberPrices>"; foreach (int current5 in sKUItem.MemberPrices.Keys) { text2 += string.Format("<memberGrande id=\"{0}\" price=\"{1}\" />", current5.ToString(System.Globalization.CultureInfo.InvariantCulture), sKUItem.MemberPrices[current5].ToString("F2")); } text2 += "</memberPrices>"; } text2 += "</item>"; stringBuilder2.Append(text2); } stringBuilder2.Append("</productSkus></xml>"); this.txtSkus.Text = stringBuilder2.ToString(); } else { product.HasSKU = false; } SKUItem defaultSku = product.DefaultSku; this.txtSku.Text = product.SKU; this.txtSalePrice.Text = defaultSku.SalePrice.ToString("F2"); this.txtCostPrice.Text = ((defaultSku.CostPrice > 0m) ? defaultSku.CostPrice.ToString("F2") : ""); this.txtStock.Text = ProductHelper.GetProductSumStock(product.ProductId).ToString(); this.txtWeight.Text = ((defaultSku.Weight > 0m) ? defaultSku.Weight.ToString("F2") : ""); if (defaultSku.MemberPrices.Count > 0) { this.txtMemberPrices.Text = "<xml><gradePrices>"; foreach (int current6 in defaultSku.MemberPrices.Keys) { TrimTextBox expr_7F8 = this.txtMemberPrices; expr_7F8.Text += string.Format("<grande id=\"{0}\" price=\"{1}\" />", current6.ToString(System.Globalization.CultureInfo.InvariantCulture), defaultSku.MemberPrices[current6].ToString("F2")); } TrimTextBox expr_859 = this.txtMemberPrices; expr_859.Text += "</gradePrices></xml>"; } this.chkSkuEnabled.Checked = product.HasSKU; this.rbtIsSetTemplate.Checked = (product.FreightTemplateId > 0); this.txtShowSaleCounts.Text = product.ShowSaleCounts.ToString(); this.txtCubicMeter.Text = product.CubicMeter.ToString("F2"); this.txtFreightWeight.Text = product.FreightWeight.ToString("F2"); this.FreightTemplateDownList1.SelectedValue = product.FreightTemplateId; }
protected void Page_Load(object sender, System.EventArgs e) { string a = Globals.RequestFormStr("gettype"); if (a == "getcategorycommission") { base.Response.ContentType = "application/json"; string s = "{\"type\":\"0\",\"tips\":\"获取失败!\"}"; this.categoryid = Globals.RequestFormNum("categoryId"); if (this.categoryid > 0) { CategoryInfo category = CatalogHelper.GetCategory(this.categoryid); if (category != null) { s = string.Concat(new string[] { "{\"type\":\"1\",\"f\":\"", category.FirstCommission, "\",\"s\":\"", category.SecondCommission, "\",\"t\":\"", category.ThirdCommission, "\"}" }); } } base.Response.Write(s); base.Response.End(); return; } if (string.IsNullOrEmpty(this.reurl)) { this.reurl = "productonsales.aspx"; } this.thisUrl = base.Request.Url.ToString().ToLower(); bool flag = !string.IsNullOrEmpty(base.Request.QueryString["isCallback"]) && base.Request.QueryString["isCallback"] == "true"; if (flag) { base.DoCallback(); return; } this.productId = Globals.RequestQueryNum("productId"); if (this.productId == 0 && this.isnext == 1) { this.thisUrl = this.thisUrl.Replace("isnext=1", "").Replace("&&", "&"); base.Response.Redirect(this.thisUrl); base.Response.End(); } if (this.productId > 0) { string a2 = Globals.RequestFormStr("posttype"); if (a2 == "updatecontent") { base.Response.ContentType = "application/json"; string s2 = "{\"type\":\"0\",\"tips\":\"操作失败!\"}"; string content = Globals.RequestFormStr("memo"); string s3 = ProductHelper.UpdateProductContent(this.productId, content); if (Globals.ToNum(s3) > 0) { s2 = "{\"type\":\"1\",\"tips\":\"商品信息保存成功!\"}"; } base.Response.Write(s2); base.Response.End(); } } if (!this.Page.IsPostBack) { this.FreightTemplateDownList1.DataBind(); System.Collections.Generic.IList <int> list = null; if (this.productId > 0) { System.Collections.Generic.Dictionary <int, System.Collections.Generic.IList <int> > attrs; ProductInfo productDetails = ProductHelper.GetProductDetails(this.productId, out attrs, out list); if (productDetails == null) { base.GotoResourceNotFound(); return; } if (this.categoryid > 0) { this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryid); this.ViewState["ProductCategoryId"] = this.categoryid; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + this.categoryid.ToString(System.Globalization.CultureInfo.InvariantCulture) + "&reurl=" + base.Server.UrlEncode(this.reurl); } else { this.litCategoryName.Text = CatalogHelper.GetFullCategory(productDetails.CategoryId); this.categoryid = productDetails.CategoryId; this.ViewState["ProductCategoryId"] = productDetails.CategoryId; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + productDetails.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } System.Web.UI.WebControls.HyperLink expr_351 = this.lnkEditCategory; string navigateUrl = expr_351.NavigateUrl; expr_351.NavigateUrl = string.Concat(new string[] { navigateUrl, "&productId=", productDetails.ProductId.ToString(System.Globalization.CultureInfo.InvariantCulture), "&reurl=", base.Server.UrlEncode(this.reurl) }); this.litralProductTag.SelectedValue = list; if (list.Count > 0) { foreach (int current in list) { TrimTextBox expr_3E4 = this.txtProductTag; expr_3E4.Text = expr_3E4.Text + current.ToString() + ","; } this.txtProductTag.Text = this.txtProductTag.Text.Substring(0, this.txtProductTag.Text.Length - 1); } this.dropProductTypes.DataBind(); this.dropBrandCategories.DataBind(); this.LoadProduct(productDetails, attrs); return; } else if (this.categoryid > 0) { this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryid); this.ViewState["ProductCategoryId"] = this.categoryid; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + this.categoryid.ToString(System.Globalization.CultureInfo.InvariantCulture); this.dropProductTypes.DataBind(); this.dropBrandCategories.DataBind(); CategoryInfo category2 = CatalogHelper.GetCategory(this.categoryid); if (category2 != null) { this.txtFirstCommission.Text = category2.FirstCommission; this.txtSecondCommission.Text = category2.SecondCommission; this.txtThirdCommission.Text = category2.ThirdCommission; this.txtSku.Text = category2.SKUPrefix; this.txtProductCode.Text = category2.SKUPrefix; return; } } else { base.Response.Redirect("selectcategory.aspx"); base.Response.End(); } } }
public void BindData() { StoresInfo storeById = StoresHelper.GetStoreById(this.storeId); ManagerInfo managerInfo = ManagerHelper.FindManagerByStoreId(this.storeId, SystemRoles.StoreAdmin); if (storeById == null) { base.Response.Redirect("StoresList.aspx"); } else { string empty = string.Empty; string empty2 = string.Empty; if (!string.IsNullOrEmpty(storeById.WXCategoryName)) { empty = storeById.WXCategoryName.Split(',')[0]; empty2 = storeById.WXCategoryName.Split(',')[1]; } this.editDescription.Text = storeById.Introduce; HiddenField hiddenField = this.hidOldRegion; int num = storeById.RegionId; hiddenField.Value = num.ToString(); IEnumerable <string> values = RegionHelper.GetFullRegion(storeById.RegionId, ",", true, 0).Split(',').Take(3); this.hfProvinceCityArea.Value = string.Join(",", values); HiddenField hiddenField2 = this.hidOldAddress; TrimTextBox trimTextBox = this.txtAddress; string text3 = hiddenField2.Value = (trimTextBox.Text = string.Join(string.Empty, values) + storeById.Address); this.txtContactMan.Text = storeById.ContactMan; IList <DeliveryScopeInfo> storeDeliveryScop = StoresHelper.GetStoreDeliveryScop(storeById.StoreId); string text4 = ""; string text5 = ""; this.chkOfflinePay.Checked = storeById.IsOfflinePay; this.chkOnlinePay.Checked = storeById.IsOnlinePay; this.chkCashOnDelivery.Checked = storeById.IsCashOnDelivery; foreach (DeliveryScopeInfo item in storeDeliveryScop) { text4 = text4 + item.RegionId + ","; text5 = text5 + item.RegionName + ","; } text4 = text4.TrimEnd(','); text5 = text5.TrimEnd(','); this.txtRegionScop.Value = text4; this.txtRegionScopName.Value = text5; this.txtStoresName.Text = storeById.StoreName; this.txtTel.Text = storeById.Tel; this.labStoreUserName.Text = managerInfo.UserName; this.dropRegion.SetSelectedRegionId(storeById.RegionId); this.hidOldImages.Value = storeById.StoreImages; HiddenField hiddenField3 = this.hidOldLatitude; HiddenField hiddenField4 = this.hfLatitude; double? nullable = storeById.Latitude; object text6; double value; if (!nullable.HasValue) { text6 = string.Empty; } else { nullable = storeById.Latitude; value = nullable.Value; text6 = value.ToString(); } text3 = (string)text6; hiddenField4.Value = (string)text6; hiddenField3.Value = text3; HiddenField hiddenField5 = this.hidOldLongitude; HiddenField hiddenField6 = this.hfLongitude; nullable = storeById.Longitude; object text7; if (!nullable.HasValue) { text7 = string.Empty; } else { nullable = storeById.Longitude; value = nullable.Value; text7 = value.ToString(); } text3 = (string)text7; hiddenField6.Value = (string)text7; hiddenField5.Value = text3; if (!string.IsNullOrEmpty(storeById.StoreOpenTime)) { string[] array = storeById.StoreOpenTime.Split('-'); string[] array2 = array[0].Split(':'); this.txtStoreOpenTimeStartH.Text = array2[0]; this.txtStoreOpenTimeStartM.Text = ((array2.Length > 1) ? array2[1] : ""); if (array.Length > 1) { string[] array3 = array[1].Split(':'); this.txtStoreOpenTimeEndH.Text = array3[0]; this.txtStoreOpenTimeEndM.Text = ((array3.Length > 1) ? array3[1] : ""); } } this.chkIsAboveSelf.Checked = storeById.IsAboveSelf; this.chkIsSupportExpress.Checked = storeById.IsSupportExpress; this.chkIsStoreDelive.Checked = storeById.IsStoreDelive; TrimTextBox trimTextBox2 = this.txtServeRadius; nullable = storeById.ServeRadius; trimTextBox2.Text = nullable.ToString(); TrimTextBox trimTextBox3 = this.txtMinOrderPrice; object text8; if (storeById.MinOrderPrice.HasValue) { num = storeById.MinOrderPrice.ToInt(0); text8 = num.ToString(); } else { text8 = ""; } trimTextBox3.Text = (string)text8; TrimTextBox trimTextBox4 = this.txtStoreFreight; object text9; if (storeById.StoreFreight.HasValue) { num = storeById.StoreFreight.ToInt(0); text9 = num.ToString(); } else { text9 = ""; } trimTextBox4.Text = (string)text9; this.txtCommissionRate.Text = storeById.CommissionRate.ToString(); IList <int> storeTags = StoresHelper.GetStoreTags(this.storeId); this.litralStoreTag.SelectedValue = storeTags; if (storeTags != null && storeTags.Count > 0) { foreach (int item2 in storeTags) { TrimTextBox trimTextBox5 = this.txtStoreTag; trimTextBox5.Text = trimTextBox5.Text + item2.ToString() + ","; } this.txtStoreTag.Text = this.txtStoreTag.Text.Substring(0, this.txtStoreTag.Text.Length - 1); } } }
private void BindStoreData() { StoresInfo storeById = StoresHelper.GetStoreById(this.storeId); if (storeById == null) { base.Response.Redirect("StoresList.aspx"); } else { IEnumerable <string> values = RegionHelper.GetFullRegion(storeById.RegionId, ",", true, 0).Split(',').Take(3); this.hfProvinceCityArea.Value = string.Join(",", values); this.txtWxAddress.Text = string.Join(string.Empty, values) + storeById.Address; this.hidUploadImages.Value = (string.IsNullOrEmpty(storeById.StoreImages) ? string.Empty : storeById.StoreImages); HiddenField hiddenField = this.hfLatitude; object value; double value2; if (!storeById.Latitude.HasValue) { value = string.Empty; } else { value2 = storeById.Latitude.Value; value = value2.ToString(); } hiddenField.Value = (string)value; HiddenField hiddenField2 = this.hfLongitude; object value3; if (!storeById.Longitude.HasValue) { value3 = string.Empty; } else { value2 = storeById.Longitude.Value; value3 = value2.ToString(); } hiddenField2.Value = (string)value3; TrimTextBox trimTextBox = this.txtWXAvgPrice; int? wXAvgPrice = storeById.WXAvgPrice; object text; if (!wXAvgPrice.HasValue) { text = string.Empty; } else { wXAvgPrice = storeById.WXAvgPrice; text = wXAvgPrice.ToString(); } trimTextBox.Text = (string)text; this.txtWXIntroduction.Text = (string.IsNullOrEmpty(storeById.WXIntroduction) ? string.Empty : storeById.WXIntroduction); this.txtWXOpenTime.Text = (string.IsNullOrEmpty(storeById.WXOpenTime) ? string.Empty : storeById.WXOpenTime); this.txtWXRecommend.Text = (string.IsNullOrEmpty(storeById.WXRecommend) ? string.Empty : storeById.WXRecommend); this.txtWXSpecial.Text = (string.IsNullOrEmpty(storeById.WXSpecial) ? string.Empty : storeById.WXSpecial); this.txtWXTelephone.Text = (string.IsNullOrEmpty(storeById.WXTelephone) ? storeById.Tel : storeById.WXTelephone); string text2 = string.IsNullOrEmpty(storeById.WXCategoryName) ? string.Empty : storeById.WXCategoryName; if (!string.IsNullOrEmpty(text2)) { string selectedValue = text2.Split(',')[0]; string selectedValue2 = text2.Split(',')[1]; this.ddlCategoryParent.SelectedValue = selectedValue; this.BindCategoryChild(); this.ddlCategoryChild.SelectedValue = selectedValue2; } } }
private void LoadProduct(ProductInfo product, System.Collections.Generic.Dictionary <int, System.Collections.Generic.IList <int> > attrs) { this.dropProductTypes.SelectedValue = product.TypeId; this.dropTaxRate.SelectedValue = product.TaxRateId; this.ddlSupplier.SelectedValue = product.SupplierId; this.ddlShipping.SelectedValue = product.TemplateId; this.dropBrandCategories.SelectedValue = product.BrandId; this.ddlImportSourceType.SelectedValue = product.ImportSourceId; this.txtDisplaySequence.Text = product.DisplaySequence.ToString(); this.txtProductName.Text = Globals.HtmlDecode(product.ProductName); this.txtEnglishName.Text = product.EnglishName; this.txtProductTitle.Text = product.ProductTitle; this.txtsysProductName.Text = product.SysProductName; this.txtProductCode.Text = product.ProductCode.Replace(product.CategoryId.ToString(), this.categoryId.ToString()); this.txtAdminFraction.Text = product.AdminFraction.ToString(); this.txtFraction.Text = product.Fraction.ToString(); this.ddlUnit.SelectedValue = product.UnitCode; this.txtManufacturer.Text = product.Manufacturer; this.txtItemNo.Text = product.ItemNo; this.txtBarCode.Text = product.BarCode; this.txtConversionRelation.Text = product.ConversionRelation == 0 ? "1" : product.ConversionRelation.ToString(); this.txtIngredient.Text = product.Ingredient; this.Rd_Purchase.SelectedValue = product.Purchase.ToString(); this.txtSectionDay.Text = product.SectionDay.ToString(); this.txtMaxCount.Text = product.PurchaseMaxNum.ToString(); this.hid_Checked.Value = product.Purchase.ToString(); // 销售类型 if (product.SaleType > 0) { this.dropSaleType.Text = product.SaleType.ToString(); } this.dropSaleType.Enabled = false; if (!string.IsNullOrEmpty(product.ProductStandard)) { this.txtProductStandard.Text = product.ProductStandard; } if (product.MarketPrice.HasValue) { this.txtMarketPrice.Text = product.MarketPrice.Value.ToString("F2"); } if (product.ReferralDeduct.HasValue) { this.txtReferralDeduct.Text = product.ReferralDeduct.Value.ToString("F2"); } if (product.SubMemberDeduct.HasValue) { this.txtSubMemberDeduct.Text = product.SubMemberDeduct.Value.ToString("F2"); } if (product.SubReferralDeduct.HasValue) { this.txtSubReferralDeduct.Text = product.SubReferralDeduct.Value.ToString("F2"); } this.txtShortDescription.Text = product.ShortDescription; this.ChkisfreeShipping.Checked = product.IsfreeShipping; this.ChkisCustomsClearance.Checked = product.IsCustomsClearance; this.ChkisPromotion.Checked = product.IsPromotion; this.ChkisDisplayDiscount.Checked = product.IsDisplayDiscount; this.fckDescription.Text = product.Description; this.fckmobbileDescription.Text = product.MobblieDescription; this.txtTitle.Text = product.Title; this.txtMetaDescription.Text = product.MetaDescription; this.txtMetaKeywords.Text = product.MetaKeywords; this.txtBuyCardinality.Text = product.BuyCardinality > 0 ? product.BuyCardinality.ToString() : "1"; if (product.SaleStatus == ProductSaleStatus.OnSale) { this.radOnSales.Checked = true; } else { if (product.SaleStatus == ProductSaleStatus.UnSale) { this.radUnSales.Checked = true; } else { this.radInStock.Checked = true; } } this.uploader1.UploadedImageUrl = product.ImageUrl1; this.uploader2.UploadedImageUrl = product.ImageUrl2; this.uploader3.UploadedImageUrl = product.ImageUrl3; this.uploader4.UploadedImageUrl = product.ImageUrl4; this.uploader5.UploadedImageUrl = product.ImageUrl5; if (attrs != null && attrs.Count > 0) { System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); stringBuilder.Append("<xml><attributes>"); foreach (int current in attrs.Keys) { stringBuilder.Append("<item attributeId=\"").Append(current.ToString(System.Globalization.CultureInfo.InvariantCulture)).Append("\" usageMode=\"").Append(((int)ProductTypeHelper.GetAttribute(current).UsageMode).ToString()).Append("\" >"); foreach (int current2 in attrs[current]) { stringBuilder.Append("<attValue valueId=\"").Append(current2.ToString(System.Globalization.CultureInfo.InvariantCulture)).Append("\" />"); } stringBuilder.Append("</item>"); } stringBuilder.Append("</attributes></xml>"); this.txtAttributes.Text = stringBuilder.ToString(); } this.chkSkuEnabled.Checked = product.HasSKU; if (product.HasSKU) { System.Text.StringBuilder stringBuilder2 = new System.Text.StringBuilder(); stringBuilder2.Append("<xml><productSkus>"); DataTable dt = CreateTable(); foreach (string current3 in product.Skus.Keys) { SKUItem sKUItem = product.Skus[current3]; string text = string.Concat(new string[] { "<item skuCode=\"", sKUItem.SKU, "\" salePrice=\"", sKUItem.SalePrice.ToString("F2"), "\" costPrice=\"", (sKUItem.CostPrice > 0m) ? sKUItem.CostPrice.ToString("F2") : "", "\" qty=\"", sKUItem.Stock.ToString(System.Globalization.CultureInfo.InvariantCulture), "\" factQty=\"", sKUItem.FactStock.ToString(System.Globalization.CultureInfo.InvariantCulture), "\" weight=\"", (sKUItem.Weight > 0m) ? sKUItem.Weight.ToString("F2") : "", "\" deductFee=\"", (sKUItem.DeductFee > 0m) ? sKUItem.DeductFee.ToString("F2") : "", "\" grossweight=\"", (sKUItem.GrossWeight > 0m) ? sKUItem.GrossWeight.ToString("F2") : "", "\">" }); text += "<skuFields>"; //add by wangjun 2015年12月30日18:04:56 加备案编号隐藏记录 DataRow dr = dt.NewRow(); dr["SKU"] = sKUItem.SKU; dr["ProductRegistrationNumber"] = sKUItem.ProductRegistrationNumber; dr["LJNo"] = sKUItem.LJNo; //添加WMS隐藏记录 dr["WMSStock"] = sKUItem.WMSStock; dr["GrossWeight"] = sKUItem.GrossWeight; dr["Weight"] = sKUItem.Weight; dt.Rows.Add(dr); foreach (int current4 in sKUItem.SkuItems.Keys) { string str = string.Concat(new string[] { "<sku attributeId=\"", current4.ToString(System.Globalization.CultureInfo.InvariantCulture), "\" valueId=\"", sKUItem.SkuItems[current4].ToString(System.Globalization.CultureInfo.InvariantCulture), "\" />" }); text += str; } text += "</skuFields>"; if (sKUItem.MemberPrices.Count > 0) { text += "<memberPrices>"; foreach (int current5 in sKUItem.MemberPrices.Keys) { text += string.Format("<memberGrande id=\"{0}\" price=\"{1}\" />", current5.ToString(System.Globalization.CultureInfo.InvariantCulture), sKUItem.MemberPrices[current5].ToString("F2")); } text += "</memberPrices>"; } text += "</item>"; stringBuilder2.Append(text); } ArrhidProductRegistrationNumber.Value = Newtonsoft.Json.JsonConvert.SerializeObject(dt); stringBuilder2.Append("</productSkus></xml>"); this.txtSkus.Text = stringBuilder2.ToString(); } SKUItem defaultSku = product.DefaultSku; this.txtSku.Text = product.SKU; this.txtSalePrice.Text = ((defaultSku != null && defaultSku.SalePrice > 0m) ? defaultSku.SalePrice.ToString("F2") : ""); this.txtCostPrice.Text = ((defaultSku != null && defaultSku.CostPrice > 0m) ? defaultSku.CostPrice.ToString("F2") : ""); this.txtDeductFee.Text = ((defaultSku != null && defaultSku.DeductFee > 0m) ? defaultSku.DeductFee.ToString("F2") : "0"); this.txtStock.Text = defaultSku != null?defaultSku.Stock.ToString(System.Globalization.CultureInfo.InvariantCulture) : ""; this.txtFactStock.Text = defaultSku != null?defaultSku.FactStock.ToString(System.Globalization.CultureInfo.InvariantCulture) : ""; this.txtWeight.Text = ((defaultSku != null && defaultSku.Weight > 0m) ? defaultSku.Weight.ToString("F2") : ""); this.txtGrossWeight.Text = ((defaultSku != null && defaultSku.GrossWeight > 0m) ? defaultSku.GrossWeight.ToString("F2") : ""); this.hidProductRegistrationNumber.Value = defaultSku.ProductRegistrationNumber; this.hidLJNo.Value = defaultSku.LJNo; if (defaultSku != null && defaultSku.MemberPrices.Count > 0) { this.txtMemberPrices.Text = "<xml><gradePrices>"; foreach (int current6 in defaultSku.MemberPrices.Keys) { TrimTextBox expr_78C = this.txtMemberPrices; expr_78C.Text += string.Format("<grande id=\"{0}\" price=\"{1}\" />", current6.ToString(System.Globalization.CultureInfo.InvariantCulture), defaultSku.MemberPrices[current6].ToString("F2")); } TrimTextBox expr_7ED = this.txtMemberPrices; expr_7ED.Text += "</gradePrices></xml>"; } }
protected void Page_Load(object sender, System.EventArgs e) { int.TryParse(base.Request.QueryString["productId"], out this.productId); int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId); string text = (base.Request.UrlReferrer == null) ? "" : base.Request.UrlReferrer.PathAndQuery.ToString(); if (!this.Page.IsPostBack || text.ToLower().IndexOf("selectcategory.aspx") > -1) { System.Collections.Generic.IList <int> list = null; System.Collections.Generic.Dictionary <int, System.Collections.Generic.IList <int> > attrs; ProductInfo productDetails = ProductHelper.GetProductDetails(this.productId, out attrs, out list); if (productDetails == null) { base.GotoResourceNotFound(); return; } if (!string.IsNullOrEmpty(base.Request.QueryString["categoryId"])) { this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryId); this.ViewState["ProductCategoryId"] = this.categoryId; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + this.categoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } else { this.litCategoryName.Text = CatalogHelper.GetFullCategory(productDetails.CategoryId); this.ViewState["ProductCategoryId"] = productDetails.CategoryId; this.categoryId = productDetails.CategoryId; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + productDetails.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } System.Web.UI.WebControls.HyperLink expr_185 = this.lnkEditCategory; expr_185.NavigateUrl = expr_185.NavigateUrl + "&productId=" + productDetails.ProductId.ToString(System.Globalization.CultureInfo.InvariantCulture); this.litralProductTag.SelectedValue = list; if (list.Count > 0) { foreach (int current in list) { TrimTextBox expr_1DC = this.txtProductTag; expr_1DC.Text = expr_1DC.Text + current.ToString() + ","; } this.txtProductTag.Text = this.txtProductTag.Text.Substring(0, this.txtProductTag.Text.Length - 1); } this.dropProductTypes.DataBind(); this.dropBrandCategories.DataBind(); //if (categoryId > 0) //{ // this.dropTaxRate.DataBind(categoryId); //} //else //{ this.dropTaxRate.DataBind(); //} this.ddlSupplier.DataBind(); this.ddlShipping.DataBind(); ddlImportSourceType.DataBind(); this.ddlUnit.DataBind(); this.LoadProduct(productDetails, attrs); SiteSettings siteSettings = HiContext.Current.SiteSettings; this.litReferralDeduct.Text = "(全站统一比例:" + siteSettings.ReferralDeduct.ToString("F2") + " %)"; this.litSubMemberDeduct.Text = "(全站统一比例:" + siteSettings.SubMemberDeduct.ToString("F2") + " %)"; this.litSubReferralDeduct.Text = "(全站统一比例:" + siteSettings.SubReferralDeduct.ToString("F2") + " %)"; BindCombinationData(); } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(base.Request.QueryString["isCallback"]) && base.Request.QueryString["isCallback"] == "true") { base.DoCallback(); } else if (!int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId)) { base.GotoResourceNotFound(); } else { string text = (base.Request.UrlReferrer == (Uri)null) ? "" : base.Request.UrlReferrer.PathAndQuery.ToString(); this.ofEnableDeduct.Parameter.Add("onSwitchChange", "fuenableDeduct"); SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (masterSettings.OpenReferral == 1) { this.hidOpenMultReferral.Value = (masterSettings.OpenMultReferral ? "1" : "0"); this.hidOpenSecondReferral.Value = (masterSettings.IsOpenSecondLevelCommission ? "1" : "0"); this.hidOpenThirdReferral.Value = (masterSettings.IsOpenThirdLevelCommission ? "1" : "0"); } else { this.hidOpenMultReferral.Value = "0"; this.hidOpenSecondReferral.Value = "0"; this.hidOpenThirdReferral.Value = "0"; } this.ReferralConfig.Visible = (masterSettings.OpenReferral == 1 && true); if (this.ReferralConfig.Visible) { this.ofEnableDeduct.SelectedValue = true; } if (!this.Page.IsPostBack || text.ToLower().IndexOf("selectcategory.aspx") > -1) { this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryId); CategoryInfo category = CatalogHelper.GetCategory(this.categoryId); if (category == null) { base.GotoResourceNotFound(); } else { if (!string.IsNullOrEmpty(this.litralProductTag.Text)) { this.l_tags.Visible = true; } this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + this.categoryId.ToString(CultureInfo.InvariantCulture); this.dropProductTypes.DataBind(); this.dropProductTypes.SelectedValue = category.AssociatedProductType; this.ShippingTemplatesDropDownList.DataBind(); this.dropBrandCategories.DataBind(); int num = 5; if (string.IsNullOrEmpty(category.SKUPrefix)) { num = 8; } TrimTextBox trimTextBox = this.txtProductCode; TrimTextBox trimTextBox2 = this.txtSku; string sKUPrefix = category.SKUPrefix; int num2 = new Random().Next(1, Math.Pow(10.0, (double)num).ToInt(0) - 1); string text4 = trimTextBox.Text = (trimTextBox2.Text = sKUPrefix + num2.ToString(CultureInfo.InvariantCulture).PadLeft(num, '0')); SiteSettings siteSettings = HiContext.Current.SiteSettings; AttributeCollection attributes = this.txtSubMemberDeduct.Attributes; decimal num3 = siteSettings.SubMemberDeduct; attributes.Add("placeholder", "全站统一比例:" + num3.ToString() + " %"); AttributeCollection attributes2 = this.txtSecondLevelDeduct.Attributes; num3 = siteSettings.SecondLevelDeduct; attributes2.Add("placeholder", "全站统一比例:" + num3.ToString() + " %"); AttributeCollection attributes3 = this.txtThreeLevelDeduct.Attributes; num3 = siteSettings.ThreeLevelDeduct; attributes3.Add("placeholder", "全站统一比例:" + num3.ToString() + " %"); this.liIsCrossborder.Visible = siteSettings.IsOpenCertification; } } } }
protected void Page_Load(object sender, System.EventArgs e)//加载事件 { string a = Globals.RequestFormStr("gettype"); if (a == "getcategorycommission") { base.Response.ContentType = "application/json"; string s = "{\"type\":\"0\",\"tips\":\"获取失败!\"}"; this.categoryid = Globals.RequestFormNum("categoryId"); if (this.categoryid > 0) { CategoryInfo category = CatalogHelper.GetCategory(this.categoryid); if (category != null) { s = string.Concat(new string[] { "{\"type\":\"1\",\"f\":\"", category.FirstCommission, "\",\"s\":\"", category.SecondCommission, "\",\"t\":\"", category.ThirdCommission, "\"}" }); } } base.Response.Write(s); base.Response.End(); return; } if (string.IsNullOrEmpty(this.reurl)) { this.reurl = "productonsales.aspx"; } this.thisUrl = base.Request.Url.ToString().ToLower(); bool flag = !string.IsNullOrEmpty(base.Request.QueryString["isCallback"]) && base.Request.QueryString["isCallback"] == "true"; if (flag) { base.DoCallback(); return; } this.productId = Globals.RequestQueryNum("productId"); if (this.productId == 0 && this.isnext == 1) { this.thisUrl = this.thisUrl.Replace("isnext=1", "").Replace("&&", "&"); base.Response.Redirect(this.thisUrl); base.Response.End(); } if (this.productId > 0) { this.operatorName = "修改"; string a2 = Globals.RequestFormStr("posttype"); if (a2 == "updatecontent") { base.Response.ContentType = "application/json"; string s2 = "{\"type\":\"0\",\"tips\":\"操作失败!\"}"; string content = Globals.RequestFormStr("memo"); string s3 = ProductHelper.UpdateProductContent(this.productId, content); if (Globals.ToNum(s3) > 0) { s2 = "{\"type\":\"1\",\"tips\":\"商品信息保存成功!\"}"; } base.Response.Write(s2); base.Response.End(); } } if (!this.Page.IsPostBack) { this.FreightTemplateDownList1.DataBind(); System.Collections.Generic.IList <int> list = null; if (this.productId > 0) { System.Collections.Generic.Dictionary <int, System.Collections.Generic.IList <int> > attrs; ProductInfo productDetails = ProductHelper.GetProductDetails(this.productId, out attrs, out list); //查询商品详情 int integrals = 0; string integralToNow = ""; int integralCeiling = 0; string ZeroBuy = ""; int LeaseGood = 0; //送积分,积分兑换,积分兑换上限,零元购,租赁 #region 根据商品编号查询商品积分,积分是否抵现,积分兑换上限 SqlDataReader read = null; try { string sql = "select [integral],[IntegralToNow],[IntegralCeiling],[ZeroBuy],[LeaseGood] from [dbo].[Hishop_Products] where [ProductId]=@ProductId"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@ProductId", this.productId) }; read = help.ExecuteReader(sql, CommandType.Text, param); while (read.Read()) { if (!string.IsNullOrEmpty(read["integral"].ToString())) { integrals = Convert.ToInt32(read["integral"]); } if (!string.IsNullOrEmpty(read["IntegralToNow"].ToString())) { integralToNow = read["IntegralToNow"].ToString(); } if (!string.IsNullOrEmpty(read["IntegralCeiling"].ToString())) { integralCeiling = Convert.ToInt32(read["IntegralCeiling"]); } if (!string.IsNullOrEmpty(read["ZeroBuy"].ToString())) { ZeroBuy = read["ZeroBuy"].ToString(); } if (!string.IsNullOrEmpty(read["LeaseGood"].ToString())) { LeaseGood = (int)read["LeaseGood"]; } } } catch (Exception) { return; throw; } finally { read.Close(); help.CloseConnection(); } #endregion productDetails.integral = integrals.ToString();//积分赋值 if (ZeroBuy != "") { productDetails.ZeroBuy = Convert.ToInt32(ZeroBuy);//零元购 } else { productDetails.ZeroBuy = 0;//零元购 } if (integralToNow != "") { productDetails.IntegralToNow = Convert.ToInt32(integralToNow);//积分是否兑换 } else { productDetails.IntegralToNow = 0;//积分是否兑换 } if (integralCeiling == 0) { productDetails.IntegralCeiling = "";//积分兑换上限 } else { productDetails.IntegralCeiling = integralCeiling.ToString(); //积分兑换上限 } if (LeaseGood == 1) //租赁商品 { productDetails.LeaseGood = 1; } else { productDetails.LeaseGood = 0; } if (productDetails == null) { base.GotoResourceNotFound(); return; } if (this.categoryid > 0) { this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryid); this.ViewState["ProductCategoryId"] = this.categoryid; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + this.categoryid.ToString(System.Globalization.CultureInfo.InvariantCulture) + "&reurl=" + base.Server.UrlEncode(this.reurl); } else { this.litCategoryName.Text = CatalogHelper.GetFullCategory(productDetails.CategoryId); this.categoryid = productDetails.CategoryId; this.ViewState["ProductCategoryId"] = productDetails.CategoryId; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + productDetails.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } System.Web.UI.WebControls.HyperLink expr_35F = this.lnkEditCategory; string navigateUrl = expr_35F.NavigateUrl; expr_35F.NavigateUrl = string.Concat(new string[] { navigateUrl, "&productId=", productDetails.ProductId.ToString(System.Globalization.CultureInfo.InvariantCulture), "&reurl=", base.Server.UrlEncode(this.reurl) }); this.litralProductTag.SelectedValue = list; if (list.Count > 0) { foreach (int current in list) { TrimTextBox expr_3F2 = this.txtProductTag; expr_3F2.Text = expr_3F2.Text + current.ToString() + ","; } this.txtProductTag.Text = this.txtProductTag.Text.Substring(0, this.txtProductTag.Text.Length - 1); } this.dropProductTypes.DataBind(); this.dropBrandCategories.DataBind(); this.LoadProduct(productDetails, attrs);//商品详情页面赋值 return; } else if (this.categoryid > 0) { this.litCategoryName.Text = CatalogHelper.GetFullCategory(this.categoryid); this.ViewState["ProductCategoryId"] = this.categoryid; this.lnkEditCategory.NavigateUrl = "SelectCategory.aspx?categoryId=" + this.categoryid.ToString(System.Globalization.CultureInfo.InvariantCulture); this.dropProductTypes.DataBind(); this.dropBrandCategories.DataBind(); CategoryInfo category2 = CatalogHelper.GetCategory(this.categoryid); if (category2 != null) { this.txtFirstCommission.Text = category2.FirstCommission; this.txtSecondCommission.Text = category2.SecondCommission; this.txtThirdCommission.Text = category2.ThirdCommission; this.txtSku.Text = category2.SKUPrefix; this.txtProductCode.Text = category2.SKUPrefix; return; } } else { base.Response.Redirect("selectcategory.aspx"); base.Response.End(); } } }