/// <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) { formMDI.infoError.ErrorString = "ER2:" + ex.Message; } }
/// <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); } }