예제 #1
0
        public ActionResult GetPageListJson(Pagination pagination, string queryJson)
        {
            var watch = CommonHelper.TimerStart();
            HealthAticleEntity para = new HealthAticleEntity();

            if (!string.IsNullOrWhiteSpace(queryJson))
            {
                var queryParam = queryJson.ToJObject();
                if (!queryParam["LanguageKey"].IsEmpty())
                {
                    para.LanguageKey = queryParam["LanguageKey"].ToString();
                }
                if (!queryParam["keyword"].IsEmpty())
                {
                    para.Title = queryParam["keyword"].ToString();
                }
            }
            para.HealthClassId = ((int)WebSiteCMS.Model.Enums.ActiceType.儿童保健).ToString();
            var pageList = HealthAticleBLL.Instance.GetPageList(para, ref pagination);
            var JsonData = new
            {
                rows     = pageList,
                total    = pagination.total,
                page     = pagination.page,
                records  = pagination.records,
                costtime = CommonHelper.TimerEnd(watch)
            };

            return(Content(JsonData.ToJson()));
        }
예제 #2
0
 public ActionResult SaveForm(string keyValue, HealthAticleEntity entity)
 {
     try
     {
         entity.Content = entity.Content == null ? "" : entity.Content.Replace("&amp;", "&").Replace("&gt;", ">").Replace("&lt;", "<");
         if (keyValue == "")
         {
             //新增
             entity.HealthAticleId = Util.Util.NewUpperGuid();
             entity.HealthClassId  = ((int)WebSiteCMS.Model.Enums.ActiceType.儿童保健).ToString();
             entity.CreateTime     = DateTime.Now;
             HealthAticleBLL.Instance.Add(entity);
         }
         else
         {
             entity.HealthAticleId = keyValue;
             HealthAticleBLL.Instance.Update(entity);
         }
         return(Success("操作成功。"));
     }
     catch (Exception ex)
     {
         return(Error("操作失败。"));
     }
 }
예제 #3
0
        public ActionResult SaveChangeLgForm(string keyValue, HealthAticleEntity entity)
        {
            try
            {
                entity.Content = entity.Content == null ? "" : entity.Content.Replace("&amp;", "&").Replace("&gt;", ">").Replace("&lt;", "<");
                if (keyValue != "")
                {
                    //新增
                    var model = HealthAticleBLL.Instance.GetEntity(keyValue);
                    if (model != null)
                    {
                        if (model.LanguageKey == entity.LanguageKey)
                        {
                            return(Error("该语言已存在"));
                        }
                    }
                    entity.HealthAticleId = Util.Util.NewUpperGuid();
                    entity.HealthClassId  = ((int)WebSiteCMS.Model.Enums.ActiceType.儿童保健).ToString();
                    entity.CreateTime     = DateTime.Now;
                    HealthAticleBLL.Instance.Add(entity);
                }

                return(Success("操作成功。"));
            }
            catch (Exception ex)
            {
                return(Error("操作失败。"));
            }
        }
예제 #4
0
        public ActionResult GetClassList(string type)
        {
            HealthAticleEntity para = new HealthAticleEntity();

            para.LanguageKey   = CurrentLanguge.LanguageKey;
            para.HealthClassId = type;
            var list = HealthAticleBLL.Instance.GetList(para).OrderBy((o) => o.CreateTime).ToList();

            return(Content(list.ToJson()));
        }