Example #1
0
        public ActionResult Category(int id)
        {
            int page = 1;

            if (Request.QueryString["page"] != null)
            {
                page = Convert.ToInt32(Request.QueryString["page"]);
            }
            AnperoService        sv = new AnperoService();
            SearchArticleResults s  = new SearchArticleResults();

            s = sv.SearchArticle(StoreID, TokenKey, id, page, 12, 0);
            ViewData["ArticleList"] = s;
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, s.ResultsCount, 11, "?page=");
            ViewBag.WebsiteUrl      = Request.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host + "/blog";
            if (id == 0)
            {
                ViewBag.CategoryName = "Blog";
                ViewBag.Title        = "Tin tức";
            }
            else
            {
                if (s.ItemList.Length > 0)
                {
                    ViewBag.Title        = s.ItemList[0].CategoryName;
                    ViewBag.CategoryName = s.ItemList[0].CategoryName;
                }
            }
            SetUpCommonArticle();
            return(View());
        }
        public ActionResult Category(int id)
        {
            int page = 1;

            if (Request.QueryString["page"] != null)
            {
                page = Convert.ToInt32(Request.QueryString["page"]);
            }
            AnperoService        sv = new AnperoService();
            SearchArticleResults s  = new SearchArticleResults();

            s = sv.SearchArticle(StoreID, TokenKey, id, page, 12, 0);
            ViewData["ArticleList"] = s;
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, s.ResultsCount, 11, "?page=");
            //seo
            ViewBag.Description = "Tin tức VinFish - Blog tin chia sẽ các bài viết liên quan đến sản phẩm của VinFish. Các kinh nghiệm, mẹo vắt lựa chọn thực phẩm sạch, cá sạch. Công thức chế biến các món ăn ngon, cá nướng ngon.";
            ViewBag.Keywords    = "Kinh nghiệm lựa chọn thực phẩm sạch, Kinh nghiệm lựa chọn cá sạch, Công thức nấu ăn.";
            ViewBag.WebsiteUrl  = Request.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host + "/blog";
            if (id == 0)
            {
                ViewBag.CategoryName = "Blog";
                ViewBag.Title        = "Tin tức | VinFish";
            }
            else
            {
                if (s.ItemList.Length > 0)
                {
                    ViewBag.Title        = s.ItemList[0].CategoryName;
                    ViewBag.CategoryName = s.ItemList[0].CategoryName;
                }
            }
            SetUpCommonArticle();
            return(View());
        }
Example #3
0
        public ActionResult Category(int id)
        {
            int page = 1;

            if (Request.QueryString["page"] != null)
            {
                page = Convert.ToInt32(Request.QueryString["page"]);
            }
            AnperoService        sv = new AnperoService();
            SearchArticleResults s  = new SearchArticleResults();

            s = sv.SearchArticle(StoreID, TokenKey, id, page, 12, 0);
            ViewData["ArticleList"] = s;
            ViewBag.page            = Anpero.Paging.setUpPagedV2(page, 14, s.ResultsCount, 11, "?page=");
            //seo

            if (id == 0)
            {
                ViewBag.CategoryName = "";
                ViewBag.Title        = "Tin tức";
            }
            else
            {
                if (s.ItemList.Length > 0)
                {
                    ViewBag.Title        = s.ItemList[0].CategoryName;
                    ViewBag.CategoryName = s.ItemList[0].CategoryName;
                }
            }
            ViewBag.Category = id;
            //  GetTopArticle();
            SetUpCommonArticle();
            return(View());
        }
        public ActionResult Index(int id)
        {
            SetUpCommonArticle();
            AnperoService ws = new AnperoService();
            BlogItem      rs = ws.GetArticleById(StoreID, TokenKey, id);

            ViewBag.Title           = rs.Title;
            ViewData["blogdeltail"] = rs;
            SearchArticleResults s = new SearchArticleResults();

            s = ws.SearchArticle(StoreID, TokenKey, rs.CategoryId, 1, 5, 0);
            ViewData["ArticleList"] = s;
            return(View());
        }
Example #5
0
        public ActionResult Index(int id)
        {
            SetUpCommonArticle();
            AnperoService ws = new AnperoService();
            BlogItem      rs = ws.GetArticleById(StoreID, TokenKey, id);

            ViewBag.Title           = rs.Title;
            ViewBag.WebsiteUrl      = Request.Url.Scheme + System.Uri.SchemeDelimiter + Request.Url.Host + Anpero.StringHelpper.GetArticleLink(rs.Title, rs.Id);
            ViewData["blogdeltail"] = rs;
            SearchArticleResults s = new SearchArticleResults();

            s = ws.SearchArticle(StoreID, TokenKey, rs.CategoryId, 1, 5, 0);
            ViewData["ArticleList"] = s;
            return(View());
        }