private void btnShow_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { DataSet ds = new DataSet(); BusinessRules objBusinessRules = new BusinessRules(); ReportContainer frmReportContainer = new ReportContainer(); if (tabControl1.SelectedTab == tabControl1.TabPages[0]) { DateTime Registration_Date = dtpRegistrationDate.Value.Date; ds = objBusinessRules.getDailyCashReport(Registration_Date); frmReportContainer.ShowReport(ds, @"Reports\CashReports\DailyCashReport\rptDailyCashReport.rpt", "dtDailyCashReport"); frmReportContainer.Show(); } else { DateTime fromDate, toDate; if (rbThisYear.Checked) { fromDate = new DateTime(DateTime.Now.Year, 1, 1); toDate = new DateTime(DateTime.Now.Year, 12, 31); ds = objBusinessRules.getDailyCashReport(fromDate, toDate); } else if (rbLastYear.Checked) { fromDate = new DateTime(DateTime.Now.Year - 1, 1, 1); toDate = new DateTime(DateTime.Now.Year - 1, 12, 31); ds = objBusinessRules.getDailyCashReport(fromDate, toDate); } else { if (Convert.ToInt16(cbFromYear.SelectedItem) > Convert.ToInt16(cbToYear.SelectedItem)) { MessageBox.Show("From Year cannot be greater than To Year", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } fromDate = new DateTime(Convert.ToInt16(cbFromYear.SelectedItem), 1, 1); toDate = new DateTime(Convert.ToInt16(cbToYear.SelectedItem), 12, 31); ds = objBusinessRules.getDailyCashReport(fromDate, toDate); } frmReportContainer.ShowReport(ds, @"Reports\CashReports\DailyCashReport\rptDailyCashReport.rpt", "dtDailyCashReport"); frmReportContainer.Show(); } frmReportContainer = null; } catch (Exception ex) { MessageBox.Show("Error Occurred : \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }
private void btnSubmit_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { DataSet ds = new DataSet(); BusinessRules objBusinessRules = new BusinessRules(); ReportContainer frmReportContainer = new ReportContainer(); if (tabControl1.SelectedTab == tabControl1.TabPages[0]) { if (Convert.ToString(cbUserNames.SelectedValue) == "All") { ds = objBusinessRules.getExpenseReport(Convert.ToInt16(cbYear.SelectedItem), Convert.ToInt16(cbYear.SelectedItem)); } else { ds = objBusinessRules.getExpenseReport(User.Instance.User_Name, Convert.ToInt16(cbYear.SelectedItem), Convert.ToInt16(cbYear.SelectedItem)); } frmReportContainer.ShowReport(ds, @"Reports\ExpenseReport\rptExpenseReport_Userwise.rpt", "dtExpenseReport"); frmReportContainer.Show(); } else { if (rbThisYear.Checked) { ds = objBusinessRules.getExpenseReport(DateTime.Now.Year, DateTime.Now.Year); } else if (rbLastYear.Checked) { ds = objBusinessRules.getExpenseReport(DateTime.Now.Year - 1, DateTime.Now.Year - 1); } else { if (Convert.ToInt16(cbFromYear.SelectedItem) > Convert.ToInt16(cbToYear.SelectedItem)) { MessageBox.Show("From Year cannot be greater than To Year", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } ds = objBusinessRules.getExpenseReport(Convert.ToInt16(cbFromYear.SelectedItem), Convert.ToInt16(cbToYear.SelectedItem)); } frmReportContainer.ShowReport(ds, @"Reports\ExpenseReport\rptExpenseReport_Datewise.rpt", "dtExpenseReport"); frmReportContainer.Show(); } frmReportContainer = null; } catch (Exception ex) { MessageBox.Show("Error Occurred : \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }
private void btnShow_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { DataSet ds = new DataSet(); BusinessRules objBusinessRules = new BusinessRules(); ReportContainer frmReportContainer = new ReportContainer(); if (rbMonth.Checked) { ds = objBusinessRules.getBirthDateReport(BirthMonth: Convert.ToInt16(cbMonth.SelectedValue), ForReport: true); } else { ds = objBusinessRules.getBirthDateReport(BirthDate: dateTimePicker1.Value.Date, ForReport: true); } frmReportContainer.ShowReport(ds, @"Reports\Other Reports\BirthdateReport\rptBirthDateReport.rpt", "dtBirthDate"); frmReportContainer.Show(); frmReportContainer = null; } catch (Exception ex) { MessageBox.Show("Error Occurred : \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }
private void btnSubmit_Click(object sender, EventArgs e) { if (!Authenticate()) { return; } this.Cursor = Cursors.WaitCursor; try { DateTime strYatraDate = dtpNavratriDate.Value.Date; string BusNo = cbBus.Items[cbBus.SelectedIndex].ToString(); DataSet ds = new DataSet(); BusinessRules objBusinessRules = new BusinessRules(); ds = objBusinessRules.getEmptySeats(strYatraDate, BusNo); ReportContainer frmReportContainer = new ReportContainer(); frmReportContainer.ShowReport(ds, @"Reports\EmptySeatsReport\rptEmptySeats.rpt", "dtEmptySeats"); frmReportContainer.Show(); frmReportContainer = null; } catch (Exception ex) { MessageBox.Show("Error Occurred : \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }
private void btnShowReport_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { using (DataSet ds = objBusinessRules.GetElectionReport(Convert.ToInt16(cbArea.SelectedValue))) { ReportContainer frmReportContainer = new ReportContainer(); frmReportContainer.ShowReport(ds, @"Reports\ElectionReport\rptElectionReport.rpt", "dtElectionReport"); frmReportContainer.Show(); frmReportContainer = null; } } catch (Exception ex) { MessageBox.Show("Error Occurred : \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }
private void btnSubmit_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { DateTime YatraDateFrom = dtpNavratriDateFrom.Value.Date; DateTime YatraDateTo = dtpNavratriDateTo.Value.Date; DataSet ds = new DataSet(); BusinessRules objBusinessRules = new BusinessRules(); ds = objBusinessRules.getAllYatraDatesAllBusesCashReport(YatraDateFrom, YatraDateTo); ReportContainer frmReportContainer = new ReportContainer(); frmReportContainer.ShowReport(ds, @"Reports\CashReports\AllYatraAllYatraDatesReport\rptAllYatraDatesAllBuses.rpt", "dtAllYatraDatesAllBusesCashReport"); frmReportContainer.Show(); frmReportContainer = null; } catch (Exception ex) { MessageBox.Show("Error Occurred : \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }
private void btnShow_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { DataSet ds = new DataSet(); BusinessRules objBusinessRules = new BusinessRules(); ReportContainer frmReportContainer = new ReportContainer(); ds = objBusinessRules.getBloodGroupReport(cbBloodGroup.SelectedItem.ToString()); frmReportContainer.ShowReport(ds, @"Reports\Other Reports\Bloodgroup\rptBloodGroupReport.rpt", "dtBloodGroup"); frmReportContainer.Show(); frmReportContainer = null; } catch (Exception ex) { MessageBox.Show("Error Occurred : \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }
private void btnShow_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; try { DataSet ds = new DataSet(); BusinessRules objBusinessRules = new BusinessRules(); ReportContainer frmReportContainer = new ReportContainer(); ds = objBusinessRules.getUserwiseTickets(Convert.ToString(cbUserNames.SelectedValue)); frmReportContainer.ShowReport(ds, @"Reports\TicketReports\UserwiseTicketReport\rptUserwiseTicketReport.rpt", "dtUserwiseTicketReport"); frmReportContainer.Show(); frmReportContainer = null; } catch (Exception ex) { MessageBox.Show("Error Occurred : \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { this.Cursor = Cursors.Default; } }