public void ShowData()
 {
     WebProject.BLL.SysManage.ZT_SYS_ElementInfo bll_ElementInfo = new WebProject.BLL.SysManage.ZT_SYS_ElementInfo();
     DataSet ds = bll_ElementInfo.GetList(" 1=1 ");
     if (ds.Tables[0].Rows.Count > 0)
     {
         this.lblMessage.Visible = false;
         this.btnDeleteSelect.Visible = true;
         this.GridView1.Visible = true;
         this.GridView1.DataSource = ds;
         this.GridView1.DataBind();
     }
     else
     {
         this.lblMessage.Visible = true;
         this.btnDeleteSelect.Visible = false;
         this.GridView1.Visible = false;
     }
 }
    public string GetElementGun(WebProject.Model.SysManage.ZT_SYS_RoleInfo model_RoleInfo)
    {
        string Gun = "";
        WebProject.BLL.SysManage.ZT_SYS_ElementInfo bll_ElementInfo = new WebProject.BLL.SysManage.ZT_SYS_ElementInfo();
        string[] ElementsList = model_RoleInfo.RoleElements.Split(',');
        string Elements = "";
        for (int i = 0; i < ElementsList.Length; i++)
        {
            Elements = Elements + "'" + ElementsList[i] + "',";
        }
        Elements = Elements.Substring(0, Elements.Length - 1);
        DataSet dsGun = bll_ElementInfo.GetList(" (ParentCode <> '0E00' and ParentCode <> '0I00') and ElementShow=0 and ElementCode in (" + Elements + ")");

        for (int i = 0; i < dsGun.Tables[0].Rows.Count; i++)
        {
            Gun = Gun + "|" + dsGun.Tables[0].Rows[i]["ElementName"];
        }

        return Gun;
    }
    public string GetElementSystem(WebProject.Model.SysManage.ZT_SYS_RoleInfo model_RoleInfo)
    {
        string System = "";
        WebProject.BLL.SysManage.ZT_SYS_ElementInfo bll_ElementInfo = new WebProject.BLL.SysManage.ZT_SYS_ElementInfo();
        string[] ElementsList = model_RoleInfo.RoleElements.Split(',');
        string Elements = "";
        for (int i = 0; i < ElementsList.Length; i++)
        {
            Elements = Elements + "'" + ElementsList[i] + "',";
        }
        Elements = Elements.Substring(0, Elements.Length - 1);

        DataSet dsSystem = bll_ElementInfo.GetList(" (ElementShow=1 or ElementShow=2) and ElementCode in (" + Elements + ")");

        for (int i = 0; i < dsSystem.Tables[0].Rows.Count; i++)
        {
            System = System + "|" + dsSystem.Tables[0].Rows[i]["ElementName"];
        }

        return System;
    }
    private void LoadTree()
    {
        this.TreeView1.Nodes.Clear();

        TreeNode item = new TreeNode();
        item.Text = "系统功能权限";
        item.Value = "root";
        item.Target = "1";
        item.Expanded = true;
        item.ImageUrl = "Images/tree_to.ico";
        TreeView1.Nodes.Add(item);

        bool blnModule = false;

        string whereSql = "";
        WebProject.BLL.SysManage.ZT_SYS_ElementInfo bll_ElementInfo = new WebProject.BLL.SysManage.ZT_SYS_ElementInfo();
        System.Data.DataTable dt1, dt2;
        DataRow dr;

        whereSql = " ParentCode='00' and ElementShow = '1'";// order by  SequenceNo";
        //排序

        dt1 = bll_ElementInfo.GetList(whereSql).Tables[0];

        if (dt1.Rows.Count == 0) return;
        for (int i = 0; i < dt1.Rows.Count; i++)  //模块
        {
            //T_xt_functionInfo modelInfo = (T_xt_functionInfo)modelList[i];
            dr = dt1.Rows[i];
            TreeNode module = new TreeNode();
            module.Target = "2";
            module.ShowCheckBox = true;
            //module.Checked = true;
            module.Text = dr["ElementName"].ToString();
            module.Value = dr["ElementCode"].ToString();
            module.Expanded = false;
            item.ChildNodes.Add(module);

            blnModule = false;
            //获取功能列表
            whereSql = " ParentCode='" + dr["ElementCode"].ToString() + "'";// order by  SequenceNo";

            dt2 = bll_ElementInfo.GetList(whereSql).Tables[0];
            if (dt2.Rows.Count == 0) continue;
            for (int j = 0; j < dt2.Rows.Count; j++) //功能
            {
                dr = dt2.Rows[j];
                TreeNode func = new TreeNode();
                func.Target = "3";
                func.Value = dr["ElementCode"].ToString();
                func.Text = dr["ElementName"].ToString();
                func.ShowCheckBox = true;
                //func.Checked = true;

                func.Checked = this.checkRight(func.Value);

                module.ChildNodes.Add(func);

                if (func.Checked) blnModule = true;

            }//功能

            module.Checked = blnModule;

        }//模块
    }
 private DataTable BindDataDT()
 {
     WebProject.BLL.SysManage.ZT_SYS_ElementInfo bll_ElementInfo = new WebProject.BLL.SysManage.ZT_SYS_ElementInfo();
     string whereSql = " ElementShow = '0'";//  order by  SequenceNo";
     //排序
     DataTable dtTree = bll_ElementInfo.GetList(whereSql).Tables[0];
     return dtTree;
 }
Beispiel #6
0
    public static bool CheckQx(string ElementLink)
    {
        if (SessionUtil.GetAdminSession().RoleNo + "" == "")
        {
            return false;
        }
        else
        {
            WebProject.BLL.SysManage.ZT_SYS_RoleInfo bll_RoleInfo = new WebProject.BLL.SysManage.ZT_SYS_RoleInfo();
            WebProject.Model.SysManage.ZT_SYS_RoleInfo model_RoleInfo = bll_RoleInfo.GetModel(SessionUtil.GetAdminSession().RoleNo);
            string RoleElements = model_RoleInfo.RoleElements;

            WebProject.BLL.SysManage.ZT_SYS_ElementInfo bll_ElementInfo = new WebProject.BLL.SysManage.ZT_SYS_ElementInfo();
            DataSet ds = bll_ElementInfo.GetList("ElementLink='" + ElementLink + "'");
            if (ds.Tables[0].Rows.Count > 0)
            {
                string ElementCode = ds.Tables[0].Rows[0]["ElementCode"].ToString();
                if (RoleElements.IndexOf(ElementCode) < 0)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
            else
            {
                return false;
            }
        }
    }