Ejemplo n.º 1
0
        private void tree_AttendanceReportRequested(TreeReport sender, AttendanceReportRequestEventArgs e)
        {
            var company = e.Company;
            var platoon = e.Platoon;

            // Report parameters:
            // START DATE: same as in tree report
            settings.startOfReport = sender.StartDate;
            // END DATE: same as in tree report
            settings.endOfReport = sender.EndDate;
            // REPORT TYPE: Attendance
            settings.reportType = ReportType.ATTENDANCE;

            settings.companyFilter = company;
            settings.platoonFilter = platoon;

            if (storedAttendanceTemplate != null)
            {
                settings.reportTemplate = storedAttendanceTemplate;
            }
            else
            {
                return;
            }

            if (GenerateReport())
            {
                saveReportButton_Click(null, null);
            }
            ;
        }
Ejemplo n.º 2
0
        private void OpenTreeReport()
        {
            if (treeReportForm != null)
            {
                Debug.Print("Tree report already open, will not open a new one");
                treeReportForm.BringToFront();
                treeReportForm.ShowPeople();

                return;
            }
            treeReportForm = new TreeReport(cardLogReader);
            treeReportForm.Show();

            // If the form closes, overwrite it with a null reference
            treeReportForm.FormClosed += (sender, args) => treeReportForm = null;

            treeReportForm.AttendanceReportRequested += tree_AttendanceReportRequested;

            treeReportForm.ShowPeople();
        }