コード例 #1
0
        public ActionResult Index()
        {
            //ViewBag.CatNames = TempData["GetCatNames"];
            ////ViewBag.CatNames = "apple";
            var m = new CategoryPostModel();

            m.CatList   = repCategory.Read().ToList();
            m.PostList  = repPost.Read().ToList();
            m.TopicList = repTopic.Read().ToList();
            // Top = repTopic.Read().ToList();


            return(View(m));
        }
コード例 #2
0
        public ActionResult Index(int id, int page = 1)
        {
            ViewBag.Items = 10;
            ViewBag.Page  = page;

            int start = (page - 1) * ViewBag.Items;
            int stop  = start + ViewBag.Items;

            TopicModel topic = repository.Read(id, start, stop);

            if (topic == null)
            {
                throw new HttpException(404, "Topic could not be found.");
            }
            topic.Id = id;
            return(View(topic));
        }
コード例 #3
0
        // GET: Topics
        public ActionResult Index()
        {
            var tp = new TopicPostViewModel();

            tp.TopicList = repTopic.Read().ToList();
            tp.PostList  = repPost.Read().ToList();
            return(View(tp));
        }