public decimal JournalMasterAdd(JournalMasterInfo infoJournalmaster)
 {
     decimal decId = 0;
     try
     {
         decId = spJournalMaster.JournalMasterAdd(infoJournalmaster);
     }
     catch (Exception ex)
     {
         MessageBox.Show("JVBLL7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     return decId;
 }
 /// <summary>
 /// Function to insert values to JournalMaster Table
 /// </summary>
 /// <param name="journalmasterinfo"></param>
 /// <returns></returns>
 public decimal JournalMasterAdd(JournalMasterInfo journalmasterinfo)
 {
     decimal decId = 0;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("JournalMasterAdd", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@voucherNo", SqlDbType.VarChar);
         sprmparam.Value = journalmasterinfo.VoucherNo;
         sprmparam = sccmd.Parameters.Add("@invoiceNo", SqlDbType.VarChar);
         sprmparam.Value = journalmasterinfo.InvoiceNo;
         sprmparam = sccmd.Parameters.Add("@suffixPrefixId", SqlDbType.Decimal);
         sprmparam.Value = journalmasterinfo.SuffixPrefixId;
         sprmparam = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
         sprmparam.Value = journalmasterinfo.Date;
         sprmparam = sccmd.Parameters.Add("@totalAmount", SqlDbType.Decimal);
         sprmparam.Value = journalmasterinfo.TotalAmount;
         sprmparam = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = journalmasterinfo.Narration;
         sprmparam = sccmd.Parameters.Add("@userId", SqlDbType.Decimal);
         sprmparam.Value = journalmasterinfo.UserId;
         sprmparam = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
         sprmparam.Value = journalmasterinfo.VoucherTypeId;
         sprmparam = sccmd.Parameters.Add("@financialYearId", SqlDbType.Decimal);
         sprmparam.Value = journalmasterinfo.FinancialYearId;
         sprmparam = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime);
         sprmparam.Value = journalmasterinfo.ExtraDate;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = journalmasterinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = journalmasterinfo.Extra2;
         decId = Convert.ToDecimal(sccmd.ExecuteScalar().ToString());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
     return decId;
 }
 /// <summary>
 /// Function to get particular values from JournalMaster table based on the parameter
 /// </summary>
 /// <param name="journalMasterId"></param>
 /// <returns></returns>
 public JournalMasterInfo JournalMasterView(decimal journalMasterId)
 {
     JournalMasterInfo journalmasterinfo = new JournalMasterInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("JournalMasterView", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@journalMasterId", SqlDbType.Decimal);
         sprmparam.Value = journalMasterId;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             journalmasterinfo.JournalMasterId = decimal.Parse(sdrreader[0].ToString());
             journalmasterinfo.VoucherNo = sdrreader[1].ToString();
             journalmasterinfo.InvoiceNo = sdrreader[2].ToString();
             journalmasterinfo.SuffixPrefixId = decimal.Parse(sdrreader[3].ToString());
             journalmasterinfo.Date = DateTime.Parse(sdrreader[4].ToString());
             journalmasterinfo.TotalAmount = decimal.Parse(sdrreader[5].ToString());
             journalmasterinfo.Narration = sdrreader[6].ToString();
             journalmasterinfo.UserId = decimal.Parse(sdrreader[7].ToString());
             journalmasterinfo.VoucherTypeId = decimal.Parse(sdrreader[8].ToString());
             journalmasterinfo.FinancialYearId = decimal.Parse(sdrreader[9].ToString());
             journalmasterinfo.ExtraDate = DateTime.Parse(sdrreader[10].ToString());
             journalmasterinfo.Extra1 = sdrreader[11].ToString();
             journalmasterinfo.Extra2 = sdrreader[12].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return journalmasterinfo;
 }
 public decimal JournalMasterEdit(JournalMasterInfo infoJournalmaster)
 {
     decimal decEffectRow = 0;
     try
     {
         decEffectRow = spJournalMaster.JournalMasterEdit(infoJournalmaster);
     }
     catch (Exception ex)
     {
         MessageBox.Show("JVBLL8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     return decEffectRow;
 }
 public JournalMasterInfo JournalMasterView(decimal decJournalMasterId)
 {
     JournalMasterInfo infoJournalmaster = new JournalMasterInfo();
     try
     {
         infoJournalmaster = spJournalMaster.JournalMasterView(decJournalMasterId);
     }
     catch (Exception ex)
     {
         MessageBox.Show("JVBLL11:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     return infoJournalmaster;
 }