/// <summary> /// Function to Edit /// </summary> public void EditFunction() { try { CurrencyInfo infoCurrency = new CurrencyInfo(); CurrencyBll BllCurrency = new CurrencyBll(); infoCurrency.CurrencySymbol = txtSymbol.Text.Trim(); infoCurrency.CurrencyName = txtName.Text.Trim(); infoCurrency.SubunitName = txtSubUnit.Text.Trim(); infoCurrency.NoOfDecimalPlaces = Convert.ToInt32(txtDecimalPlaces.Text.Trim()); infoCurrency.Narration = txtNarration.Text.Trim(); infoCurrency.IsDefault = false; infoCurrency.Extra1 = String.Empty; infoCurrency.Extra2 = String.Empty; infoCurrency.CurrencyId = decId; if (BllCurrency.CurrencyNameCheckExistence(txtName.Text.Trim(), txtSymbol.Text.Trim(), decCurrencyId) == false) { BllCurrency.CurrencyEdit(infoCurrency); Messages.UpdatedMessage(); SearchClear(); Clear(); } else { Messages.InformationMessage("Currency name already exist"); txtName.Focus(); } } catch (Exception ex) { MessageBox.Show("C2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to save /// </summary> public void SaveFunction() { try { CurrencyInfo infoCurrency = new CurrencyInfo(); CurrencyBll BllCurrency = new CurrencyBll(); infoCurrency.CurrencySymbol = txtSymbol.Text.Trim(); infoCurrency.CurrencyName = txtName.Text.Trim(); infoCurrency.SubunitName = txtSubUnit.Text.Trim(); infoCurrency.NoOfDecimalPlaces = Convert.ToInt32(txtDecimalPlaces.Text.Trim()); infoCurrency.Narration = txtNarration.Text.Trim(); infoCurrency.IsDefault = false; infoCurrency.Extra1 = string.Empty; infoCurrency.Extra2 = string.Empty; if (BllCurrency.CurrencyNameCheckExistence(txtName.Text.Trim(), txtSymbol.Text.Trim(), 0) == false) { decCurrency = BllCurrency.CurrencyAddwithIdentity(infoCurrency); Messages.SavedMessage(); Clear(); decIdForOtherForms = decCurrency; if (frmExchangeRateObj != null) { this.Close(); } } else { Messages.InformationMessage("Currency name already exist"); txtName.Focus(); } } catch (Exception ex) { MessageBox.Show("C1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }