/// <summary> /// Function to save /// </summary> public void SaveFunction() { try { ExchangeRateInfo infoExchangeRate = new ExchangeRateInfo(); ExchangeRateSP spExchangeRate = new ExchangeRateSP(); infoExchangeRate.CurrencyId = Convert.ToDecimal(cmbCurrency.SelectedValue.ToString()); infoExchangeRate.Date = Convert.ToDateTime(dtpDate.Text.Trim().ToString()); infoExchangeRate.Rate = Convert.ToDecimal(txtExchangeRate.Text.Trim().ToString()); infoExchangeRate.Narration = txtNarration.Text.Trim(); infoExchangeRate.Extra1 = string.Empty; infoExchangeRate.Extra2 = string.Empty; if (spExchangeRate.ExchangeRateCheckExistence(Convert.ToDateTime(txtDate.Text.Trim().ToString()), Convert.ToDecimal(cmbCurrency.SelectedValue.ToString()), 0) == false) { if (ExchangeRateCheck()) { spExchangeRate.ExchangeRateAddParticularFields(infoExchangeRate); Messages.SavedMessage(); Clear(); } } else { Messages.ReferenceExistsMessageForUpdate(); } } catch (Exception ex) { MessageBox.Show("ER2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <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); } }