public decimal CurrencyAddwithIdentity(CurrencyInfo currencyinfo)
        {
            decimal decCurrencyId = 0;

            try
            {
                decCurrencyId = SpCurrency.CurrencyAddwithIdentity(currencyinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("C3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decCurrencyId);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         CurrencyInfo infoCurrency = new CurrencyInfo();
         CurrencySP   spCurrency   = new CurrencySP();
         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 (spCurrency.CurrencyNameCheckExistence(txtName.Text.Trim(), txtSymbol.Text.Trim(), 0) == false)
         {
             decCurrency = spCurrency.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);
     }
 }