Exemple #1
0
        /// <summary>
        /// On datagridview cell double click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvCurrency_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            CurrencySP spCurrency = new CurrencySP();

            try
            {
                if (e.RowIndex != -1)
                {
                    decId = Convert.ToDecimal(dgvCurrency.Rows[e.RowIndex].Cells["dgvtxtCurrencyId"].Value.ToString());
                    if (!spCurrency.DefaultCurrencyCheck(decId))
                    {
                        FillControls();
                        btnDelete.Enabled = true;
                        btnSave.Text      = "Update";
                        txtName.Focus();
                    }
                    else
                    {
                        Messages.InformationMessage("Default currency cannot update or delete");
                        Clear();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("C17:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        public bool DefaultCurrencyCheck(decimal decCurrencyId)
        {
            bool isDefault = false;

            try
            {
                isDefault = SpCurrency.DefaultCurrencyCheck(decCurrencyId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("C9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(isDefault);
        }