Exemplo n.º 1
0
        public ActionResult Video(int page = 1)
        {
            var objCategory = new CategoryController().GetCategoryBySlug("video", _isClearCache);

            if (objCategory == null || objCategory.CategoryId == -1)
            {
                Response.Redirect("/404/");
            }

            var pictures  = new VideoController().ListVideoByPaging(page, _pageSize, _isClearCache);
            var total     = pictures.Count > 0 ? pictures.FirstOrDefault().Total : 0;
            var totalPage = (total % _pageSize == 0) ? (total / _pageSize) : (total / _pageSize + 1);
            var paging    = new Paging()
            {
                Url       = "/video",
                Page      = page,
                TotalPage = totalPage
            };

            ViewBag.Page        = page;
            ViewBag.PageList    = paging.LoadPaging();
            ViewBag.BreadCrumb  = LoadBreadCrumb(objCategory);
            ViewBag.ObjCategory = objCategory;
            ViewBag.LineTitle   = "Video";

            return(MvcApplication.IsMobileMode() ? View("Video.M", pictures) : View(pictures));
        }
Exemplo n.º 2
0
        public ActionResult BoxQuestionAnswer()
        {
            var questionAnswers = new QuestionAnswerController().ListQuestionAnswerByArticle(0, 1, 10, _isClearCache);

            return(MvcApplication.IsMobileMode()
                ? PartialView("BoxQuestionAnswer.M", questionAnswers)
                : PartialView(questionAnswers));
        }
Exemplo n.º 3
0
        public ActionResult BoxCategory(int categoryId = 4)
        {
            var categorys = new CategoryController().ListCategoryByGroup(categoryId, _isClearCache);

            return(MvcApplication.IsMobileMode()
                ? PartialView("BoxCategory.M", categorys)
                : PartialView(categorys));
        }
Exemplo n.º 4
0
        public ActionResult BoxSponsor()
        {
            var sponsors = new SponsorController().ListSponsorByType(0, _isClearCache);

            return(MvcApplication.IsMobileMode()
                ? PartialView("BoxSponsor.M", sponsors)
                : PartialView(sponsors));
        }
Exemplo n.º 5
0
 public ActionResult Detail()
 {
     if (MvcApplication.IsMobileMode())
     {
         return(View("Detail.Mobile"));
     }
     return(View("Detail"));
 }
Exemplo n.º 6
0
 public ActionResult Index()
 {
     if (MvcApplication.IsMobileMode())
     {
         return(View("Index.Mobile"));
     }
     return(View("Index"));
 }
Exemplo n.º 7
0
        public ActionResult Category(string categorySlug = "", int page = 1)
        {
            var isMobile    = MvcApplication.IsMobileMode();
            var objCategory = new CategoryController().GetCategoryBySlug(categorySlug, _isClearCache);

            if (objCategory.CategoryId == -1)
            {
                return(Redirect("/404/"));
            }

            //Hiển thị bài chi tiết
            var articleCtrl = new TMV.Data.Entities.ArticleController();

            if (objCategory.IsShowDetail)
            {
                var objArticle = articleCtrl.GetArticleByCategorySlug(categorySlug, _isClearCache);
                if (objArticle == null || objArticle.ArticleId <= 0 || objArticle.CategorySlug != categorySlug)
                {
                    Response.Redirect("/404/");
                }

                var objBanner = new BannerController().GetBannerByCategoryId(objArticle.CategoryId, isMobile, _isClearCache);
                ViewBag.UrlPrice = objBanner != null && objBanner.BannerId > 0 ? objBanner.NavigationUrl : "/bang-gia/";

                ViewBag.ObjCategory = objCategory;
                ViewBag.BreadCrumb  = LoadBreadCrumb(objCategory);
                ViewBag.LineTitle   = objCategory.CategoryName;
                return(PartialView("Detail", objArticle));
            }

            //Hiển thị danh sách bài viết
            if (isMobile)
            {
                _pageSize = 10;
            }
            var articles = objCategory.ParentId <= 0
                ? articleCtrl.ListArticleByGroup(objCategory.CategoryId, objCategory.CategoryId, page, _pageSize, _isClearCache)
                : articleCtrl.ListArticleByCategory(objCategory.CategoryId, page, _pageSize, _isClearCache);

            var total     = articles.Count > 0 ? articles.FirstOrDefault().Total : 0;
            var totalPage = (total % _pageSize == 0) ? (total / _pageSize) : (total / _pageSize + 1);
            var paging    = new TMV.Utilities.Paging()
            {
                Url       = "/" + categorySlug,
                Page      = page,
                TotalPage = totalPage
            };

            ViewBag.Page        = page;
            ViewBag.PageList    = paging.LoadPaging();
            ViewBag.BreadCrumb  = LoadBreadCrumb(objCategory);
            ViewBag.ObjCategory = objCategory;
            ViewBag.LineTitle   = objCategory.CategoryName;

            return(View(articles));
        }
