private void btnExportStatement_Click(object sender, EventArgs e) { if (cbostation.SelectedValue.ToString() == "-1") { MessageBox.Show("Please select a station", "Client statement", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (!statement_start_date.Checked || !statement_end_date.Checked) { MessageBox.Show("Start and end dates are required", "Legacy Reports", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { LegacyReports.client_code = cboclient.SelectedValue.ToString(); LegacyReports.begin_date = dtPickerStart.Value; LegacyReports.end_date = dtPickerEnd.Value; StaffPayrollReports.reportType = "Legacy_Client_statement"; Guard_profiler.frm_staff_payroll_report_export Legacy_Client_statement_export = new Guard_profiler.frm_staff_payroll_report_export(); Legacy_Client_statement_export.ShowDialog(); } }
private void button1_Click(object sender, EventArgs e) { if (!dtPickerStart.Checked || !dtPickerEnd.Checked) { MessageBox.Show("Start and end dates are required", "Legacy Reports", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { switch (LegacyReports.reportType) { case "Legacy_DebtorsList": LegacyReports.station_code = cboBranch.SelectedValue.ToString(); LegacyReports.begin_date = dtPickerStart.Value; LegacyReports.end_date = dtPickerEnd.Value; StaffPayrollReports.reportType = "Legacy_DebtorsList"; Guard_profiler.frm_staff_payroll_report_export Legacy_DebtorsList_export = new Guard_profiler.frm_staff_payroll_report_export(); Legacy_DebtorsList_export.ShowDialog(); break; case "Legacy_income_and_expenditure_statement": LegacyReports.station_code = cboBranch.SelectedValue.ToString() != "-1"? cboBranch.SelectedValue.ToString().Remove(cboBranch.SelectedValue.ToString().Length - 1, 1):"-1"; LegacyReports.begin_date = dtPickerStart.Value; LegacyReports.end_date = dtPickerEnd.Value; StaffPayrollReports.reportType = "Legacy_income_and_expenditure_statement"; Guard_profiler.frm_staff_payroll_report_export Legacy_Client_statement_export = new Guard_profiler.frm_staff_payroll_report_export(); Legacy_Client_statement_export.ShowDialog(); break; case "Legacy_trial_balance": LegacyReports.station_code = cboBranch.SelectedValue.ToString().Remove(cboBranch.SelectedValue.ToString().Length - 1, 1); LegacyReports.begin_date = dtPickerStart.Value; LegacyReports.end_date = dtPickerEnd.Value; StaffPayrollReports.reportType = "Legacy_trial_balance"; Guard_profiler.frm_staff_payroll_report_export Legacy_trial_balance_export = new Guard_profiler.frm_staff_payroll_report_export(); Legacy_trial_balance_export.ShowDialog(); break; } } }