public List <DataTable> BankReconciliationUnrecocile(decimal decLedgerId, DateTime dtFromDate, DateTime dtToDate) { List <DataTable> listObj = new List <DataTable>(); try { listObj = SpBankReconciliation.BankReconciliationUnrecocile(decLedgerId, dtFromDate, dtToDate); } catch (Exception ex) { MessageBox.Show("BR:2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(listObj); }
/// <summary> /// BankReconciliation Grid Fill function /// </summary> public void BankReconciliationFill() { try { BankReconciliationInfo infoBankReconciliation = new BankReconciliationInfo(); BankReconciliationSP spBankReconciliation = new BankReconciliationSP(); dgvBankReconciliation.Rows.Clear(); DataTable dtblBank = new DataTable(); if (cmbBankAccount.SelectedIndex > -1) { if (cmbStatus.Text == "Reconciled") { dtblBank = spBankReconciliation.BankReconciliationFillReconcile(Convert.ToDecimal(cmbBankAccount.SelectedValue.ToString()), Convert.ToDateTime(txtStatementFrom.Text), Convert.ToDateTime(txtStatementTo.Text)); if (dtblBank.Rows.Count > 0) { for (int i = 0; i < dtblBank.Rows.Count; i++) { dgvBankReconciliation.Rows.Add(); dgvBankReconciliation.Rows[i].Cells["dgvtxtSlNo"].Value = dtblBank.Rows[i]["Sl No"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtDate"].Value = dtblBank.Rows[i]["date"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtParticular"].Value = dtblBank.Rows[i]["ledgerName"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtVoucherType"].Value = dtblBank.Rows[i]["voucherTypeName"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtVoucherNo"].Value = dtblBank.Rows[i]["voucherNo"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtChequeNo"].Value = dtblBank.Rows[i]["chequeNo"].ToString(); dgvBankReconciliation.Rows[i].Cells["dgvtxtChequeDate"].Value = dtblBank.Rows[i]["chequeDate"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtDeposit"].Value = dtblBank.Rows[i]["debit"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtWithdraw"].Value = dtblBank.Rows[i]["credit"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtStatementDate"].Value = dtblBank.Rows[i]["statementDate"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtLedgerPostingId"].Value = dtblBank.Rows[i]["ledgerPostingId"]; } } } else { dtblBank = spBankReconciliation.BankReconciliationUnrecocile(Convert.ToDecimal(cmbBankAccount.SelectedValue.ToString()), Convert.ToDateTime(txtStatementFrom.Text), Convert.ToDateTime(txtStatementTo.Text)); if (dtblBank.Rows.Count > 0) { for (int i = 0; i < dtblBank.Rows.Count; i++) { dgvBankReconciliation.Rows.Add(); dgvBankReconciliation.Rows[i].Cells["dgvtxtSlNo"].Value = dtblBank.Rows[i]["Sl No"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtDate"].Value = dtblBank.Rows[i]["date"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtParticular"].Value = dtblBank.Rows[i]["ledgerName"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtVoucherType"].Value = dtblBank.Rows[i]["voucherTypeName"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtVoucherNo"].Value = dtblBank.Rows[i]["voucherNo"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtChequeNo"].Value = dtblBank.Rows[i]["chequeNo"].ToString(); dgvBankReconciliation.Rows[i].Cells["dgvtxtChequeDate"].Value = dtblBank.Rows[i]["chequeDate"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtDeposit"].Value = dtblBank.Rows[i]["debit"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtWithdraw"].Value = dtblBank.Rows[i]["credit"]; dgvBankReconciliation.Rows[i].Cells["dgvtxtStatementDate"].Value = string.Empty; dgvBankReconciliation.Rows[i].Cells["dgvtxtLedgerPostingId"].Value = dtblBank.Rows[i]["ledgerPostingId"]; } } } } } catch (Exception ex) { MessageBox.Show("BR:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }