Example #1
0
        /// <summary>
        /// 获取模块列表
        /// </summary>
        /// <returns></returns>
        protected string GetModulesByControl()
        {
            ModulesBLL       moduleBll  = new ModulesBLL();
            ModuleControlBLL controlBll = new ModuleControlBLL();
            DataTable        modules    = moduleBll.GetModules(Utils.GetQueryInt("ID"));
            DataTable        control    = controlBll.GetModuleControl();
            StringBuilder    sb         = new StringBuilder();

            //获取顶级模块
            DataRow[] dr1 = GetChildModule(modules, "M0");
            if (dr1 != null & dr1.Length > 0)
            {
                for (int i = 0; i < dr1.Length; i++)
                {
                    sb.AppendFormat("<table id=\"T-{0}\" class=\"mlist\">", dr1[i]["moduleid"]);
                    sb.AppendFormat("<tr><th colspan=\"2\"><input type=\"checkbox\" id=\"{0}\" name=\"modules\" value=\"{0}\" onclick=\"checkNode('{0}',1);\" /><label for=\"{0}\">{1}</label></th></tr>\r\n", dr1[i]["moduleid"], dr1[i]["modulename"]);

                    //获取第二级模块
                    DataRow[] dr2 = GetChildModule(modules, dr1[i]["moduleid"].ToString());
                    if (dr2 != null && dr2.Length > 0)
                    {
                        for (int j = 0; j < dr2.Length; j++)
                        {
                            sb.AppendFormat("<tr class=\"mt\"><td colspan=\"2\"><input type=\"checkbox\" id=\"{0}\" name=\"modules\" value=\"{0}\" onclick=\"checkNode('{0}',2);\" /><label for=\"{0}\">{1}</label></td></tr>\r\n", dr2[j]["moduleid"], dr2[j]["modulename"]);
                            //获取第三级模块
                            DataRow[] dr3 = GetChildModule(modules, dr2[j]["moduleid"].ToString());
                            if (dr3 != null && dr3.Length > 0)
                            {
                                for (int k = 0; k < dr3.Length; k++)
                                {
                                    if (k % 2 == 0)
                                    {
                                        sb.AppendFormat("<tr class=\"mi\"><td style=\"width:35%\"><input type=\"checkbox\" id=\"{0}\" name=\"s-modules\" value=\"{0}\" onclick=\"checkNode('{0}',3);\" /><label for=\"{0}\">{1}</label></td>", dr3[k]["moduleid"], dr3[k]["modulename"]);
                                    }
                                    else
                                    {
                                        sb.AppendFormat("<tr class=\"mi\" style=\"background:#F3F9FB;\"><td><input type=\"checkbox\" id=\"{0}\" name=\"s-modules\" value=\"{0}\" onclick=\"checkNode('{0}',3);\" /><label for=\"{0}\">{1}</label></td>", dr3[k]["moduleid"], dr3[k]["modulename"]);
                                    }

                                    DataRow[] drcontrol = GetControlByModule(control, dr3[k]["moduleid"].ToString());
                                    sb.Append("<td>");
                                    for (int c = 0; c < drcontrol.Length; c++)
                                    {
                                        sb.AppendFormat("<input type=\"checkbox\" id=\"{0}-{1}\" name=\"{0}\" value=\"{1}\" onclick=\"checkNode('{0}',4);\" /><label for=\"{0}-{1}\">{2}</label>&nbsp;&nbsp;", drcontrol[c]["ModuleID"], drcontrol[c]["ControlValue"], drcontrol[c]["ControlName"]);
                                    }
                                    sb.Append("</td></tr>");
                                }
                            }
                        }
                    }
                    sb.Append("</table>\r\n");
                }
            }

            return(sb.ToString());
        }
Example #2
0
    /// <summary>
    /// 加载左侧导航栏大类,大类管理
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Users"] != null)
        {
            users = (Users)Session["Users"];

            listModeuleBig = ModulesBLL.AllData(" and ModuleId in ( select ParentModuleId From dbo.Modules where ModuleId in (SELECT ModuleId FROM Authority WHERE RoleId=" + users.RoleId + ") group by ParentModuleId)");
        }
        else
        {
            users = null;
            Response.Write("<script>parent.window.location.href='Login.aspx'</script>");
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            string modulesID = Utils.GetQueryString("modulesID");

            if (modulesID.Length == 0)
            {
                return;
            }

            StringBuilder strHtml = new StringBuilder();

            ModulesBLL     modulesBll = new ModulesBLL();
            int            count      = 0;
            List <Modules> mlist      = modulesBll.GetSubNav(out count);
        }
Example #4
0
        public string GetModulesJsonData()
        {
            ModulesBLL moduleBll = new ModulesBLL();

            return(moduleBll.GetModulesJsonData());
        }