Example #1
0
        public IActionResult Add(int?Id)
        {
            ViewBag.CategoryList = _CategoryDAL.GetList();
            var Blog = new BLOG();

            if (Id != null)
            {
                Blog = _BlogDAL.GetOne(Id.Value);
            }
            return(View(Blog));
        }
Example #2
0
 public IActionResult ShowBlogDetails(int?Id)
 {
     ViewBag.CategoryList = _CATEGORYDAL.GetList();
     ViewBag.BlogDAL      = _BlogDAL;
     if (Id == null)
     {
         return(Content("找不到该条博客数据!"));
     }
     else
     {
         BLOG bLOG = _BlogDAL.GetOne(Id.Value);
         if (bLOG == null)
         {
             return(Content("找不到该条博客数据!"));
         }
         bLOG.Visit += 1;
         _BlogDAL.Update(bLOG);
         return(View(bLOG));
     }
 }