RoleEditor.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class RoleEditor : System.Web.UI.Page
- {
- public int User_PrivID = -1;
- public string Functions = "";
- /// <summary>
- /// 模板
- /// </summary>
- Model.User_Priv MUP = new Model.User_Priv();
- /// <summary>
- /// 业务
- /// </summary>
- BLL.User_Priv BUP = new BLL.User_Priv();
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("", "RoleEditor");
- object User_PrivObj=Request.QueryString["id"];
- if (User_PrivObj != null)
- {
- User_PrivID = int.Parse(User_PrivObj.ToString());
- MUP = BUP.GetModel(User_PrivID);
- if (!IsPostBack)
- {
-
- PrivNo_TextBox.Text = MUP.PrivNo.ToString();
- PrivName_TextBox.Text = MUP.PrivName;
- }
- if (!string.IsNullOrEmpty(MUP.FuncIdStr))
- {
- Functions = MUP.FuncIdStr;
- }
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- try
- {
- int testNo = 0;
- if (!int.TryParse(PrivNo_TextBox.Text, out testNo))
- {
- throw new Exception("角色序号必须为数字");
- }
- MUP.PrivNo = int.Parse(PrivNo_TextBox.Text);
- MUP.PrivName = PrivName_TextBox.Text;
- MUP.ID = User_PrivID;
- MUP.FuncIdStr = Functions;
- BUP.Update(MUP);
- MessageBox.Show("角色修改成功!");
- }
- catch (Exception exp)
- {
- MessageBox.Show(exp.Message);
- }
- }
- }