Пример #1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

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

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string newc_name = this.txtnewc_name.Text;
            int    newc_ID   = int.Parse(this.lblnewc_ID.Text);


            WalleProject.Model.t_newscategory model = new WalleProject.Model.t_newscategory();
            model.newc_name = newc_name;
            model.newc_ID   = newc_ID;

            WalleProject.BLL.t_newscategory bll = new WalleProject.BLL.t_newscategory();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Пример #2
0
 private void ShowInfo(int newc_ID)
 {
     WalleProject.BLL.t_newscategory   bll   = new WalleProject.BLL.t_newscategory();
     WalleProject.Model.t_newscategory model = bll.GetModel(newc_ID);
     this.txtnewc_name.Text = model.newc_name;
     this.lblnewc_ID.Text   = model.newc_ID.ToString();
 }
Пример #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

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

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string newc_name = this.txtnewc_name.Text;

            WalleProject.Model.t_newscategory model = new WalleProject.Model.t_newscategory();
            model.newc_name = newc_name;

            WalleProject.BLL.t_newscategory bll = new WalleProject.BLL.t_newscategory();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }