/// <summary> /// Function to insert particular values to ExchangeRate Table /// </summary> /// <param name="exchangerateinfo"></param> public void ExchangeRateAddParticularFields(ExchangeRateInfo exchangerateinfo) { try { if (sqlcon.State == ConnectionState.Closed) { sqlcon.Open(); } SqlCommand sccmd = new SqlCommand("ExchangeRateAddParticularFields", sqlcon); sccmd.CommandType = CommandType.StoredProcedure; SqlParameter sprmparam = new SqlParameter(); sprmparam = sccmd.Parameters.Add("@currencyId", SqlDbType.Decimal); sprmparam.Value = exchangerateinfo.CurrencyId; sprmparam = sccmd.Parameters.Add("@date", SqlDbType.DateTime); sprmparam.Value = exchangerateinfo.Date; sprmparam = sccmd.Parameters.Add("@rate", SqlDbType.Decimal); sprmparam.Value = exchangerateinfo.Rate; sprmparam = sccmd.Parameters.Add("@narration", SqlDbType.VarChar); sprmparam.Value = exchangerateinfo.Narration; sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar); sprmparam.Value = exchangerateinfo.Extra1; sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar); sprmparam.Value = exchangerateinfo.Extra2; sccmd.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { sqlcon.Close(); } }
/// <summary> /// Function to insert particular values to ExchangeRate Table /// </summary> /// <param name="exchangerateinfo"></param> public void ExchangeRateAddParticularFields(ExchangeRateInfo exchangerateinfo) { try { SPExchangeRate.ExchangeRateAddParticularFields(exchangerateinfo); } catch (Exception ex) { MessageBox.Show("ERBll7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to get particular values from ExchangeRate Table based on the parameter /// </summary> /// <param name="exchangeRateId"></param> /// <returns></returns> public ExchangeRateInfo ExchangeRateView(decimal exchangeRateId) { ExchangeRateInfo exchangerateinfo = new ExchangeRateInfo(); SqlDataReader sdrreader = null; try { if (sqlcon.State == ConnectionState.Closed) { sqlcon.Open(); } SqlCommand sccmd = new SqlCommand("ExchangeRateView", sqlcon); sccmd.CommandType = CommandType.StoredProcedure; SqlParameter sprmparam = new SqlParameter(); sprmparam = sccmd.Parameters.Add("@exchangeRateId", SqlDbType.Decimal); sprmparam.Value = exchangeRateId; sdrreader = sccmd.ExecuteReader(); while (sdrreader.Read()) { exchangerateinfo.ExchangeRateId = decimal.Parse(sdrreader[0].ToString()); exchangerateinfo.CurrencyId = decimal.Parse(sdrreader[1].ToString()); exchangerateinfo.Date = DateTime.Parse(sdrreader[2].ToString()); exchangerateinfo.Rate = decimal.Parse(sdrreader[3].ToString()); exchangerateinfo.Narration = sdrreader[4].ToString(); exchangerateinfo.ExtraDate = DateTime.Parse(sdrreader[5].ToString()); exchangerateinfo.Extra1 = sdrreader[6].ToString(); exchangerateinfo.Extra2 = sdrreader[7].ToString(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { sdrreader.Close(); sqlcon.Close(); } return exchangerateinfo; }
/// <summary> /// Function to get particular values from ExchangeRate Table based on the parameter /// </summary> /// <param name="exchangeRateId"></param> /// <returns></returns> public ExchangeRateInfo ExchangeRateView(decimal exchangeRateId) { ExchangeRateInfo exchangerateinfo = new ExchangeRateInfo(); try { exchangerateinfo = SPExchangeRate.ExchangeRateView(exchangeRateId); } catch (Exception ex) { MessageBox.Show("ERBll4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return exchangerateinfo; }
/// <summary> /// Function to Update values in ExchangeRate Table /// </summary> /// <param name="exchangerateinfo"></param> public void ExchangeRateEdit(ExchangeRateInfo exchangerateinfo) { try { SPExchangeRate.ExchangeRateEdit(exchangerateinfo); } catch (Exception ex) { MessageBox.Show("ERBll2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }