LeftMenuEdit.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:1k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. public partial class LeftMenuEdit : System.Web.UI.Page
  12. {
  13.     public int User_PrivID = -1;
  14.     public string Functions = "";
  15.     /// <summary>
  16.     /// 模板
  17.     /// </summary>
  18.     Model.User_Priv MUP = new Model.User_Priv();
  19.     /// <summary>
  20.     /// 业务
  21.     /// </summary>
  22.     BLL.User_Priv BUP = new BLL.User_Priv();
  23.     protected void Page_Load(object sender, EventArgs e)
  24.     {
  25.         LoginLogic.MatchLoad("", "LeftMenuEdit");
  26.         object User_PrivObj = Request.QueryString["id"];
  27.         if (User_PrivObj != null)
  28.         {
  29.             User_PrivID = int.Parse(User_PrivObj.ToString());
  30.             MUP = BUP.GetModel(User_PrivID);
  31.             if (!IsPostBack)
  32.             {
  33.                 Label_Pname.Text = MUP.PrivName;
  34.                 PrivName_TextBox.Text = MUP.LeftMenu;
  35.             }
  36.         }
  37.     }
  38.     protected void Button1_Click(object sender, EventArgs e)
  39.     {
  40.         try
  41.         {
  42.             MUP.ID = User_PrivID;
  43.             MUP.LeftMenu = PrivName_TextBox.Text;
  44.             BUP.Update(MUP);
  45.             MessageBox.Show("角色菜单修改成功!");
  46.         }
  47.         catch (Exception exp)
  48.         {
  49.             MessageBox.Show(exp.Message);
  50.         }
  51.     }
  52. }