Exemple #1
0
 /// <summary>
 /// 编辑
 /// </summary>
 /// <param name="_NewsInfoVM"></param>
 /// <returns></returns>
 public ActionResult Edit(NewsInfoVM _NewsInfoVM)
 {
     _NewsInfoVM.NewsInfo       = _newsInfoService.GetById(_NewsInfoVM.Id) ?? new NewsInfo();
     _NewsInfoVM.ImgInfo        = _imageInfoService.GetById(_NewsInfoVM.NewsInfo.ImageInfoId) ?? new ImageInfo();
     _NewsInfoVM.NewsCategories = _newsCategoryService.GetAll();
     return(View(_NewsInfoVM));
 }
Exemple #2
0
        public IHttpActionResult GetNewsReads(int NewsInfoId)
        {
            var model = _newsInfoService.GetById(NewsInfoId);

            if (model != null)
            {
                model.Reads = +1;
                _newsInfoService.Update(model);
            }
            return(Json(new { Success = true, Msg = "OK", Data = model.Reads }));
        }