protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(this.Page.Request.QueryString["ProductId"], out this.productId)) { base.GotoResourceNotFound(); } else { int.TryParse(base.Request.QueryString["categoryId"], out this.categoryId); if (!this.Page.IsPostBack) { ProductInfo product = SubSiteProducthelper.GetProduct(this.productId); if (product == null) { base.GotoResourceNotFound(); } else { 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(CultureInfo.InvariantCulture); } else { this.litCategoryName.Text = SubsiteCatalogHelper.GetFullCategory(product.CategoryId); this.ViewState["ProductCategoryId"] = product.CategoryId; this.lnkEditCategory.NavigateUrl = "SelectMyCategory.aspx?categoryId=" + product.CategoryId.ToString(CultureInfo.InvariantCulture); } this.lnkEditCategory.NavigateUrl = this.lnkEditCategory.NavigateUrl + "&productId=" + product.ProductId.ToString(CultureInfo.InvariantCulture); IList <int> productTags = new List <int>(); productTags = SubSiteProducthelper.GetProductTags(this.productId); this.litralProductTag.SelectedValue = productTags; if (productTags.Count > 0) { foreach (int num in productTags) { this.txtProductTag.Text = this.txtProductTag.Text + num.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) { 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); } }
/// <summary> /// 页面加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(Page.Request.QueryString["ProductId"], out productId)) { base.GotoResourceNotFound(); } else { int.TryParse(base.Request.QueryString["categoryId"], out categoryId); if (!Page.IsPostBack) { ProductInfo product = SubSiteProducthelper.GetProduct(productId); if (product == null) { base.GotoResourceNotFound(); } else { if (!string.IsNullOrEmpty(base.Request.QueryString["categoryId"])) { litCategoryName.Text = SubsiteCatalogHelper.GetFullCategory(categoryId); ViewState["ProductCategoryId"] = categoryId; lnkEditCategory.NavigateUrl = "SelectMyCategory.aspx?categoryId=" + categoryId.ToString(CultureInfo.InvariantCulture); } else { litCategoryName.Text = SubsiteCatalogHelper.GetFullCategory(product.CategoryId); ViewState["ProductCategoryId"] = product.CategoryId; lnkEditCategory.NavigateUrl = "SelectMyCategory.aspx?categoryId=" + product.CategoryId.ToString(CultureInfo.InvariantCulture); } lnkEditCategory.NavigateUrl = lnkEditCategory.NavigateUrl + "&productId=" + product.ProductId.ToString(CultureInfo.InvariantCulture); dropProductTypes.Enabled = false; dropProductTypes.DataBind(); dropProductTypes.SelectedValue = product.TypeId; dropProductLines.Enabled = false; dropProductLines.DataBind(); dropProductLines.SelectedValue = new int?(product.LineId); dropBrandCategories.Enabled = false; dropBrandCategories.DataBind(); dropBrandCategories.SelectedValue = product.BrandId; LoadProudct(product); } } } }