예제 #1
0
        public JsonResult AddorEditContent(jmp_Help_Content mod)
        {
            // mod.Content = mod.Content.RemoveStyles();
            JMP.BLL.jmp_Help_Content bll = new JMP.BLL.jmp_Help_Content();
            object retJson = new { success = 0, msg = "操作失败" };

            if (mod.ID > 0)
            {
                JMP.MDL.jmp_Help_Content mo = new jmp_Help_Content();
                mo              = bll.GetModel(mod.ID);
                mo.ISOverhead   = mod.ISOverhead;
                mo.Title        = mod.Title;
                mo.UpdateById   = UserInfo.Uid;
                mo.UpdateByName = UserInfo.UserName;
                mo.UpdateOn     = DateTime.Now;
                mo.Type         = mod.Type;
                mo.Content      = mod.Content;
                mo.PrentID      = mod.PrentID;
                mo.ClassId      = mod.ClassId;
                if (bll.Update(mo))
                {
                    Logger.ModifyLog("修改内容", mo, mod);
                    bll.UpdateClassCount(mod.PrentID, 0);
                    bll.UpdateClassCount(mod.ClassId, 1);
                    retJson = new { success = 1, msg = "修改成功" };
                }
                else
                {
                    retJson = new { success = 0, msg = "修改失败" };
                }
            }
            else
            {
                mod.State        = 0;
                mod.CreateById   = UserInfo.Uid;
                mod.CreateByName = UserInfo.UserName;
                mod.CreateOn     = DateTime.Now;
                mod.UpdateOn     = DateTime.Now;
                int cg = bll.Add(mod);
                if (cg > 0)
                {
                    Logger.CreateLog("添加内容", model);
                    bll.UpdateClassCount(mod.PrentID, 0);
                    bll.UpdateClassCount(mod.ClassId, 1);
                    retJson = new { success = 1, msg = "添加成功" };
                }
                else
                {
                    retJson = new { success = 0, msg = "添加失败" };
                }
            }

            return(Json(retJson));
        }
예제 #2
0
        public ActionResult AddContent()
        {
            JMP.MDL.jmp_Help_Content model   = new jmp_Help_Content();
            JMP.BLL.jmp_Help_Content bllmode = new JMP.BLL.jmp_Help_Content();
            int Id = string.IsNullOrEmpty(Request["Id"]) ? 0 : Int32.Parse(Request["Id"]);

            if (Id > 0)
            {
                model = bllmode.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());
        }
예제 #3
0
        public ActionResult Details(int?id)
        {
            var model          = new ArticleDetailsViewModel();
            var helpArticleBll = new JMP.BLL.jmp_Help_Content();
            var article        = helpArticleBll.GetModel((int)id);

            model.Id        = article.ID;
            model.Content   = article.Content;
            model.CreatedOn = article.CreateOn.ToString("yyyy年MM月dd日 HH:mm");
            model.Title     = article.Title;
            model.UpdatedOn = article.UpdateOn == null
                ? ""
                : Convert.ToDateTime(article.UpdateOn).ToString("yyyy年MM月dd日 HH:mm");
            model.CreatedByUserName = article.CreateByName;
            model.UpdatedByUserName = article.UpdateByName;
            model.SubCatalogId      = article.ClassId;

            var viewCount = article.Count + 1;

            helpArticleBll.ArticleViewed(article.ID, viewCount);
            return(View(model));
        }