예제 #1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtrolename.Text.Trim().Length == 0)
            {
                strErr += "rolename不能为空!\\n";
            }
            if (this.txtdescription.Text.Trim().Length == 0)
            {
                strErr += "description不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    roleid      = int.Parse(this.lblroleid.Text);
            string rolename    = this.txtrolename.Text;
            string description = this.txtdescription.Text;


            ncu.mao.Model.t_role model = new ncu.mao.Model.t_role();
            model.roleid      = roleid;
            model.rolename    = rolename;
            model.description = description;

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