예제 #1
0
        public async Task <IActionResult> PostCatalog(int id, string cate_slug, int?pageSize, int page = 1)
        {
            if (pageSize == null)
            {
                pageSize = Ultilities.Common.GetByKey("pageSize").MapInt();
            }
            //ViewBag.DanhMuc = HomeService.Instance.DanhMucbySlug(cate_slug);
            var catalog = new NewsCategoriesViewModels();

            catalog.PageSize = pageSize;
            catalog.Data     = await newDAL.GetListNewsbyCates(id, page, pageSize.MapInt());

            var resultDm = await dmDAL.GetSignlebyId(id);

            catalog.Category = resultDm;
            if (catalog.Data.Results == null || catalog.Data.Results.Count == 0)
            {
                return(RedirectToAction("NotFound", "Common"));
            }
            else
            if (resultDm.Type == 0)
            {
                return(View(catalog));
            }
            else
            {
                return(View("PostCatalogVertical", catalog));
            }
        }