/// <summary>
 /// Function to insert values without id
 /// </summary>
 /// <param name="taxdetailsinfo"></param>
 public void TaxDetailsAddWithoutId(TaxDetailsInfo taxdetailsinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("TaxDetailsAddWithoutId", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@taxId", SqlDbType.Decimal);
         sprmparam.Value = taxdetailsinfo.TaxId;
         sprmparam = sccmd.Parameters.Add("@selectedtaxId", SqlDbType.Decimal);
         sprmparam.Value = taxdetailsinfo.SelectedtaxId;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = taxdetailsinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = taxdetailsinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
示例#2
0
        /// <summary>
        /// Function to get particular values from TaxDetails Table based on the parameter
        /// </summary>
        /// <param name="taxdetailsId"></param>
        /// <returns></returns>
        public TaxDetailsInfo TaxDetailsView(decimal decTaxDetailsId)
        {
            TaxDetailsInfo infoTaxDetails = new TaxDetailsInfo();

            try
            {
                infoTaxDetails = spTaxDetails.TaxDetailsView(decTaxDetailsId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("TBLL1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            return infoTaxDetails;
        }
示例#3
0
 /// <summary>
 /// Function to Update values in TaxDetails Table
 /// </summary>
 /// <param name="taxdetailsinfo"></param>
 public void TaxDetailsEdit(TaxDetailsInfo infoTaxDetails)
 {
     try
     {
         spTaxDetails.TaxDetailsEdit(infoTaxDetails);
     }
     catch (Exception ex)
     {
         MessageBox.Show("TBLL1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to get particular values from TaxDetails Table based on the parameter
 /// </summary>
 /// <param name="taxdetailsId"></param>
 /// <returns></returns>
 public TaxDetailsInfo TaxDetailsView(decimal taxdetailsId)
 {
     TaxDetailsInfo taxdetailsinfo = new TaxDetailsInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("TaxDetailsView", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@taxdetailsId", SqlDbType.Decimal);
         sprmparam.Value = taxdetailsId;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             taxdetailsinfo.TaxdetailsId = decimal.Parse(sdrreader[0].ToString());
             taxdetailsinfo.TaxId = decimal.Parse(sdrreader[1].ToString());
             taxdetailsinfo.SelectedtaxId = decimal.Parse(sdrreader[2].ToString());
             taxdetailsinfo.ExtraDate = DateTime.Parse(sdrreader[3].ToString());
             taxdetailsinfo.Extra1 = sdrreader[4].ToString();
             taxdetailsinfo.Extra2 = sdrreader[5].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return taxdetailsinfo;
 }