Exemple #1
0
 /// <summary>
 /// Function to Edit
 /// </summary>
 public void EditFunction()
 {
     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;
         infoCurrency.CurrencyId        = decId;
         if (spCurrency.CurrencyNameCheckExistence(txtName.Text.Trim(), txtSymbol.Text.Trim(), decCurrencyId) == false)
         {
             spCurrency.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);
     }
 }
        public bool CurrencyNameCheckExistence(String strName, string strCurrencySymb, decimal decCurrencyId)
        {
            bool isEdit = false;

            try
            {
                isEdit = SpCurrency.CurrencyNameCheckExistence(strName, strCurrencySymb, decCurrencyId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("C2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(isEdit);
        }
Exemple #3
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);
     }
 }