Exemple #1
0
 public int Like(string id)
 {
     tb_Article articleModel = new tb_Article();
     articleModel=ArticleBll.getModel(p=>p.Id==id);
     articleModel.LikeNum++;
     return ArticleBll.Edit(articleModel)?1:0;
 }
Exemple #2
0
 /// <summary>
 /// 详情页
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult Detailed(string id)
 {
     tb_Article articleModel = new tb_Article();
     articleModel = ArticleBll.getModel(p => p.Id == id);
     articleModel.ReadNum++;
     ArticleBll.Edit(articleModel);
     view_Article article = new view_Article();
     article = vArticleBll.getModel(p => p.Id == id);
     return View(article);
 }
Exemple #3
0
 public int Save(tb_Article article)
 {
     try
     {
         if (article != null)
         {
             article.Id = Guid.NewGuid().ToString();
             article.Date = DateTime.Now;
             if (ArticleBll.Save(article))
             {
                 return 1;
             }
         }
         return 0;
     }
     catch (Exception e)
     {
         throw e;
     }
 }