Пример #1
0
 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");
         }
     }
 }
Пример #2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(this.txtAttributeName.Text.Trim()))
     {
         MessageBox.ShowFailTip(this, "扩展属性名称不能为空,长度限制在1-15个字符之间!");
     }
     else
     {
         string text = this.txtAttributeName.Text;
         this.txtAttributeValue.Text.Trim();
         Maticsoft.Model.Shop.Products.AttributeInfo model = new Maticsoft.Model.Shop.Products.AttributeInfo {
             UsageMode = 3
         };
         if (this.rbPic.Checked)
         {
             model.UseAttributeImage = true;
         }
         else
         {
             model.UseAttributeImage = false;
         }
         List<string> list = new List<string>();
         model.ValueStr = list;
         model.AttributeName = text;
         model.TypeId = this.ProductTypeId;
         model.UserDefinedPic = this.chbDefinePic.Checked;
         if (this.bll.AttributeManage(model, DataProviderAction.Create))
         {
             if (this.Action == 0)
             {
                 MessageBox.ResponseScript(this, "parent.location.href='Step3.aspx?tid=" + this.ProductTypeId + "'");
             }
             else
             {
                 MessageBox.ResponseScript(this, string.Concat(new object[] { "parent.location.href='Modify3.aspx?tid=", this.ProductTypeId, "&ed=", this.Action, "'" }));
             }
         }
         else
         {
             this.btnSave.Enabled = false;
             MessageBox.ShowFailTip(this, "保存失败!", "Step2.aspx");
         }
     }
 }
Пример #3
0
 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");
         }
     }
 }