Exemple #1
0
        public AboutCustomerVm GetCustomerById(int id)
        {
            Customer customer  = Data.Data.Context.Customers.Find(id);
            var      viewModel = new AboutCustomerVm()
            {
                Name            = customer.Name,
                BoughtCarsCount = customer.Sales.Count,
                TotalSpentMoney = customer.Sales.Sum(s => s.Car.Parts.Sum(p => p.Price))
            };

            return(viewModel);
        }
Exemple #2
0
        public ActionResult About(int id)
        {
            AboutCustomerVm vm = this.business.GetCustomerWithCarData(id);

            return(this.View(vm));
        }
Exemple #3
0
        public ActionResult About(int id)
        {
            AboutCustomerVm viewModels = this.service.GetCustomerById(id);

            return(this.View(viewModels));
        }