//public ActionResult Details(int id)
        //{
        //    return View();
        //}

        public ActionResult TotalCostsByEngineerReport()
        {
            InterventionRepository iRepo = new InterventionRepository(new ApplicationDbContext());
            EngineerRepository     eRepo = new EngineerRepository();

            var interventions = iRepo.SelectAll();
            var engineers     = eRepo.GetEngineers();

            var report = new EngineerReport(interventions, engineers).Report;

            return(View(report));
        }
        // GET: Accountant
        public ActionResult Index()
        {
            EngineerRepository eRepo = new EngineerRepository();
            ManagerRepository  mRepo = new ManagerRepository();
            DistrictRepository dRepo = new DistrictRepository(new ApplicationDbContext());
            var accountantIndex      = new AccountantIndexViewModel
            {
                Engineers = eRepo.GetEngineers(),
                Managers  = mRepo.GetManagers(),
            };

            return(View(accountantIndex));
        }
        public EngineerReport()
        {
            var engineerReportsRepository = new EngineerRepository();

            Rows = new List <TotalCostByEngineerRow>();

            // populate rows
            foreach (var engineer in engineerReportsRepository.GetEngineers())
            {
                var row = new TotalCostByEngineerRow();
                row.Name       = engineer.Name;
                row.TotalHours = engineer.Hours ?? default(int);
                row.TotalCost  = engineer.Cost ?? default(decimal);

                Rows.Add(row);
            }

            // sort alphabetically
            Rows = Rows.OrderBy(o => o.Name).ToList();
        }