Example #1
0
 /// <summary>
 /// 根据ID获取文章详情
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult Detail(string id)
 {
     try
     {
         int cid = 0;
         int.TryParse(id, out cid);
         if (cid == 0)
         {
             return(Content(""));
         }
         UserBLL      bll    = new UserBLL();
         ContentBLL   cbll   = new ContentBLL();
         int          addsee = cbll.AddSee(cid);
         ContentModel model  = bll.GetContentById(cid);
         if (model == null)
         {
             return(Content(""));
         }
         return(View(model));
     }
     catch (Exception ex)
     {
         Log.WriteFile(ex);
         return(new EmptyResult());
     }
 }
Example #2
0
        //
        // GET: /Content/


        /// <summary>
        /// 新增查看数
        /// </summary>
        /// <returns></returns>
        public string AddSee()
        {
            try
            {
                int        cid = Convert.ToInt32(Request["contentId"]);
                ContentBLL bll = new ContentBLL();
                int        res = bll.AddSee(cid);
                if (res > 0)
                {
                    return("success");
                }
                return("failure");
            }
            catch (Exception ex)
            {
                Log.WriteFile(ex);
                return("failure");
            }
        }