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

            if (this.txtRoleName.Text.Trim().Length == 0)
            {
                strErr += "角色名称不能为空!\\n";
            }
            if (this.txtRoleDesc.Text.Trim().Length == 0)
            {
                strErr += "角色描述不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    RoleId   = int.Parse(this.lblRoleId.Text);
            string RoleName = this.txtRoleName.Text;
            string RoleDesc = this.txtRoleDesc.Text;


            FwjSoft.Model.RoleInfo model = new FwjSoft.Model.RoleInfo();
            model.RoleId   = RoleId;
            model.RoleName = RoleName;
            model.RoleDesc = RoleDesc;

            FwjSoft.BLL.RoleInfo bll = new FwjSoft.BLL.RoleInfo();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
示例#2
0
 private void ShowInfo(int RoleId)
 {
     FwjSoft.BLL.RoleInfo   bll   = new FwjSoft.BLL.RoleInfo();
     FwjSoft.Model.RoleInfo model = bll.GetModel(RoleId);
     this.lblRoleId.Text   = model.RoleId.ToString();
     this.lblRoleName.Text = model.RoleName;
     this.lblRoleDesc.Text = model.RoleDesc;
 }