private void btnAddProductType_Click(object sender, EventArgs e) { ProductTypeInfo productType = new ProductTypeInfo(); productType.TypeName = this.txtTypeName.Text.Trim(); productType.Remark = this.txtRemark.Text; IList <int> list = new List <int>(); foreach (ListItem item in this.chlistBrand.Items) { if (item.Selected) { list.Add(int.Parse(item.Value)); } } productType.Brands = list; if (this.ValidationProductType(productType)) { int num = ProductTypeHelper.AddProductType(productType); if (num > 0) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/product/AddAttribute.aspx?typeId=" + num), true); } else { this.ShowMsg("添加商品类型失败", false); } } }
private void btnAddProductType_Click(object sender, System.EventArgs e) { ProductTypeInfo productTypeInfo = new ProductTypeInfo(); productTypeInfo.TypeName = this.txtTypeName.Text.Trim(); productTypeInfo.Remark = this.txtRemark.Text; System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>(); foreach (System.Web.UI.WebControls.ListItem listItem in this.chlistBrand.Items) { if (listItem.Selected) { list.Add(int.Parse(listItem.Value)); } } productTypeInfo.Brands = list; if (!this.ValidationProductType(productTypeInfo)) { return; } int num = ProductTypeHelper.AddProductType(productTypeInfo); if (num > 0) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/goods/AddAttribute.aspx?typeId=" + num), true); return; } this.ShowMsg("添加商品类型失败", false); }
private void btnAddProductType_Click(object sender, System.EventArgs e) { ProductTypeInfo productTypeInfo = new ProductTypeInfo(); productTypeInfo.TypeName = Globals.StripHtmlXmlTags(Globals.StripScriptTags(this.txtTypeName.Text).Replace(",", ",").Replace("\\", "")); if (string.IsNullOrEmpty(productTypeInfo.TypeName)) { this.ShowMsg("类型名称不能为空,不允许包含脚本标签、HTML标签和\\,系统会自动过滤", false); return; } productTypeInfo.Remark = this.txtRemark.Text; System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>(); foreach (System.Web.UI.WebControls.ListItem listItem in this.chlistBrand.Items) { if (listItem.Selected) { list.Add(int.Parse(listItem.Value)); } } productTypeInfo.Brands = list; if (!this.ValidationProductType(productTypeInfo)) { return; } int num = ProductTypeHelper.AddProductType(productTypeInfo); if (num > 0) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/product/AddAttribute.aspx?typeId=" + num), true); return; } this.ShowMsg("添加商品类型失败", false); }
private void btnAddProductType_Click(object sender, EventArgs e) { ProductTypeInfo productTypeInfo = new ProductTypeInfo(); productTypeInfo.TypeName = Globals.StripHtmlXmlTags(Globals.StripScriptTags(this.txtTypeName.Text).Replace(",", ",").Replace("\\", "")); if (string.IsNullOrEmpty(productTypeInfo.TypeName)) { this.ShowMsg("类型名称不能为空,不允许包含脚本标签、HTML标签和\\,系统会自动过滤", false); } else if (ProductTypeHelper.HasSameProductTypeName(productTypeInfo.TypeName, 0)) { this.ShowMsg("不能有重复的类型名称", false); } else { productTypeInfo.Remark = this.txtRemark.Text; IList <int> list = new List <int>(); foreach (ListItem item in this.chlistBrand.Items) { if (item.Selected) { list.Add(int.Parse(item.Value)); } } productTypeInfo.Brands = list; if (this.ValidationProductType(productTypeInfo)) { int num = ProductTypeHelper.AddProductType(productTypeInfo); if (num > 0) { base.Response.Redirect(Globals.GetAdminAbsolutePath("/product/AddAttribute.aspx?typeId=" + num), true); } else { this.ShowMsg("添加商品类型失败", false); } } } }