Exemplo n.º 1
0
        public ActionResult Index(int page = 1, int page_size = 60)
        {
            var dao   = new tag_dao();
            var model = dao.ListAllPaging(page, page_size);

            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult SearchTag(string TagID, int page = 1, int pagesize = 12)
        {
            var content_dao  = new content_dao();
            var tag_dao      = new tag_dao();
            var result_tag   = tag_dao.CheckTag(TagID);
            int total_record = 0;
            var model        = content_dao.ListContent_By_TagID(ref total_record, TagID, page, pagesize);

            //check tag exist
            ViewBag.SearchTag = result_tag == true?tag_dao.Get_By_Id(TagID).name : "";


            // -- Xu ly phan trang
            ViewBag.Total = total_record;
            ViewBag.Page  = page;

            int MaxPage   = 3;
            int TotalPage = 0;

            TotalPage         = (int)Math.Ceiling(((double)total_record / (double)pagesize));
            ViewBag.TotalPage = TotalPage;
            ViewBag.MaxPage   = MaxPage;
            ViewBag.First     = 1;
            ViewBag.Last      = TotalPage;
            ViewBag.Next      = page + 1;
            ViewBag.Prev      = page - 1;
            // -- // phan trang

            return(View(model));
        }