Ejemplo n.º 1
0
        public IActionResult Index()
        {
            var dashboard = new DashboardViewModel
            {
                Customers      = customerRepository.All().Count(),
                Products       = _productRepository.All().Count(),
                TotalSales     = saleRepository.All().Count(),
                TotalSaleValue = saleRepository.All().Sum(x => x.GrandTotal),
                LastFiveSales  = saleRepository.All().OrderByDescending(x => x.SalesDate).Take(5).ToList()
            };

            return(View(dashboard));
        }
Ejemplo n.º 2
0
 public IActionResult Index()
 {
     return(View(saleRepository.All()));
 }