Example #1
0
        private void UIButtonCreatePOReport_Click_1(object sender, EventArgs e)
        {
            List <string> employeeListToCheck = new List <string>();

            employeeListToCheck = UINameList.CheckedItems.OfType <string>().ToList();
            List <string> selectedDatesF = new List <string>();

            selectedDatesF = DateRangeToList(UIdateTimePickerStart.Value.Date, UIdateTimePickerEnd.Value.Date);
            MessageBox.Show(UIdateTimePickerStart.Value.Date.ToShortDateString() + "  " + UIdateTimePickerEnd.Value.Date.ToShortDateString());
            //prepares the list of user to check, other user will not be taken into consideration
            Logger logger = new Logger();
            Writer writer = new Writer(logger);

            writer.SetFilename("PO_report_" + DateTime.Today.ToShortDateString().Replace("\\", "_"));
            writer.SetPath(textBoxPath.Text);
            ReportReader ReportReader = new ReportReader(logger);

            logger.passMsgToDisplay += OnMsgToDisplay;
            //logger.LogOnScreen("Start");
            ReportReader.LoadReports(textBoxTracker.Text, textBoxEmp.Text);
            DataAnalyzer dataAnalyzer = new DataAnalyzer(ReportReader.EmpRecords, ReportReader.TrackerRecords, employeeListToCheck, selectedDatesF, logger, writer);

            dataAnalyzer.CreatePOReport();
        }
Example #2
0
        private void UIButtonCompareEMPnTRA_Click(object sender, EventArgs e)
        {
            List <string> employeeListToCheck = new List <string>();

            employeeListToCheck = UINameList.CheckedItems.OfType <string>().ToList();
            List <string> selectedDates = new List <string>();

            selectedDates = DateRangeToList(UIdateTimePickerStart.Value.Date, UIdateTimePickerEnd.Value.Date);
            Logger logger = new Logger();
            Writer writer = new Writer(logger);

            writer.SetFilename("Comparison_report_" + DateTime.Today.ToShortDateString().Replace("\\", "_"));
            writer.SetPath(textBoxPath.Text);
            ReportReader ReportReader = new ReportReader(logger);

            logger.passMsgToDisplay += OnMsgToDisplay;
            //logger.LogOnScreen("Start");
            ReportReader.LoadReports(textBoxTracker.Text, textBoxEmp.Text);
            DataAnalyzer dataAnalyzer = new DataAnalyzer(ReportReader.EmpRecords, ReportReader.TrackerRecords, employeeListToCheck, selectedDates, logger, writer);

            //dataAnalyzer.test_2();

            dataAnalyzer.CompareEmpAndTra();
        }