예제 #1
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));
        }