/// <summary> /// On datagridview cell double click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvExchangeRate_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { ExchangeRateSP spExcahangeRate = new ExchangeRateSP(); if (e.RowIndex != -1) { decId = Convert.ToDecimal(dgvExchangeRate.Rows[e.RowIndex].Cells["dgvtxtExchangeRateId"].Value.ToString()); bool Status = spExcahangeRate.ExchangeRateCheckExistanceForUpdationAndDelete(Convert.ToDateTime(txtDate.Text.ToString()), decId); if (Status) { FillControls(); btnSave.Text = "Update"; btnDelete.Enabled = true; cmbCurrency.Focus(); } else { Messages.ReferenceExistsMessageForUpdate(); } } } catch (Exception ex) { MessageBox.Show("ER25:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to check existence based on parameters and return status /// </summary> /// <param name="dtDate"></param> /// <param name="decCurrencyId"></param> /// <param name="decExchangeRateId"></param> /// <returns></returns> public bool ExchangeRateCheckExistanceForUpdationAndDelete(DateTime dtDate, decimal decExchangeRateId) { bool isResult = false; try { isResult = SPExchangeRate.ExchangeRateCheckExistanceForUpdationAndDelete(dtDate, decExchangeRateId); } catch (Exception ex) { MessageBox.Show("ERBll17:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(isResult); }