private void btnPayReport_Click(object sender, EventArgs e) { ReportTemplate report = null; DataTable dtPay = new DataTable(); if (cbPaySrchType.SelectedIndex == 0) { dtPay = service.getPaymentDataByRange (account.Id, dtpPayFrom.Value, dtpPayTo.Value); report = new DayRangeReport("Payment", dtpPayFrom.Value, dtpPayTo.Value, dtPay); } else if (cbPaySrchType.SelectedIndex == 2) { dtPay = service.getPaymentDataByMonth (account.Id, int.Parse(cbPayMonth.SelectedItem.ToString()), int.Parse(cbPayYear.SelectedItem.ToString())); report = new MonthlyReport("Payment", int.Parse(cbPayMonth.SelectedItem.ToString()), int.Parse(cbPayYear.SelectedItem.ToString()), dtPay); } else if (cbPaySrchType.SelectedIndex == 1) { dtPay = service.getPaymentDataByDate(account.Id, dtpPayFrom.Value); report = new DateReport("Payment", dtpPayFrom.Value, dtPay); } report.generateReport(); }
private void btnWdhReport_Click(object sender, EventArgs e) { DataTable dtWdh = service.getWithdrawalDataByMonth (account.Id, int.Parse(cbWdhMonth.SelectedItem.ToString()), int.Parse(cbWdhYear.SelectedItem.ToString())); MonthlyReport report = new MonthlyReport("Withdraw", int.Parse(cbWdhMonth.SelectedItem.ToString()), int.Parse(cbWdhYear.SelectedItem.ToString()), dtWdh); report.generateReport(); }
private void btnIncReport_Click(object sender, EventArgs e) { DataTable dtInc = null; ReportTemplate report = null; if (cbIncSrchType.SelectedIndex == 2) { dtInc = service.getIncomeDataByMonth (account.Id, int.Parse(cbIncMonth.SelectedItem.ToString()), int.Parse(cbIncYear.SelectedItem.ToString())); report = new MonthlyReport("Income", int.Parse(cbIncMonth.SelectedItem.ToString()), int.Parse(cbIncYear.SelectedItem.ToString()), dtInc); } else if (cbIncSrchType.SelectedIndex == 0) { dtInc = service.getIncomeDataByRange(account.Id, dtpIncFrom.Value, dtpIncTo.Value); report = new DayRangeReport("Income", dtpIncFrom.Value, dtpIncTo.Value, dtInc); } else if (cbIncSrchType.SelectedIndex == 1) { dtInc = service.getIncomeDataByDate(account.Id, dtpIncFrom.Value); report = new DateReport("Income", dtpIncFrom.Value, dtInc); } report.generateReport(); }