예제 #1
0
 public ViewResult About()
 {
     var modelView = new MainPageViewModel()
     {
         Abouts = _aboutRepository.GetAbout()
     };
     return View(modelView);
 }
예제 #2
0
 public virtual ActionResult Index()
 {
     var model = new MainPageViewModel
     {
         Contacts = _contactRepository.GetContact()
     };
     return View(model);
 }
예제 #3
0
        public ActionResult Browse(int id)
        {
            var model = new MainPageViewModel
            {
                Categories = _categoryRepository.GetAllCategoryById(id)
            };

            return View(model);
        }
예제 #4
0
        public virtual ActionResult NavigationAbout()
        {
            var model = new MainPageViewModel
            {
                Abouts = _aboutRepository.GetAbout().ToList()
            };

            return PartialView(model);
        }
예제 #5
0
        public virtual ActionResult NavigationCategory()
        {
            var model = new MainPageViewModel
            {
                Categories = _repositoryCategory.GetCategories().ToList()
            };

            return PartialView(model);
        }
예제 #6
0
        public virtual ActionResult Index()
        {
            var model = new MainPageViewModel
            {
                Categories = _repositoryCategory.GetCategories().ToList()

            };

            return View(model);
        }
예제 #7
0
        public virtual ActionResult Index()
        {
            var model = new MainPageViewModel
            {
                Categories = _categoryRepository.GetCategories().ToList(),

                Abouts = _aboutRepository.GetAbout().Take(1).ToList(),

                About = _aboutRepository.GetAboutById(1)

            };

            return View(model);
        }
예제 #8
0
        public ActionResult Browse(int id, int page = 1)
        {
            var model = new MainPageViewModel
            {
                Products = _productRepository.GetAllProductById(id).Where(x => x.CategoryId == id).ToList(),

                PagingInfo = new PagingInfo
            {
                CurrentPage = page,
                ItemsPerPage = PageSize,
                TotalItems = _productRepository.GetQueryProducts.Count()
            }
            };
            return View(model);
        }
예제 #9
0
        public virtual ActionResult Index(string category, int page = 1)
        {
            var model = new MainPageViewModel
            {
                Categories = _categoryRepository.GetCategories().ToList(),

                Products = _productRepository.GetQueryProducts
                    .Where(p => category == null)
                    .OrderBy(p => p.ProductId)
                    .Skip((page - 1) * PageSize)
                    .Take(PageSize),

                PagingInfo = new PagingInfo
                {
                    CurrentPage = page,
                    ItemsPerPage = PageSize,
                    TotalItems = _productRepository.GetQueryProducts.Count()
                },
                CurrentCategory = category
            };

            return View(model);
        }
예제 #10
0
        public ViewResult Index()
        {
            var modelView = new MainPageViewModel()
            {
                Products = _productRepository.GetProducts()
            };

            return View(modelView);
        }