/// <summary> /// Function to call from CashFlow /// </summary> public void CashflowCommonGridFill() { decimal decBalanceTotal = 0; try { AccountGroupSP spAccountGroup = new AccountGroupSP(); DataTable dtbl = new DataTable(); dtbl = spAccountGroup.CashflowAccountGroupWiseReportViewAll(decAccountGroupId, Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txtToDate.Text)); dgvAccountGroupWiseReport.DataSource = dtbl; if (dtbl.Rows.Count > 0) { for (int i = 0; i < dgvAccountGroupWiseReport.RowCount; i++) { decBalanceTotal += Convert.ToDecimal(dgvAccountGroupWiseReport.Rows[i].Cells["balance1"].Value.ToString()); } } if (decBalanceTotal < 0) { decBalanceTotal = -1 * decBalanceTotal; lblBalanceTotal.Text = decBalanceTotal.ToString() + "Cr"; } else { lblBalanceTotal.Text = decBalanceTotal.ToString() + "Dr"; } } catch (Exception ex) { MessageBox.Show("AGWREP09:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// /// </summary> /// <param name="decAccountGroupId"></param> /// <param name="dtmFromDate"></param> /// <param name="dtmToDate"></param> /// <returns></returns> public List <DataTable> CashflowAccountGroupWiseReportViewAll(decimal decAccountGroupId, DateTime dtmFromDate, DateTime dtmToDate) { List <DataTable> ListObj = new List <DataTable>(); try { ListObj = spAccountGroup.CashflowAccountGroupWiseReportViewAll(decAccountGroupId, dtmFromDate, dtmToDate); } catch (Exception ex) { MessageBox.Show("AG22:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(ListObj); }