/// <summary> /// 置顶 /// </summary> /// <param name="Model"></param> /// <returns></returns> public string SetTop(KnowledgeArticle Model) { KnowledgeArticleBll bll = new KnowledgeArticleBll(); bll.SetTop(Model); return(new { success = true }.GetJson()); }
public ActionResult Index(string title, int?titleType, string classId, string orderby, int?pageIndex, int?pagesize, bool isGetRowCount = false) { KnowledgeArticleBll bll = new KnowledgeArticleBll(); if (pageIndex == null || pageIndex < 1) { pageIndex = 1; } string msg; KnowledgeArticleViewModel viewModel = new KnowledgeArticleViewModel(); viewModel.PageSize = 10; viewModel.OrderBy = orderby; if (Request.IsAjaxRequest()) { viewModel.TotalRowCount = (int)bll.GetRowCountBySql(title, titleType, classId, out msg); if (!isGetRowCount) { viewModel.List = bll.GetPagedList(title, titleType, classId, viewModel.TotalRowCount, 10, pageIndex.Value, orderby, false, out msg); } viewModel.PageIndex = pageIndex.Value; return(Json(viewModel, JsonRequestBehavior.AllowGet)); } else { viewModel.Level0Classes = cBll.GetArray(null, x => new KnowledgeClass { Id = x.Id, ClassName = x.ClassName }).Where(x => x.Lvl == 0).ToList(); return(View(viewModel)); } }
public ActionResult Index(string title, int? titleType, string classId, string orderby, int? pageIndex, int? pagesize, bool isGetRowCount = false) { KnowledgeArticleBll bll = new KnowledgeArticleBll(); if (pageIndex == null || pageIndex < 1) { pageIndex = 1; } string msg; KnowledgeArticleViewModel viewModel = new KnowledgeArticleViewModel(); viewModel.PageSize = 10; viewModel.OrderBy = orderby; if (Request.IsAjaxRequest()) { viewModel.TotalRowCount = (int)bll.GetRowCountBySql(title, titleType, classId, out msg); if (!isGetRowCount) { viewModel.List = bll.GetPagedList(title, titleType, classId, viewModel.TotalRowCount, 10, pageIndex.Value, orderby, false, out msg); } viewModel.PageIndex = pageIndex.Value; return Json(viewModel, JsonRequestBehavior.AllowGet); } else { viewModel.Level0Classes = cBll.GetArray(null, x => new KnowledgeClass { Id = x.Id, ClassName = x.ClassName }).Where(x => x.Lvl == 0).ToList(); return View(viewModel); } }
/// <summary> /// 预览界面 /// </summary> /// <param name="Id"></param> /// <returns></returns> public ActionResult ArticleDetail(int Id) { var Model = new KnowledgeArticleBll().GetKnowledgeArticleById(Id); string ClassName = new KnowledgeClassBll().GetKnowledgeClassName(Model.ClassId); ViewBag.ClassName = ClassName; return(View(Model)); }
public string KnowledgeArticleAddOrUpdate(KnowledgeArticle Model) { KnowledgeArticleBll bll = new KnowledgeArticleBll(); Model.Creater = Creater; Model.Modifier = Creater; return(bll.KnowledgeArticleAddOrUpdate(Model)); }
public ActionResult Add(int Id = 0) { ViewBag.UpDate = false; KnowledgeArticle Model = new KnowledgeArticle(); if (Id > 0) { Model = new KnowledgeArticleBll().GetKnowledgeArticleById(Id); ViewBag.UpDate = true; } ViewBag.ClassList = new KnowledgeClassBll().KnowledgeClassPage(string.Empty); return(View(Model)); }
public ActionResult DelKnowledgeArticle(int[] ids) { if (ids == null || ids.Length == 0) { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } KnowledgeArticleBll bll = new KnowledgeArticleBll(); foreach (int id in ids) { if (bll.Delete(x => x.Id == id) != 1) { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } } return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); }
public ActionResult ArticleDetailWeiXin(int id) { KnowledgeArticle model = new KnowledgeArticleBll().GetKnowledgeArticleById(id); return(View(model)); }
public ActionResult ArticleDetailWeiXin(int id) { KnowledgeArticle model = new KnowledgeArticleBll().GetKnowledgeArticleById(id); return View(model); }
/// <summary> /// 预览界面 /// </summary> /// <param name="Id"></param> /// <returns></returns> public ActionResult ArticleDetail(int Id) { var Model = new KnowledgeArticleBll().GetKnowledgeArticleById(Id); string ClassName = new KnowledgeClassBll().GetKnowledgeClassName(Model.ClassId); ViewBag.ClassName = ClassName; return View(Model); }
public ActionResult Add(int Id = 0) { ViewBag.UpDate = false; KnowledgeArticle Model = new KnowledgeArticle(); if (Id > 0) { Model = new KnowledgeArticleBll().GetKnowledgeArticleById(Id); ViewBag.UpDate = true; } ViewBag.ClassList = new KnowledgeClassBll().KnowledgeClassPage(string.Empty); return View(Model); }
/// <summary> /// 置顶 /// </summary> /// <param name="Model"></param> /// <returns></returns> public string SetTop(KnowledgeArticle Model) { KnowledgeArticleBll bll = new KnowledgeArticleBll(); bll.SetTop(Model); return new { success = true }.GetJson(); }
public string KnowledgeArticleAddOrUpdate(KnowledgeArticle Model) { KnowledgeArticleBll bll = new KnowledgeArticleBll(); Model.Creater = Creater; Model.Modifier = Creater; return bll.KnowledgeArticleAddOrUpdate(Model); }
public ActionResult DelKnowledgeArticle(int[] ids) { if (ids == null || ids.Length == 0) { return Json(new { success = false }, JsonRequestBehavior.AllowGet); } KnowledgeArticleBll bll = new KnowledgeArticleBll(); foreach (int id in ids) { if (bll.Delete(x => x.Id == id) != 1) { return Json(new { success = false }, JsonRequestBehavior.AllowGet); } } return Json(new { success = true }, JsonRequestBehavior.AllowGet); }