Пример #1
0
 private void BindCategoryData()
 {
     DataSet list = new Maticsoft.BLL.Shop.Package.PackageCategory().GetList("");
     if (!DataSetTools.DataSetIsNull(list))
     {
         this.ddlCategory.DataSource = list;
         this.ddlCategory.DataTextField = "Name";
         this.ddlCategory.DataValueField = "CategoryId";
         this.ddlCategory.DataBind();
     }
 }
Пример #2
0
 public void BindPackageInfo()
 {
     DataSet list = new PackageCategory().GetList("");
     if (!DataSetTools.DataSetIsNull(list))
     {
         this.ddlSelectPackageCategory.DataSource = list;
         this.ddlSelectPackageCategory.DataTextField = "Name";
         this.ddlSelectPackageCategory.DataValueField = "CategoryId";
         this.ddlSelectPackageCategory.DataBind();
     }
     this.ddlSelectPackageCategory.Items.Insert(0, new ListItem("请选择类别", "0"));
 }
Пример #3
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     string str = this.txtName.Text.Trim();
     if (str.Length == 0)
     {
         MessageBox.ShowServerBusyTip(this, "包装类型的名称不能为空!");
     }
     else
     {
         string str2 = this.txtRemark.Text.Trim();
         if (str2.Length > 200)
         {
             MessageBox.ShowServerBusyTip(this, "备注不能超过200个字符!");
         }
         else
         {
             Maticsoft.Model.Shop.Package.PackageCategory model = new Maticsoft.Model.Shop.Package.PackageCategory {
                 Name = str,
                 Remark = str2
             };
             Maticsoft.BLL.Shop.Package.PackageCategory category2 = new Maticsoft.BLL.Shop.Package.PackageCategory();
             int num = category2.Add(model);
             if (num > 0)
             {
                 LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "添加包装类型(id=" + num + ")成功", this);
                 MessageBox.ShowSuccessTip(this, Site.TooltipSaveOK, "CategoryList.aspx");
                 base.Response.Redirect("CategoryList.aspx");
             }
             else
             {
                 LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "添加包装类型(id=" + num + ")失败", this);
                 MessageBox.ShowServerBusyTip(this, Site.TooltipSaveError);
             }
         }
     }
 }
Пример #4
0
 private void ShowInfo(int CategoryId)
 {
     Maticsoft.Model.Shop.Package.PackageCategory model = new Maticsoft.BLL.Shop.Package.PackageCategory().GetModel(CategoryId);
     this.txtName.Text = model.Name;
     this.txtRemark.Text = model.Remark;
 }