예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            B_Admin badmin = new B_Admin();

            badmin.CheckMulitLogin();
            if (!badmin.ChkPermissions("RoleEdit"))
            {
                function.WriteErrMsg("没有权限进行此项操作");
            }
            if (!Page.IsPostBack)
            {
                ViewState["RoleID"] = Request.QueryString["RoleID"];
                //判断当前管理员是否存在
                if (B_Admin.IsExist(DataConverter.CLng(ViewState["RoleID"])))
                {
                    this.LblTitle.Text = "修改角色";
                    this.Literal1.Text = "修改角色";
                    role = B_Role.GetRoleById(DataConverter.CLng(ViewState["RoleID"]));
                    this.txbRoleName.Text = role.RoleName;
                    this.tbRoleInfo.Text  = role.Description;
                }
                else
                {
                    this.LblTitle.Text = "添加角色";
                    this.Literal1.Text = "添加角色";
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (function.isAjax())
            {
                string action = Request.Form["action"];
                string result = "";
                switch (action)
                {
                case "checkname":
                    if (B_Role.IsExit(Request.Form["name"]))
                    {
                        result = "-1";
                    }
                    else
                    {
                        result = "1";
                    }
                    break;

                default:
                    break;
                }
                Response.Write(result); Response.Flush(); Response.End();
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='UserManage.aspx'>用户管理</a></li><li> <a href='AdminManage.aspx'>管理员管理</a></li><li><a href=\"RoleManage.aspx\">角色管理</a></li><li><asp:Literal Text='添加角色'>" + Literal1_Hid.Value + "</asp:Literal></li>");
            B_Admin badmin = new B_Admin();

            if (!B_ARoleAuth.Check(ZoomLa.Model.ZLEnum.Auth.user, "RoleEdit"))
            {
                function.WriteErrMsg("没有权限进行此项操作");
            }
            if (!Page.IsPostBack)
            {
                ViewState["RoleID"] = Request.QueryString["RoleID"];

                //判断当前角色是否存在
                if (B_Role.IsExit(DataConverter.CLng(ViewState["RoleID"])))
                {
                    this.LblTitle.Text      = "修改角色";
                    this.Literal1_Hid.Value = "修改角色";
                    role = B_Role.GetRoleById(DataConverter.CLng(ViewState["RoleID"]));
                    this.txbRoleName.Text  = role.RoleName;
                    this.tbRoleInfo.Text   = role.Description;
                    EditRoleName_Hid.Value = role.RoleName;
                }
                else
                {
                    this.LblTitle.Text      = "添加角色";
                    this.Literal1_Hid.Value = "添加角色";
                }
            }
        }
예제 #3
0
 //string[] powerList = string.Empty;
 //StringBuilder sb = new StringBuilder();
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         ViewState["roleid"] = Request.QueryString["id"];
         //默认显示该角色信息
         M_RoleInfo role = B_Role.GetRoleById(DataConverter.CLng(ViewState["roleid"]));
         this.LblRoleName.Text    = role.RoleName;
         this.LblDescription.Text = role.Description;
         //填充该角色所具有的权限
         string Power   = "";
         string RoleStr = B_Role.GetPowerInfo(role.RoleID);
         for (int t = 0; t < this.CheckBoxList1.Items.Count; t++)
         {
             Power = this.CheckBoxList1.Items[t].Value;
             if (RoleStr.IndexOf(Power) >= 0)
             {
                 this.CheckBoxList1.Items[t].Selected = true;
             }
         }
         for (int y = 0; y < this.CheckBoxList2.Items.Count; y++)
         {
             Power = this.CheckBoxList2.Items[y].Value;
             if (RoleStr.IndexOf(Power) >= 0)
             {
                 this.CheckBoxList2.Items[y].Selected = true;
             }
         }
         for (int x = 0; x < this.CheckBoxList3.Items.Count; x++)
         {
             Power = this.CheckBoxList3.Items[x].Value;
             if (RoleStr.IndexOf(Power) >= 0)
             {
                 this.CheckBoxList3.Items[x].Selected = true;
             }
         }
         for (int s = 0; s < this.CheckBoxList4.Items.Count; s++)
         {
             Power = this.CheckBoxList4.Items[s].Value;
             if (RoleStr.IndexOf(Power) >= 0)
             {
                 this.CheckBoxList4.Items[s].Selected = true;
             }
         }
     }
 }
