private void txtAmount_Leave(object sender, EventArgs e) { try { if (IsValid()) { txtBitcoins.Text = common.getquote(Convert.ToInt32(txtAmount.Text), cboCurrency.SelectedItem.ToString()).ToString("0.000000"); this.Refresh(); } } catch (Exception ex) { } }
private void GetQuote() { UseWaitCursor = true; try { if (txtAmount.Text != "" && Convert.ToInt32(txtAmount.Text) > 0) { txtBitcoins.Text = common.getquote(Convert.ToInt32(txtAmount.Text), cboCurrency.SelectedItem.ToString()).ToString("0.000000"); txtBitcoins.Visible = true; labelBitcoins.Visible = true; this.Refresh(); } else { txtBitcoins.Visible = false; labelBitcoins.Visible = false; } } catch (Exception ex) { //TODO: Log error txtBitcoins.Text = "Unable to get quote"; this.Refresh(); txtBitcoins.Visible = true; } finally { UseWaitCursor = false; } }