Exemple #1
0
 private void ShowInfo(int CategoryID)
 {
     Maticsoft.BLL.Category   bll   = new Maticsoft.BLL.Category();
     Maticsoft.Model.Category model = bll.GetModel(CategoryID);
     this.lblCategoryID.Text   = model.CategoryID.ToString();
     this.lblCategorytype.Text = model.Categorytype;
 }
Exemple #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtCategoryID.Text))
            {
                strErr += "CategoryID格式错误!\\n";
            }
            if (this.txtCategorytype.Text.Trim().Length == 0)
            {
                strErr += "Categorytype不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    CategoryID   = int.Parse(this.txtCategoryID.Text);
            string Categorytype = this.txtCategorytype.Text;

            Maticsoft.Model.Category model = new Maticsoft.Model.Category();
            model.CategoryID   = CategoryID;
            model.Categorytype = Categorytype;

            Maticsoft.BLL.Category bll = new Maticsoft.BLL.Category();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Exemple #3
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtCategorytype.Text.Trim().Length == 0)
            {
                strErr += "Categorytype不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    CategoryID   = int.Parse(this.lblCategoryID.Text);
            string Categorytype = this.txtCategorytype.Text;


            Maticsoft.Model.Category model = new Maticsoft.Model.Category();
            model.CategoryID   = CategoryID;
            model.Categorytype = Categorytype;

            Maticsoft.BLL.Category bll = new Maticsoft.BLL.Category();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }