//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));
        }
        public ActionResult CostsByDistrictReport()
        {
            var context = new ApplicationDbContext();
            InterventionRepository interventionRepo = new InterventionRepository(context);
            var districtRepo = new Repository <District>(context);

            var interventions = interventionRepo.SelectAll();
            var districts     = districtRepo.SelectAll();

            var reports = new DistrictReport(interventions, districts);

            return(View(reports));
        }
        protected void GetTotalCostByMonth_Click(object sender, EventArgs e)
        {
            AccountantReportMaker  accInstance = new AccountantReportMaker();
            InterventionRepository accDataBank = new InterventionRepository();
            List <Intervention>    accData     = accDataBank.GetListAcc();

            DataTable reportTableData = accInstance.GetTotalCostForEachMonth(accData);

            for (int i = 0; i < reportTableData.Rows.Count; i++)
            {
                TableRow  t1 = new TableRow();
                TableCell c1 = new TableCell();
                TableCell c2 = new TableCell();
                TableCell c3 = new TableCell();
                c1.Text = reportTableData.Rows[i][0].ToString();
                c2.Text = reportTableData.Rows[i][1].ToString();
                c3.Text = reportTableData.Rows[i][2].ToString();
                t1.Cells.Add(c1);
                t1.Cells.Add(c2);
                t1.Cells.Add(c3);
                ReportOut.Rows.Add(t1);
            }
        }
        protected void GetReport_Click(object sender, EventArgs e)
        {
            Decimal totalCost = 0;
            AccountantReportMaker  accInstance = new AccountantReportMaker();
            InterventionRepository accDataBank = new InterventionRepository();

            List <Intervention> accData = accDataBank.GetListAcc();

            DataTable reportTableData = accInstance.GetTotalCostForDistricts(accData, ref totalCost);

            for (int i = 0; i < reportTableData.Rows.Count; i++)
            {
                TableRow  t1 = new TableRow();
                TableCell c1 = new TableCell();
                TableCell c2 = new TableCell();
                c1.Text = reportTableData.Rows[i][0].ToString();
                c2.Text = reportTableData.Rows[i][1].ToString();
                t1.Cells.Add(c1);
                t1.Cells.Add(c2);
                ReportOut.Rows.Add(t1);
            }

            TotalCostOut.Text = "Total Cost:" + (totalCost.ToString());
        }