private void btnEditProductType_Click(object sender, System.EventArgs e) { ProductTypeInfo productTypeInfo = new ProductTypeInfo(); productTypeInfo.TypeId = this.typeId; productTypeInfo.TypeName = this.txtTypeName.Text; 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; } if (ProductTypeHelper.UpdateProductType(productTypeInfo)) { this.ShowMsg("修改成功", true); } }
private void btnEditProductType_Click(object sender, System.EventArgs e) { ProductTypeInfo productType = new ProductTypeInfo { TypeId = this.typeId, TypeName = this.txtTypeName.Text, Remark = this.txtRemark.Text }; System.Collections.Generic.IList <int> list = new System.Collections.Generic.List <int>(); if (CustomConfigHelper.Instance.BrandShow) { chlistBrand.Visible = false; } foreach (System.Web.UI.WebControls.ListItem item in this.chlistBrand.Items) { if (item.Selected) { list.Add(int.Parse(item.Value)); } } productType.Brands = list; if (this.ValidationProductType(productType) && ProductTypeHelper.UpdateProductType(productType)) { this.ShowMsg("修改成功", true); } }
private void btnEditProductType_Click(object sender, System.EventArgs e) { ProductTypeInfo productTypeInfo = new ProductTypeInfo(); productTypeInfo.TypeId = this.typeId; 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; } if (ProductTypeHelper.UpdateProductType(productTypeInfo)) { this.ShowMsg("修改成功", true); } }
private void btnEditProductType_Click(object sender, EventArgs e) { ProductTypeInfo productTypeInfo = new ProductTypeInfo(); productTypeInfo.TypeId = this.typeId; 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, this.typeId)) { 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) && ProductTypeHelper.UpdateProductType(productTypeInfo)) { this.ShowMsg("修改成功", true); } } }
private void btnEditProductType_Click(object sender, EventArgs e) { ProductTypeInfo productType = new ProductTypeInfo(); productType.TypeId = typeId; productType.TypeName = txtTypeName.Text; productType.Remark = txtRemark.Text; IList <int> list = new List <int>(); foreach (ListItem item in chlistBrand.Items) { if (item.Selected) { list.Add(int.Parse(item.Value)); } } productType.Brands = list; if (ValidationProductType(productType) && ProductTypeHelper.UpdateProductType(productType)) { ShowMsg("修改成功", true); } }