private void cboCurrency_SelectedIndexChanged(object sender, EventArgs e) { Guid id = Guid.Empty; if (Guid.TryParse(cboCurrency.SelectedValue.ToString(), out id)) { txtExchangeRate.Text = CurrencyEx.GetExchangeRateById(id).ToString("n4"); updateCurrency(new System.Guid(cboCurrency.SelectedValue.ToString())); } }
private void cboCurrency_SelectedIndexChanged(object sender, EventArgs e) { var id = Guid.Empty; if (cboCurrency.SelectedValue != null) { if (Guid.TryParse(cboCurrency.SelectedValue.ToString(), out id)) { if (id != Guid.Empty) { txtExchangeRate.Text = CurrencyEx.GetExchangeRateById(id).ToString("n4"); } } } }