Exemple #1
0
 public void BankReconciliationDelete(decimal ReconcileId)
 {
     try
     {
         SpBankReconciliation.BankReconciliationDelete(ReconcileId);
     }
     catch (Exception ex)
     {
         MessageBox.Show("BR:6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #2
0
 /// <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);
     }
 }