protected void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(this.txtTypeName.Text.Trim())) { MessageBox.ShowFailTip(this, "商品类型名称不能为空,长度限制在1-50个字符之间!"); } else { string text = this.txtTypeName.Text; string str2 = this.txtRemark.Text; IList<int> list = new List<int>(); foreach (ListItem item in this.chkBrandsCheckBox.Items) { if (item.Selected) { list.Add(int.Parse(item.Value)); } } Maticsoft.Model.Shop.Products.ProductType model = new Maticsoft.Model.Shop.Products.ProductType { TypeName = text, Remark = str2, BrandsTypes = list, TypeId = this.ProductTypeId }; int typeid = 0; if (this.bll.ProductTypeManage(model, DataProviderAction.Update, out typeid)) { MessageBox.ShowSuccessTip(this, "基本设置信息保存成功!"); } else { MessageBox.ShowFailTip(this, "保存失败,正在返回商品类别列表页!", "list.aspx"); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(this.txtTypeName.Text.Trim())) { MessageBox.ShowFailTip(this, "商品类型名称不能为空,长度限制在1-50个字符之间!"); } else { string text = this.txtTypeName.Text; string str2 = this.txtRemark.Text; IList<int> list = new List<int>(); foreach (ListItem item in this.chkBrandsCheckBox.Items) { if (item.Selected) { list.Add(int.Parse(item.Value)); } } Maticsoft.Model.Shop.Products.ProductType model = new Maticsoft.Model.Shop.Products.ProductType { TypeName = text, Remark = str2, BrandsTypes = list }; int typeid = 0; if (this.bll.ProductTypeManage(model, DataProviderAction.Create, out typeid)) { this.btnCancle.Enabled = false; this.btnSave.Enabled = false; base.Response.Redirect("Step2.aspx?tid=" + typeid); } else { MessageBox.ShowFailTip(this, "保存失败!", "list.aspx"); } } }