Esempio n. 1
0
        public ActionResult Index(ArticlesViewModel model)
        {
            int totalItem;
            var allCategory = _artilesService.GetData(model.Title, model.PageIndex, model.PageSize, out totalItem, (int)TypeArticle.SanPham).ToList();

            model.TotalItem = totalItem;
            model.ListData  = allCategory;
            return(View(model));
        }
Esempio n. 2
0
        public ActionResult Index(int pageindex = 1)
        {
            var model     = new ArticleViewModel();
            int totalItem = 0;

            model.ListData    = _artilesService.GetData(pageindex, 10, out totalItem);
            model.TotalItem   = totalItem;
            model.PageIndex   = pageindex;
            model.ListMoiNhat = _artilesService.GetDataNew();
            var modelEmail = _configService.GetbyKey("email").Value;
            var modelPhone = _configService.GetbyKey("phone").Value;

            if (!string.IsNullOrEmpty(modelEmail))
            {
                ViewBag.email = modelEmail;
            }
            if (!string.IsNullOrEmpty(modelPhone))
            {
                ViewBag.phone = modelPhone;
            }
            return(View(model));
        }