예제 #1
0
    /// <summary>
    /// 得到所有权限
    /// </summary>
    public Dictionary <int, string> getAllPermission()
    {
        Dictionary <int, string> allDic = new Dictionary <int, string>();

        Tunnel.BLL.Tunnel_quanxian          tq     = new Tunnel.BLL.Tunnel_quanxian();
        List <Tunnel.Model.Tunnel_quanxian> tqList = new List <Tunnel.Model.Tunnel_quanxian>();

        if (ul.JiaoSe(ul.LoginID) == "系统管理员")
        {
            tqList = tq.GetModelList("1=1 order by q_rId asc ");
            foreach (Tunnel.Model.Tunnel_quanxian item in tqList)
            {
                allDic.Add(item.q_id, item.q_mark + "-->>" + item.q_name);
            }
        }
        else
        {
            Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
            Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
            tmm = tm.GetModel(ul.LoginID);
            if (!string.IsNullOrEmpty(Convert.ToString(tmm.m_bum)))
            {
                Tunnel.BLL.Tunnel_byingshe          tb     = new Tunnel.BLL.Tunnel_byingshe();
                Tunnel.Model.Tunnel_byingshe        tbb    = new Tunnel.Model.Tunnel_byingshe();
                List <Tunnel.Model.Tunnel_byingshe> tbList = new List <Tunnel.Model.Tunnel_byingshe>();
                tbList = tb.GetModelList("by_bid = " + tmm.m_bum + "");
                if (tbList.Count > 0)
                {
                    tbb = tbList[0];
                    string byList = tbb.by_list;
                    if (byList.Length > 0)
                    {
                        string[] temp = byList.Split('|');
                        foreach (string item in temp)
                        {
                            Tunnel.Model.Tunnel_quanxian tqq = new Tunnel.Model.Tunnel_quanxian();
                            tqq = tq.GetModel(int.Parse(item));
                            if (tqq != null)
                            {
                                allDic.Add(tqq.q_id, tqq.q_mark + "-->>" + tqq.q_name);
                            }
                        }
                    }
                }
            }
        }
        return(allDic);
    }
예제 #2
0
    public static int typeId        = 0;  //管理类型编号


    /// <summary>
    /// 根据 用户编号获取用户拥有的所有权限
    /// </summary>
    /// <param name="userId"></param>
    public void GetUserAllPermission(int userId)
    {
        ListBox3.Items.Clear();
        int    bumId   = 0;
        int    dutyId  = 0;
        int    jueSeId = 0;
        string qxList  = string.Empty;

        Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();

        Tunnel.BLL.Tunnel_uyingshe   uy  = new Tunnel.BLL.Tunnel_uyingshe();
        Tunnel.Model.Tunnel_uyingshe uyy = new Tunnel.Model.Tunnel_uyingshe();

        Tunnel.BLL.Tunnel_dyingshe   dy  = new Tunnel.BLL.Tunnel_dyingshe();
        Tunnel.Model.Tunnel_dyingshe dyy = new Tunnel.Model.Tunnel_dyingshe();

        Tunnel.BLL.Tunnel_yingshe   jy  = new Tunnel.BLL.Tunnel_yingshe();
        Tunnel.Model.Tunnel_yingshe jyy = new Tunnel.Model.Tunnel_yingshe();

        Tunnel.BLL.Tunnel_byingshe   by  = new Tunnel.BLL.Tunnel_byingshe();
        Tunnel.Model.Tunnel_byingshe byy = new Tunnel.Model.Tunnel_byingshe();

        tmm = tm.GetModel(userId);

        #region 判断
        if (tmm != null)
        {
            bumId   = tmm.m_bum;
            dutyId  = tmm.m_duty;
            jueSeId = tmm.m_jiao;
            if (uy.GetModelList("uy_uid=" + userId).Count > 0)
            {
                uyy = uy.GetModelList("uy_uid=" + userId)[0];
                if (uyy != null)
                {
                    if (uyy.uy_list.Length > 0)
                    {
                        qxList += uyy.uy_list + "|";
                    }
                }
            }
            if (by.GetModelList("by_bid=" + bumId).Count > 0)
            {
                byy = by.GetModelList("by_bid=" + bumId)[0];
                if (byy != null)
                {
                    if (byy.by_list.Length > 0)
                    {
                        qxList += byy.by_list + "|";
                    }
                }
            }
            if (dy.GetModelList("dy_did=" + dutyId).Count > 0)
            {
                dyy = dy.GetModelList("dy_did=" + dutyId)[0];
                if (dyy != null)
                {
                    if (dyy.dy_list.Length > 0)
                    {
                        qxList += dyy.dy_list + "|";
                    }
                }
            }
            if (jy.GetModelList("y_jsid=" + jueSeId).Count > 0)
            {
                jyy = jy.GetModelList("y_jsid=" + jueSeId)[0];
                if (jyy != null)
                {
                    if (jyy.y_qxlist.Length > 0)
                    {
                        qxList += jyy.y_qxlist + "|";
                    }
                }
            }
            if (qxList.Length > 1)
            {
                qxList = qxList.Substring(0, qxList.Length - 1);
            }
        }
        #endregion
        Tunnel.BLL.Tunnel_quanxian tq = new Tunnel.BLL.Tunnel_quanxian();

        if (qxList.Length > 0)
        {
            foreach (string item in qxList.Split('|'))
            {
                Tunnel.Model.Tunnel_quanxian tqq = new Tunnel.Model.Tunnel_quanxian();
                tqq = tq.GetModel(int.Parse(item));
                if (tqq != null)
                {
                    ListItem li = new ListItem(tqq.q_mark + "-->>" + tqq.q_name, tqq.q_id.ToString());
                    if (!ListBox3.Items.Contains(li))
                    {
                        ListBox3.Items.Add(li);
                    }
                }
            }
        }
    }