Esempio n. 1
0
        private void BindRoles()
        {
            string    sysID = ConfigurationUtil.GetAppSettingValue("ThisSysID");
            DataTable db    = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetRoleInfoBySysID(sysID);

            if (db != null && db.Rows.Count > 0)
            {
                int       userid  = BLL.Util.GetLoginUserID();
                DataTable rolesDt = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetRoleInfoByUserIDAndSysID(userid, sysID);
                DataRow[] rows    = rolesDt.Select("RoleName='超级管理员'");
                if (rows.Length == 0)
                {
                    //没有超级管理员角色,就删除超级管理员的选项
                    for (int i = 0; i < db.Rows.Count; i++)
                    {
                        if (db.Rows[i]["RoleName"].ToString() == "超级管理员")
                        {
                            db.Rows.RemoveAt(i);
                            break;
                        }
                    }
                }

                Rpt_Role.DataSource = db;
                Rpt_Role.DataBind();
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string    sysID = ConfigurationUtil.GetAppSettingValue("ThisSysID");
            DataTable db    = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetRoleInfoBySysID
                                  (sysID);

            if (db != null && db.Rows.Count > 0)
            {
                int       userid  = BLL.Util.GetLoginUserID();
                DataTable rolesDt = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetRoleInfoByUserIDAndSysID(userid, sysID);
                DataRow[] rows    = rolesDt.Select("RoleName='超级管理员'");
                if (rows.Length == 0)
                {
                    //没有超级管理员角色,就删除超级管理员的选项
                    for (int i = 0; i < db.Rows.Count; i++)
                    {
                        if (db.Rows[i]["RoleName"].ToString() == "超级管理员")
                        {
                            db.Rows.RemoveAt(i);
                            break;
                        }
                    }
                }

                Rpt_Role.DataSource = db;
                Rpt_Role.DataBind();
            }

            DataTable dtGroup = BLL.BusinessGroup.Instance.GetBusinessGroupByAreaID(ArealID);

            if (dtGroup != null && dtGroup.Rows.Count > 0)
            {
                Rpt_BusinessGroup.DataSource = dtGroup.Select("Status=0").CopyToDataTable();
                Rpt_BusinessGroup.DataBind();
            }

            if (IsModfiySingle == "false")
            {
                //如果是批量修改
                this.divAgentNum.Visible = false;
                this.divData.Visible     = false;
            }
            else
            {
                BingData();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!Pwd.ToLower().Equals("3219jdhliweruy@hfkjhi@oghg"))
         {
             BitAuto.Utils.ScriptHelper.ShowAlertScript("您无此页面权限!");
             Response.End();
         }
         else
         {
             DataTable db = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetRoleInfoBySysID(ConfigurationUtil.GetAppSettingValue("ThisSysID"));
             Rpt_Role.DataSource = db;
             Rpt_Role.DataBind();
         }
     }
 }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Response.Write("----" + BLL.UserDataRigth.Instance.GetUserDataRigth(1).RightType + "--------");
            //if (BLL.UserDataRigth.Instance.GetUserDataRigth(1) == null)
            //{
            //    Response.Write("------------");
            //}
            //BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetRoleInfoByUserIDAndSysID(0, ConfigurationUtil.GetAppSettingValue("ThisSysID"));


            DataTable db = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetRoleInfoBySysID(ConfigurationUtil.GetAppSettingValue("ThisSysID"));

            Rpt_Role.DataSource = db;
            Rpt_Role.DataBind();

            AreaManageConfig config = new AreaManageConfig(HttpContext.Current.Server);

            List <string> list = config.GetCurrentUserArea();

            DataTable  tbArea  = new DataTable();
            DataColumn dcName  = new DataColumn("Name", typeof(string));
            DataColumn dcValue = new DataColumn("Value", typeof(string));

            tbArea.Columns.Add(dcName);
            tbArea.Columns.Add(dcValue);

            if (list != null && list.Count > 0)
            {
                foreach (string s in list)
                {
                    DataRow dr    = tbArea.NewRow();
                    int     value = 1;
                    if (s == "西安")
                    {
                        value = 2;
                    }
                    dr["Name"]  = s;
                    dr["Value"] = value;

                    tbArea.Rows.Add(dr);
                }
            }

            rptArea.DataSource = tbArea;
            rptArea.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable db = BitAuto.YanFa.SysRightManager.Common.UserInfo.Instance.GetRoleInfoBySysID
                               (ConfigurationUtil.GetAppSettingValue("ThisSysID"));

            if (db != null && db.Rows.Count > 0)
            {
                Rpt_Role.DataSource = db;
                Rpt_Role.DataBind();
                GroupDataBind();
            }

            if (IsModfiySingle == "false")
            {
                //如果是批量修改
                this.divAgentNum.Visible = false;
                this.divData.Visible     = false;
            }
            else
            {
                BingData();
            }
        }
 /// 绑定角色(CC和IM共有的角色)
 /// <summary>
 /// 绑定角色(CC和IM共有的角色)
 /// </summary>
 private void BindRoles()
 {
     //绑定
     Rpt_Role.DataSource = BLL.EmployeeAgent.Instance.GetCCAndIMRoles();
     Rpt_Role.DataBind();
 }