public void BankReconciliationEdit(BankReconciliationInfo bankreconciliationinfo) { try { SpBankReconciliation.BankReconciliationEdit(bankreconciliationinfo); } catch (Exception ex) { MessageBox.Show("BR:4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Checking invalid entries for Save or Update and Save and Update function /// </summary> public void saveOrEdit() { try { BankReconciliationInfo infoBankReconciliation = new BankReconciliationInfo(); BankReconciliationSP spBankReconciliation = new BankReconciliationSP(); foreach (DataGridViewRow dgv in dgvBankReconciliation.Rows) { if (dgv.Cells["dgvtxtStatementDate"].Value != null && Convert.ToDecimal(dgv.Cells["dgvtxtLedgerPostingId"].Value.ToString()) != 0 && dgv.Cells["dgvtxtStatementDate"].Value.ToString() != string.Empty) { infoBankReconciliation.LedgerPostingId = decimal.Parse(dgv.Cells["dgvtxtLedgerPostingId"].Value.ToString()); infoBankReconciliation.StatementDate = Convert.ToDateTime((dgv.Cells["dgvtxtStatementDate"].Value.ToString())); infoBankReconciliation.Extra1 = string.Empty; infoBankReconciliation.Extra2 = string.Empty; infoBankReconciliation.ExtraDate = PublicVariables._dtCurrentDate; decimal decReconcileId = spBankReconciliation.BankReconciliationLedgerPostingId(Convert.ToDecimal(dgv.Cells["dgvtxtLedgerPostingId"].Value.ToString())); if (decReconcileId != 0) { infoBankReconciliation.ReconcileId = decReconcileId; spBankReconciliation.BankReconciliationEdit(infoBankReconciliation); } else { spBankReconciliation.BankReconciliationAdd(infoBankReconciliation); } } else { if (Convert.ToDecimal(dgv.Cells["dgvtxtLedgerPostingId"].Value.ToString()) != 0) { decimal decReconcileId = spBankReconciliation.BankReconciliationLedgerPostingId(Convert.ToDecimal(dgv.Cells["dgvtxtLedgerPostingId"].Value.ToString())); if (decReconcileId != 0) { spBankReconciliation.BankReconciliationDelete(decReconcileId); } } } } } catch (Exception ex) { MessageBox.Show("BR:4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }