Exemple #1
0
        /// <summary>
        /// 查询一级是否选中
        /// </summary>
        /// <param name="r_value">角色值</param>
        public void GetFirstHtml(string r_value, int type)
        {
            string userlimit = "," + new JMP.BLL.jmp_limit().getrolelimit(Convert.ToInt32(UserInfo.UserRoleId)) + ",";

            if (UserInfo.UserRoleId.ToString() == "1")
            {
                userlimit = "1";
            }
            string where = " l_state=1 "; //
            switch (type)
            {
            case 0:
                where += " and l_type ='0' ";
                break;

            case 1:
                where += " and l_type ='1' ";
                break;

            case 2:
                where += " and l_type ='2' ";
                break;

            case 3:
                where += " and l_type ='3' ";
                break;
            }

            List <JMP.MDL.jmp_limit> listF = bll_limit.GetModelList(where);

            ViewBag.htmls += "<div id=\"RolePanel\" class=\"tab-dcnt tab-dcnt-rote\">";
            ViewBag.htmls += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"table-cnt table-cnt-rote lay-table-cnt\">";
            ViewBag.htmls += "<thead>                        <tr>                            <th class='first'>导航名称</th>                            <th>权限分配</th>                            <th width=\"40\">全选</th>                        </tr>                    </thead>";
            ViewBag.htmls += "<tbody>";
            List <JMP.MDL.jmp_limit> lilili = listF.Where(a => a.l_topid == 0).ToList();

            for (int i = 0; i < lilili.Count; i++)
            {
                if (userlimit == "1" || userlimit.Contains("," + lilili[i].l_id.ToString() + ","))
                {
                    ViewBag.htmls += "<tr>";
                    ViewBag.htmls += "<td>";
                    ViewBag.htmls += "<span class=\"folder-open\">" + lilili[i].l_name + "</span>";
                    ViewBag.htmls += "</td>";
                    ViewBag.htmls += "<td>";
                    ViewBag.htmls += "<span class=\"cbllist\" id=\"child_" + lilili[i].l_id + "\">";
                    ViewBag.htmls += "<input type=\"checkbox\" onclick=\"childChecked(this)\" name=\"chk_menu\" id=\"chk_menu_" + lilili[i].l_id + "\" class=\"checkall\" " + GetCheck(r_value, lilili[i].l_id) + " value=\"" + lilili[i].l_id + "\" style=\"vertical-align: middle;\" /><label for=\"chk_menu_" + lilili[i].l_id + "\">显示</label>";
                    ViewBag.htmls += "</span>";
                    ViewBag.htmls += "<td align=\"center\"><input name=\"checkAll\" child=\"child_" + listF[i].l_id + "\" type=\"checkbox\"  /></td>";
                    ViewBag.htmls += "</tr>";
                    GetSecondHtml(userlimit, r_value, lilili[i].l_id, listF);
                }
            }
            ViewBag.htmls += "</tbody>";
            ViewBag.htmls += "</table>";
            ViewBag.htmls += "</div>";
        }
Exemple #2
0
        public ActionResult BuildIncreasedPermission(int lid)
        {
            var result               = new ContentResult();
            var limitBll             = new JMP.BLL.jmp_limit();
            var increasedPermissions = limitBll.GetModelList("l_id>=" + lid);
            var list = new List <string>();

            increasedPermissions.ForEach(x =>
            {
                list.Add(string.Format("INSERT INTO jmp_limit ([l_name], [l_topid], [l_url], [l_sort], [l_state], [l_icon], [l_type]) VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", x.l_name, x.l_topid, x.l_url, x.l_sort, x.l_state, x.l_icon, x.l_type));
            });
            result.Content = string.Join(";\n", list);
            return(result);
        }
Exemple #3
0
        /// <summary>
        /// 查询页面下拉框显示
        /// </summary>
        public void GetSelectNewHtml(string topid, int type)
        {
            if (string.IsNullOrEmpty(topid))
            {
                ViewBag.selectTopid += "<option selected=\"selected\" value=\"\">所有</option>";
            }
            else
            {
                ViewBag.selectTopid += "<option value>所有</option>";
            }
            if (topid == "0")
            {
                ViewBag.selectTopid += "<option value=\"0\"  selected=\"selected\">父级</option>";
            }
            else
            {
                ViewBag.selectTopid += "<option value=\"0\">父级</option>";
            }
            string where = "l_state=1 ";
            switch (type)
            {
            case 0:
                where += " and l_type='0' ";
                break;

            case 1:
                where += " and l_type='1' ";
                break;

            case 2:
                where += " and l_type='2' ";
                break;

            case 3:
                where += " and l_type='3' ";
                break;
            }
            List <JMP.MDL.jmp_limit> listF = bll_limit.GetModelList(where);//获取父类

            foreach (var item in listF.Where(a => a.l_topid == 0))
            {
                if (item.l_id.ToString() == topid)
                {
                    ViewBag.selectTopid += "<option value=\"" + item.l_id + "\"  selected=\"selected\"> ├ " + item.l_name + "</option>";
                }
                else
                {
                    ViewBag.selectTopid += "<option value=\"" + item.l_id + "\"> ├ " + item.l_name + "</option>";
                }
                List <JMP.MDL.jmp_limit> listS = listF.Where(a => a.l_topid == item.l_id).ToList();
                foreach (var itemS in listS)
                {
                    if (itemS.l_id.ToString() == topid)
                    {
                        ViewBag.selectTopid += "<option value=\"" + itemS.l_id + "\"  selected=\"selected\">&nbsp;&nbsp;&nbsp;├ " + itemS.l_name + "</option>";
                    }
                    else
                    {
                        ViewBag.selectTopid += "<option value=\"" + itemS.l_id + "\">&nbsp;&nbsp;&nbsp;├ " + itemS.l_name + "</option>";
                    }
                    //List<JMP.MDL.jmp_limit> listT = listF.Where(a => a.l_topid == itemS.l_id).ToList();
                    //foreach (var itemT in listT)
                    //{
                    //    if (itemS.l_id.ToString() == topid)
                    //    {
                    //        ViewBag.selectTopid += "<option value=\"" + itemT.l_id + "\"  selected=\"selected\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├ " + itemT.l_name + "</option>";
                    //    }
                    //    else
                    //    {
                    //        ViewBag.selectTopid += "<option value=\"" + itemT.l_id + "\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├ " + itemT.l_name + "</option>";
                    //    }
                    //}
                }
            }
        }