Exemplo n.º 8
0
        public ActionResult VideoDetail(string slug)
        {
            var objVideo = new VideoController().GetVideoBySlug(slug);

            if (objVideo == null)
            {
                Response.Redirect("/404/");
            }

            ViewBag.BreadCrumb = LoadBreadCrumbDetail("/video/", "Video", objVideo.NavigationUrl, objVideo.Title);
            return(MvcApplication.IsMobileMode() ? View("VideoDetail.M", objVideo) : View(objVideo));
        }
Exemplo n.º 9
0
        public ActionResult PictureDetail(string slug)
        {
            var objPicture = new PictureController().GetPictureBySlug(slug);

            if (objPicture == null)
            {
                Response.Redirect("/404/");
            }

            ViewBag.BreadCrumb = LoadBreadCrumbDetail("/hinh-anh/", "Hình ảnh", objPicture.NavigationUrl, objPicture.Title);
            return(MvcApplication.IsMobileMode() ? View("PictureDetail.M", objPicture) : View(objPicture));
        }
Exemplo n.º 10
0
        public ActionResult QADetail(string slug)
        {
            var objQA = new QuestionAnswerController().GetQuestionAnswerBySlug(slug, _isClearCache);

            if (objQA == null)
            {
                Response.Redirect("/404/");
            }

            var questionAnswers = new QuestionAnswerController().ListQuestionAnswerByArticle(objQA.ArticleId, 0, -1, _isClearCache);

            ViewBag.QuestionAnswers = questionAnswers;
            ViewBag.BreadCrumb      = LoadBreadCrumbDetail("/hoi-dap/", "Hỏi đáp", objQA.NavigationUrl, objQA.Title);
            return(MvcApplication.IsMobileMode() ? View("QADetail.M", objQA) : View(objQA));
        }
Exemplo n.º 11
0
        public ActionResult PriceDetail(string slug)
        {
            var objBanner = new BannerController().GetBannerBySlug(slug, _isClearCache);

            if (objBanner == null)
            {
                Response.Redirect("/404/");
            }

            var isMobile = MvcApplication.IsMobileMode();
            var prices   = new BannerController().ListBannerByPriority((byte)Globals.PriorityBanner.PriceList, _isClearCache);

            if (prices != null && prices.Count > 0)
            {
                prices = prices.Where(p => p.IsMobile == isMobile).ToList();
            }

            ViewBag.Prices     = prices;
            ViewBag.BreadCrumb = LoadBreadCrumbDetail("/bang-gia/", "Bảng giá", objBanner.NavigationUrl, objBanner.Title);
            return(View(objBanner));
        }
Exemplo n.º 12
0
        public ActionResult PriceList()
        {
            var objCategory = new CategoryController().GetCategoryBySlug("bang-gia", _isClearCache);

            if (objCategory == null || objCategory.CategoryId == -1)
            {
                Response.Redirect("/404/");
            }

            var isMobile = MvcApplication.IsMobileMode();
            var prices   = new BannerController().ListBannerByPriority((byte)Globals.PriorityBanner.PriceList, _isClearCache);

            if (prices != null && prices.Count > 0)
            {
                prices = prices.Where(p => p.IsMobile == isMobile).ToList();
            }

            ViewBag.BreadCrumb  = LoadBreadCrumb(objCategory);
            ViewBag.ObjCategory = objCategory;

            return(isMobile ? View("PriceList.M", prices) : View(prices));
        }
Exemplo n.º 13
0
 public ActionResult BoxFanpage()
 {
     return(MvcApplication.IsMobileMode()
         ? PartialView("BoxFanpage.M")
         : PartialView());
 }
Exemplo n.º 14
0
        public ActionResult BoxOtherVideo(int videoId)
        {
            var video = new VideoController().ListVideoByOther(videoId, 6, _isClearCache);

            return(MvcApplication.IsMobileMode() ? PartialView("BoxOtherVideo.M", video) : PartialView(video));
        }