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

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

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    id       = int.Parse(this.lblid.Text);
            string catename = this.txtcatename.Text;


            Movie.Model.cate model = new Movie.Model.cate();
            model.id       = id;
            model.catename = catename;

            Movie.BLL.cate bll = new Movie.BLL.cate();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Пример #2
0
 private void ShowInfo(int id)
 {
     Movie.BLL.cate   bll   = new Movie.BLL.cate();
     Movie.Model.cate model = bll.GetModel(id);
     this.lblid.Text       = model.id.ToString();
     this.txtcatename.Text = model.catename;
 }