Example #1
0
        //
        // GET: /Help/
        /// <summary>
        /// 分类列表
        /// </summary>
        /// <returns></returns>
        public ActionResult ClassificationList()
        {
            List <JMP.MDL.jmp_Help_Classification> list = new List <JMP.MDL.jmp_Help_Classification>();

            JMP.BLL.jmp_Help_Classification bll = new JMP.BLL.jmp_Help_Classification();
            int       pageCount  = 0;
            int       pageIndexs = string.IsNullOrEmpty(Request["pageIndexs"]) ? 1 : Int32.Parse(Request["pageIndexs"]); //当前页
            int       PageSize   = string.IsNullOrEmpty(Request["PageSize"]) ? 20 : Int32.Parse(Request["PageSize"]);    //每页显示数量
            string    ClassName  = string.IsNullOrEmpty(Request["ClassName"]) ? "" : Request["ClassName"];
            int       Type       = string.IsNullOrEmpty(Request["Type"]) ? -1 : int.Parse(Request["Type"]);
            int       sType      = string.IsNullOrEmpty(Request["sType"]) ? -1 : int.Parse(Request["sType"]);
            int       ParentID   = string.IsNullOrEmpty(Request["ParentID"]) ?0 : int.Parse(Request["ParentID"]);
            DataTable tablelist  = bll.GetList(" 1=1 and ParentID=0 and State=0 ").Tables[0];
            List <JMP.MDL.jmp_Help_Classification> parentlist = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_Help_Classification>(tablelist);

            ViewBag.parentlist = parentlist;
            list = bll.SelectList(sType, ParentID, ClassName, Type, pageIndexs, PageSize, out pageCount);
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.list       = list;
            ViewBag.ClassName  = ClassName;
            ViewBag.PrentID    = ParentID;
            ViewBag.Type       = Type;
            ViewBag.sType      = sType;
            string locUrl        = "";
            bool   getlocuserAdd = bll_limit.GetLocUserLimitVoids("/Help/AddClassification", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//添加

            if (getlocuserAdd)
            {
                locUrl += "<li onclick=\"AddSdl()\"><i class='fa fa-plus'></i>添加类别</li>";
            }
            bool getUidT = bll_limit.GetLocUserLimitVoids("/Help/UpdateState", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//本地管理员一键启用

            if (getUidT)
            {
                locUrl += "<li onclick=\"javascript:Updatestate(0)\"><i class='fa fa-check-square-o'></i>一键启用</li>";
            }
            bool getUidF = bll_limit.GetLocUserLimitVoids("/Help/UpdateState", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//本地管理员一键禁用

            if (getUidF)
            {
                locUrl += "<li onclick=\"javascript:Updatestate(1);\"><i class='fa fa-check-square-o'></i>一键禁用</li>";
            }
            ViewBag.locUrl = locUrl;

            return(View());
        }