Exemplo n.º 1
0
        public ActionResult ContentList()
        {
            List <JMP.MDL.jmp_Help_Content> list = new List <JMP.MDL.jmp_Help_Content>();

            JMP.BLL.jmp_Help_Content        bll      = new JMP.BLL.jmp_Help_Content();
            JMP.BLL.jmp_Help_Classification classbll = 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    Type       = string.IsNullOrEmpty(Request["Type"]) ? "" : Request["Type"];
            string    sea_name   = string.IsNullOrEmpty(Request["sea_name"]) ? "" : Request["sea_name"];
            int       State      = string.IsNullOrEmpty(Request["State"]) ? -1 : int.Parse(Request["State"]);
            int       PrentID    = string.IsNullOrEmpty(Request["PrentID"]) ? 0 : int.Parse(Request["PrentID"]);
            int       ClassId    = string.IsNullOrEmpty(Request["ClassId"]) ? 0 : int.Parse(Request["ClassId"]);
            int       sType      = string.IsNullOrEmpty(Request["sType"]) ? -1 : int.Parse(Request["sType"]);
            DataTable tablelist  = classbll.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, Type, sea_name, State, PrentID, ClassId, pageIndexs, PageSize, out pageCount);
            ViewBag.pageIndexs = pageIndexs;
            ViewBag.PageSize   = PageSize;
            ViewBag.pageCount  = pageCount;
            ViewBag.list       = list;
            ViewBag.sea_name   = sea_name;
            ViewBag.PrentID    = PrentID;
            ViewBag.ClassId    = ClassId;
            ViewBag.type       = Type;
            ViewBag.State      = State;
            ViewBag.sType      = sType;
            string locUrl        = "";
            bool   getlocuserAdd = bll_limit.GetLocUserLimitVoids("/Help/AddContent", UserInfo.UserId.ToString(), int.Parse(UserInfo.UserRoleId.ToString()));//添加

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

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

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

            return(View());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <returns></returns>
        public JsonResult UpdateState()
        {
            object retJson = new { success = 0, msg = "操作失败" };
            int    state   = string.IsNullOrEmpty(Request["state"]) ? 0 : Int32.Parse(Request["state"].ToString());
            string str     = Request["ids"];
            string xgzfc   = ""; //组装说明
            string tsmsg   = ""; //提示

            JMP.BLL.jmp_Help_Classification bll = new JMP.BLL.jmp_Help_Classification();
            if (str.CompareTo("On") > 0)
            {
                str = str.Substring(3);
            }
            if (bll.UpdateState(str, state))
            {
                if (state == 1)
                {
                    xgzfc = "一键禁用ID为:" + str;
                    tsmsg = "禁用成功";
                }
                else
                {
                    tsmsg = "启用成功";
                    xgzfc = "一键启用ID为:" + str;
                }

                Logger.OperateLog("应用一键禁用或启用", xgzfc);

                retJson = new { success = 1, msg = tsmsg };
            }
            else
            {
                if (state == 1)
                {
                    tsmsg = "禁用失败";
                }
                else
                {
                    tsmsg = "启用失败";
                }
                retJson = new { success = 0, msg = tsmsg };
            }
            return(Json(retJson));
        }
Exemplo n.º 3
0
        public string SelectClassId()
        {
            int PrentID = string.IsNullOrEmpty(Request["PrentID"].ToString()) ? -1 :int.Parse(Request["PrentID"].ToString());
            int ClassID = string.IsNullOrEmpty(Request["ClassID"].ToString()) ? -1 : int.Parse(Request["ClassID"].ToString());

            JMP.BLL.jmp_Help_Classification bll = new JMP.BLL.jmp_Help_Classification();
            DataTable dt   = bll.GetList(" 1=1 and State=0 and  ParentID='" + PrentID + "' order by Sort desc  ").Tables[0];
            string    yyzl = "<option value = '-1'> --请选择-- </option>";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (Int32.Parse(dt.Rows[i]["ID"].ToString()) == ClassID)
                {
                    yyzl += " <option value='" + dt.Rows[i]["ID"] + "' selected=selected >" + dt.Rows[i]["ClassName"] + "</option>";
                }
                else
                {
                    yyzl += " <option value='" + dt.Rows[i]["ID"] + "' >" + dt.Rows[i]["ClassName"] + "</option>";
                }
            }
            return(yyzl);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <returns></returns>
        private static List <JMP.MDL.jmp_Help_Classification> LoadData()
        {
            var list = new JMP.BLL.jmp_Help_Classification().FindAllEnabledHelpList().OrderBy(x => x.Sort).ThenBy(x => x.ID).ToList();

            return(list);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <returns></returns>
        private static List <DocMenuQueryModel> LoadData()
        {
            var list = new JMP.BLL.jmp_Help_Classification().FindAllEnabledDocList().OrderBy(x => x.Sort).ThenBy(x => x.ID).ToList();

            return(list);
        }