Exemple #1
0
        /// <summary>
        /// 添加修改页面
        /// </summary>
        /// <returns></returns>
        public ActionResult AddClassification()
        {
            int Id = string.IsNullOrEmpty(Request["Id"]) ? 0 : Int32.Parse(Request["Id"]);

            if (Id > 0)
            {
                model = bll.GetModel(Id);
            }
            ViewBag.model = model;
            DataTable tablelist = bll.GetList(" 1=1 and ParentID=0 and State=0  ").Tables[0];
            List <JMP.MDL.jmp_Help_Classification> list = JMP.TOOL.MdlList.ToList <JMP.MDL.jmp_Help_Classification>(tablelist);

            ViewBag.list = list;
            return(View());
        }
Exemple #2
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());
        }
Exemple #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);
        }