public JsonResult GetArticle(int channel_Id, string entId, string type) { if (channel_Id <= 0) { return(Json(new { success = false, message = "参数无效" })); } else { try { if (entId == null || entId == "") { entId = BaseConfiguration.EntId; } ArticleDal dal = new ArticleDal(); List <Article> list = dal.GetArticle(entId, channel_Id, type); return(Json(new { success = true, list = list })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Article/GetArticle", ex.Message); return(Json(new { success = false, message = "文章/咨询加载失败!" })); } } }
/// <summary> /// 获取商城模板信息 /// </summary> /// <param name="entId">企业Id</param> /// <param name="htmlType">html页面类型</param> /// <returns></returns> public JsonResult HtmlTemplate(string entId) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } List <Template> list = new List <Template>(); Template t = new Template(); ////获取页面配置信息 TemplateDal dal_t = new TemplateDal(); t.List_Sz = dal_t.GetSystemBase(entId); //获取药品分类 ImgInfoDal dal_i = new ImgInfoDal(); t.List_Fl = dal_i.GetCategory(entId, 7); //底部资讯 ArticleDal dal_a = new ArticleDal(); t.List_Zx = dal_a.GetArticle(entId, 11, "Mt"); ///商品轮播图片 t.List_Lb = dal_i.GetImgInfo(10, "LB", entId, "PC", ""); list.Add(t); return(Json(new { success = true, list = list })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Template/HtmlTemplate", ex.Message.ToString()); return(Json(new { success = false, message = "模板信息加载失败!" })); } }
/// <summary> /// 博客浏览页 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Blog(int id) { ArticleDal.ArticlePvAdd(id); var article = ArticleDal.GetArticle(id); return(View(new BlogVM { Article = article })); }
public ActionResult BlogEditor(int id = noArticleId) { var labelList = ArticleDal.GetAllLabel(); if (id == noArticleId) { return(View(new BlogEditorVM { SelectLabelList = labelList })); } else { var article = ArticleDal.GetArticle(id); return(View(new BlogEditorVM { Article = article, SelectLabelList = labelList })); } }