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

            if (!PageValidate.IsNumber(txtRoleId.Text))
            {
                strErr += "角色ID格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtMenuId.Text))
            {
                strErr += "菜单ID格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int RoleRightId = int.Parse(this.lblRoleRightId.Text);
            int RoleId      = int.Parse(this.txtRoleId.Text);
            int MenuId      = int.Parse(this.txtMenuId.Text);


            FwjSoft.Model.RoleRight model = new FwjSoft.Model.RoleRight();
            model.RoleRightId = RoleRightId;
            model.RoleId      = RoleId;
            model.MenuId      = MenuId;

            FwjSoft.BLL.RoleRight bll = new FwjSoft.BLL.RoleRight();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Пример #2
0
 private void ShowInfo(int RoleRightId)
 {
     FwjSoft.BLL.RoleRight   bll   = new FwjSoft.BLL.RoleRight();
     FwjSoft.Model.RoleRight model = bll.GetModel(RoleRightId);
     this.lblRoleRightId.Text = model.RoleRightId.ToString();
     this.lblRoleId.Text      = model.RoleId.ToString();
     this.lblMenuId.Text      = model.MenuId.ToString();
 }