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"); }
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"); }
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; }
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; }
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"); } } }
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"); } } }