예제 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!B_ARoleAuth.Check(ZLEnum.Auth.user, "AdminEdit"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         M_AdminInfo adminMod = B_Admin.GetAdminByID(Mid);
         if (adminMod == null)
         {
             function.WriteErrMsg("指定的管理员不存在");
         }
         tbdName.Text          = adminMod.AdminName;
         txtAdminTrueName.Text = adminMod.AdminTrueName;
         tbdName.Enabled       = false;
         DefaultStart1.Text    = B_Content.GetStatusStr(adminMod.DefaultStart);
         string[] arr      = adminMod.RoleList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
         string   roleName = "";
         for (int i = 0; i < arr.Length; i++)
         {
             int        roleId = DataConverter.CLng(arr[i]);
             M_RoleInfo m_role = B_Role.GetRoleById(roleId);
             roleName += "  " + m_role.RoleName;
         }
         cblRoleList1.Text = roleName;
         //单选框设置
         if (adminMod.EnableMultiLogin)
         {
             cb1.Text    = "允许多人同时使用此帐号登录";
             cb1.Visible = true;
         }
         else
         {
             cb1.Visible = false;
         }
         if (adminMod.EnableModifyPassword)
         {
             this.cb2.Text = "允许管理员修改密码";
             cb2.Visible   = true;
         }
         else
         {
             this.cb2.Visible = false;
         }
         if (adminMod.IsLock)
         {
             this.cb3.Text = "是否锁定";
             cb3.Visible   = true;
         }
         else
         {
             this.cb3.Visible = false;
         }
         if (adminMod.PubRole == 1)
         {
             this.CheckBox1.Text = "是";
         }
         else
         {
             this.CheckBox1.Text = "否";
         }
         int roId = adminMod.NodeRole;
         if (roId == 0)
         {
             DropDownList11.Text = "管理所有节点";
         }
         else
         {
             M_RoleInfo role = B_Role.GetRoleById(roId);
             DropDownList11.Text = role.RoleName;
         }
         Call.SetBreadCrumb(Master, "<li>后台管理</li><li><a href='AdminManage.aspx'>管理员管理</a></li><li>管理员预览</li>");
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            ZoomLa.Common.function.AccessRulo();
            B_Admin badmin = new B_Admin();

            if (!Page.IsPostBack)
            {
                if (!B_ARoleAuth.Check(ZLEnum.Auth.user, "RoleMange"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                else if (string.IsNullOrEmpty(Request.QueryString["id"]))
                {
                    function.WriteErrMsg("未选择操作角色");
                }
                int RoleID = DataConverter.CLng(Request.QueryString["id"]);
                ViewState["roleid"] = Request.QueryString["id"];
                PubManageBind();
                //默认显示该角色信息
                M_RoleInfo role = B_Role.GetRoleById(DataConverter.CLng(ViewState["roleid"]));
                this.LblRoleName.Text    = role.RoleName;
                this.LblDescription.Text = role.Description;
                //填充该角色所具有的权限
                string Power   = "";
                string RoleStr = B_Role.GetPowerInfo(role.RoleID);
                for (int t = 0; t < this.CheckBoxList1.Items.Count; t++)
                {
                    Power = this.CheckBoxList1.Items[t].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.CheckBoxList1.Items[t].Selected = true;
                    }
                }
                for (int y = 0; y < this.CheckBoxList2.Items.Count; y++)
                {
                    Power = this.CheckBoxList2.Items[y].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.CheckBoxList2.Items[y].Selected = true;
                    }
                }
                for (int x = 0; x < this.CheckBoxList3.Items.Count; x++)
                {
                    Power = this.CheckBoxList3.Items[x].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.CheckBoxList3.Items[x].Selected = true;
                    }
                }
                for (int s = 0; s < this.CheckBoxList4.Items.Count; s++)
                {
                    Power = this.CheckBoxList4.Items[s].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.CheckBoxList4.Items[s].Selected = true;
                    }
                }
                for (int s = 0; s < this.CheckBoxList5.Items.Count; s++)
                {
                    Power = this.CheckBoxList5.Items[s].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.CheckBoxList5.Items[s].Selected = true;
                    }
                }
                for (int s = 0; s < this.CheckBoxList6.Items.Count; s++)
                {
                    Power = this.CheckBoxList6.Items[s].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.CheckBoxList6.Items[s].Selected = true;
                    }
                }
                for (int s = 0; s < this.CheckBoxList7.Items.Count; s++)
                {
                    Power = this.CheckBoxList7.Items[s].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.CheckBoxList7.Items[s].Selected = true;
                    }
                }
                for (int s = 0; s < this.CheckBoxList8.Items.Count; s++)
                {
                    Power = this.CheckBoxList8.Items[s].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.CheckBoxList8.Items[s].Selected = true;
                    }
                }
                for (int s = 0; s < this.CheckBoxList9.Items.Count; s++)
                {
                    Power = this.CheckBoxList9.Items[s].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.CheckBoxList9.Items[s].Selected = true;
                    }
                }
                for (int s = 0; s < this.PubManage.Items.Count; s++)
                {
                    Power = this.PubManage.Items[s].Value;
                    if (RoleStr.IndexOf(Power) >= 0)
                    {
                        this.PubManage.Items[s].Selected = true;
                    }
                }
                if (crmBll.IsExist(RoleID))
                {
                    crmModel = crmBll.GetSelect(RoleID);
                    crmAuthChk.Items[0].Selected = crmModel.AllowOption == "1" ? true : false;
                    crmAuthChk.Items[1].Selected = crmModel.AllowOptionValue == "1" ? true : false;
                    crmAuthChk.Items[2].Selected = crmModel.AllowExcel == "1" ? true : false;
                    crmAuthChk.Items[3].Selected = crmModel.AllowAddClient == "1" ? true : false;
                    crmAuthChk.Items[4].Selected = crmModel.AllCustomer == "1" ? true : false;
                    crmAuthChk.Items[5].Selected = crmModel.AssignFPMan == "1" ? true : false;
                    crmAuthChk.Items[6].Selected = crmModel.AllowFPAll == "1" ? true : false;
                    crmAuthChk.Items[7].Selected = crmModel.IsSalesMan == "1" ? true : false;
                }
            }
            Call.SetBreadCrumb(Master, "<li>后台管理</li><li><a href='AdminManage.aspx'>管理员管理</a></li><li><a href='RoleManage.aspx'>角色管理</a></li><li><a href='RoleManager.aspx?ID=<%= Request.QueryString[" + ID + "] %>'>权限管理</a></li>");
        }