/// <summary>
 /// Function to insert values to VoucherTypeTax Table
 /// </summary>
 /// <param name="vouchertypetaxinfo"></param>
 public void VoucherTypeTaxAdd(VoucherTypeTaxInfo vouchertypetaxinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("VoucherTypeTaxAdd", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
         sprmparam.Value = vouchertypetaxinfo.VoucherTypeId;
         sprmparam = sccmd.Parameters.Add("@taxId", SqlDbType.Decimal);
         sprmparam.Value = vouchertypetaxinfo.TaxId;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = vouchertypetaxinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = vouchertypetaxinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
 /// <summary>
 /// Function to insert values to VoucherTypeTax Table
 /// </summary>
 /// <param name="vouchertypetaxinfo"></param>
 public void VoucherTypeTaxAdd(VoucherTypeTaxInfo vouchertypetaxinfo)
 {
     try
        {
        spVoucherTypeTax.VoucherTypeTaxAdd(vouchertypetaxinfo);
        }
        catch (Exception ex)
        {
        MessageBox.Show("AL1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
 }
 /// <summary>
 /// Function to get particular values from VoucherTypeTax table based on the parameter
 /// </summary>
 /// <param name="voucherTypeTaxId"></param>
 /// <returns></returns>
 public VoucherTypeTaxInfo VoucherTypeTaxView(decimal voucherTypeTaxId)
 {
     VoucherTypeTaxInfo vouchertypetaxinfo = new VoucherTypeTaxInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("VoucherTypeTaxView", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@voucherTypeTaxId", SqlDbType.Decimal);
         sprmparam.Value = voucherTypeTaxId;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             vouchertypetaxinfo.VoucherTypeTaxId = decimal.Parse(sdrreader[0].ToString());
             vouchertypetaxinfo.VoucherTypeId = decimal.Parse(sdrreader[1].ToString());
             vouchertypetaxinfo.TaxId = decimal.Parse(sdrreader[2].ToString());
             vouchertypetaxinfo.ExtraDate = DateTime.Parse(sdrreader[3].ToString());
             vouchertypetaxinfo.Extra1 = sdrreader[4].ToString();
             vouchertypetaxinfo.Extra2 = sdrreader[5].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return vouchertypetaxinfo;
 }