示例#1
0
        // GET: Dashboard
        public ActionResult Index()
        {
            var orders             = _op.GetAll();
            var totalIncome        = orders.Sum(o => o.TotalPrice);
            var currentMonthIncome = orders.Where(x => x.OrderDate.Month == DateTime.Now.Month).Sum(o => o.TotalPrice);

            var vm = new IndexViewModel {
                TotalIncome = totalIncome, CurrentMonthIncome = currentMonthIncome, PendingClaims = 6, TasksProgress = 72
            };

            return(View(vm));
        }