/// <summary> /// Function to fill the grid /// </summary> public void AccountLedgerReportFill() { decimal decTotalClosing = 0; AccountLedgerSP SpAccountLedger = new AccountLedgerSP(); try { dgvAccountLedgerReport.DataSource = SpAccountLedger.AccountLedgerReportFill(Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text), Convert.ToDecimal(cmbAccountGroup.SelectedValue.ToString()), Convert.ToDecimal(cmbAccountLedger.SelectedValue.ToString())); if (dgvAccountLedgerReport.RowCount > 0) { for (int i = 0; i < dgvAccountLedgerReport.RowCount; i++) { decTotalClosing = decTotalClosing + Convert.ToDecimal(dgvAccountLedgerReport.Rows[i].Cells["dgvtxtClosing1"].Value.ToString()); } } if (decTotalClosing < 0) { decTotalClosing = -1 * decTotalClosing; lblTotalAmount.Text = decTotalClosing.ToString() + "Cr"; } else { lblTotalAmount.Text = decTotalClosing.ToString() + "Dr"; } } catch (Exception ex) { MessageBox.Show("ALREP4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public List <DataTable> AccountLedgerReportFill(DateTime dtFromDate, DateTime dtToDate, decimal decAccountGroupId, decimal decLedgerId) { List <DataTable> ListObj = new List <DataTable>(); try { ListObj = spAccountLedger.AccountLedgerReportFill(dtFromDate, dtToDate, decAccountGroupId, decLedgerId); } catch (Exception ex) { MessageBox.Show("AL36:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(ListObj); }