username@email.com
2025-05-12 ae6e40362a745caef9ead36f81f38313fb8c2c66
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Query;
using CY.Infrastructure.Common;
using CY.BLL.Sys;
 
namespace CY.WebForm.Pages.membermanage
{
    //吴辉
    //新增/编辑角色
    public partial class PermissionsRoleEdit : BasePage
    {
        Sys_Permissions_RoleBLL bll_Sys_Permissions_RoleBLL = null;
 
        //初始化
        public PermissionsRoleEdit()
        {
            bll_Sys_Permissions_RoleBLL = new Sys_Permissions_RoleBLL();
        }
 
        //加载页面
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="KeyId">角色编号</param>
        public void BindData()
        {
            if (Request["Keyid"].ToInt32() > 0)
            {
                Sys_Permissions_Role m_Sys_Permissions_Role = bll_Sys_Permissions_RoleBLL.SelectModel(Request["Keyid"].ToInt32());
                this.selIsUsed.Value = m_Sys_Permissions_Role.IsUsed.ToString2();
                this.txtRoleName.Value = m_Sys_Permissions_Role.RoleName.ToString2();
            }
        }
 
        //提交事件
        protected void btn_Submit_Config(object sender, EventArgs e)
        {
            Sys_Permissions_Role m_Sys_Permissions_Role = new Sys_Permissions_Role();
            m_Sys_Permissions_Role.Keyid = Request["Keyid"].ToInt32();
            m_Sys_Permissions_Role.RoleName = this.txtRoleName.Value;
            m_Sys_Permissions_Role.IsUsed = this.selIsUsed.Value.ToBoolean2();
            m_Sys_Permissions_Role.LastUpdateTime = DateTime.Now;
            m_Sys_Permissions_Role.Operator = CurrentUser.ShortName;
            m_Sys_Permissions_Role.Remark = "admin";
 
            if (Request["Keyid"].ToInt32() > 0)
            {
                bool result =bll_Sys_Permissions_RoleBLL.UpdateModel(m_Sys_Permissions_Role);
                if (result)
                    JavaScript.RefreshDIVOpener(this);
                else
                    JavaScript.MessageBox("操作失败", this);
            }
            else
            {
                bool result = bll_Sys_Permissions_RoleBLL.InsertModel(m_Sys_Permissions_Role);
                if (result)
                    JavaScript.MessageBox("添加成功", this,true,true);
                else
                    JavaScript.MessageBox("操作失败", this);
            }
        }
    }
}