Exemple #1
0
        public ActionResult AddArticle(int id = 0)
        {
            ViewBag.UserName = LoginUser.uRealName;
            TopicDetail Topic = new TopicDetail();

            ViewBag.topic = TopicServive.QueryWhere(a => !a.tIsDelete).ToList();
            if (id > 0)
            {
                Topic = TopicDetailServive.QueryWhere(a => a.Id == id).FirstOrDefault();
            }
            return(View(Topic));
        }
        public ActionResult ArticleDetail(int id = 0)
        {
            //获取控制器名称
            ViewBag.controllername = RouteData.Values["controller"].ToString().ToLower();
            int pagesize        = 6;
            var blogArticleList = TopicDetailServive.QueryWhere(a => !a.tdIsDelete && a.Id == id).FirstOrDefault();

            if (blogArticleList != null)
            {
                blogArticleList.tdRead++;
                TopicDetailServive.Edit(blogArticleList);
                TopicDetailServive.SaverChanges();
            }

            return(View(blogArticleList));
        }