コード例 #1
0
ファイル: Add.aspx.cs プロジェクト: liu4434004/EHR2
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtR_UserID.Text))
            {
                strErr += "角角所属用户ID格式错误!\\n";
            }
            if (this.txtR_RoleName.Text.Trim().Length == 0)
            {
                strErr += "角色名称不能为空!\\n";
            }
            if (this.txtR_Description.Text.Trim().Length == 0)
            {
                strErr += "角色介绍不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    R_UserID      = int.Parse(this.txtR_UserID.Text);
            string R_RoleName    = this.txtR_RoleName.Text;
            string R_Description = this.txtR_Description.Text;

            Maticsoft.Model.sys_Roles model = new Maticsoft.Model.sys_Roles();
            model.R_UserID      = R_UserID;
            model.R_RoleName    = R_RoleName;
            model.R_Description = R_Description;

            Maticsoft.BLL.sys_Roles bll = new Maticsoft.BLL.sys_Roles();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
コード例 #2
0
ファイル: Add.aspx.cs プロジェクト: hezejiang/EHR2
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(!PageValidate.IsNumber(txtR_UserID.Text))
            {
                strErr+="角角所属用户ID格式错误!\\n";
            }
            if(this.txtR_RoleName.Text.Trim().Length==0)
            {
                strErr+="角色名称不能为空!\\n";
            }
            if(this.txtR_Description.Text.Trim().Length==0)
            {
                strErr+="角色介绍不能为空!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int R_UserID=int.Parse(this.txtR_UserID.Text);
            string R_RoleName=this.txtR_RoleName.Text;
            string R_Description=this.txtR_Description.Text;

            Maticsoft.Model.sys_Roles model=new Maticsoft.Model.sys_Roles();
            model.R_UserID=R_UserID;
            model.R_RoleName=R_RoleName;
            model.R_Description=R_Description;

            Maticsoft.BLL.sys_Roles bll=new Maticsoft.BLL.sys_Roles();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx");
        }
コード例 #3
0
ファイル: Modify.aspx.cs プロジェクト: liu4434004/EHR2
 private void ShowInfo(int RoleID)
 {
     Maticsoft.BLL.sys_Roles   bll   = new Maticsoft.BLL.sys_Roles();
     Maticsoft.Model.sys_Roles model = bll.GetModel(RoleID);
     this.lblRoleID.Text        = model.RoleID.ToString();
     this.txtR_UserID.Text      = model.R_UserID.ToString();
     this.txtR_RoleName.Text    = model.R_RoleName;
     this.txtR_Description.Text = model.R_Description;
 }
コード例 #4
0
ファイル: Modify.aspx.cs プロジェクト: hezejiang/EHR2
 private void ShowInfo(int RoleID)
 {
     Maticsoft.BLL.sys_Roles bll=new Maticsoft.BLL.sys_Roles();
     Maticsoft.Model.sys_Roles model=bll.GetModel(RoleID);
     this.lblRoleID.Text=model.RoleID.ToString();
     this.txtR_UserID.Text=model.R_UserID.ToString();
     this.txtR_RoleName.Text=model.R_RoleName;
     this.txtR_Description.Text=model.R_Description;
 }
コード例 #5
0
ファイル: delete.aspx.cs プロジェクト: liu4434004/EHR2
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Maticsoft.BLL.sys_Roles bll = new Maticsoft.BLL.sys_Roles();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             int RoleID = (Convert.ToInt32(Request.Params["id"]));
             bll.Delete(RoleID);
             Response.Redirect("list.aspx");
         }
     }
 }
コード例 #6
0
ファイル: delete.aspx.cs プロジェクト: hezejiang/EHR2
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Maticsoft.BLL.sys_Roles bll=new Maticsoft.BLL.sys_Roles();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             int RoleID=(Convert.ToInt32(Request.Params["id"]));
             bll.Delete(RoleID);
             Response.Redirect("list.aspx");
         }
     }
 }