/// <summary>
 /// Function to insert values to BankReconciliation Table
 /// </summary>
 /// <param name="bankreconciliationinfo"></param>
 public void BankReconciliationAdd(BankReconciliationInfo bankreconciliationinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("BankReconciliationAdd", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@ledgerPostingId", SqlDbType.Decimal);
         sprmparam.Value = bankreconciliationinfo.LedgerPostingId;
         sprmparam = sccmd.Parameters.Add("@statementDate", SqlDbType.DateTime);
         sprmparam.Value = bankreconciliationinfo.StatementDate;
         sprmparam = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime);
         sprmparam.Value = bankreconciliationinfo.ExtraDate;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = bankreconciliationinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = bankreconciliationinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
 public void BankReconciliationEdit(BankReconciliationInfo bankreconciliationinfo)
 {
     try
     {
         SpBankReconciliation.BankReconciliationEdit(bankreconciliationinfo);
     }
     catch (Exception ex)
     {
         MessageBox.Show("BR:4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to get particular values from account BankReconciliation based on the parameter
 /// </summary>
 /// <param name="reconcileId"></param>
 /// <returns></returns>
 public BankReconciliationInfo BankReconciliationView(decimal reconcileId)
 {
     BankReconciliationInfo bankreconciliationinfo = new BankReconciliationInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("BankReconciliationView", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@reconcileId", SqlDbType.Decimal);
         sprmparam.Value = reconcileId;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             bankreconciliationinfo.ReconcileId = decimal.Parse(sdrreader[0].ToString());
             bankreconciliationinfo.LedgerPostingId = decimal.Parse(sdrreader[1].ToString());
             bankreconciliationinfo.StatementDate = DateTime.Parse(sdrreader[2].ToString());
             bankreconciliationinfo.ExtraDate = DateTime.Parse(sdrreader[3].ToString());
             bankreconciliationinfo.Extra1 = sdrreader[4].ToString();
             bankreconciliationinfo.Extra2 = sdrreader[5].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return bankreconciliationinfo;
 }