/// <summary> /// Checks that the box isn't empty or null, then tries to convert its content to Double-type and sets the cotizacion of Euro, Otherwise sets the cotization in 1. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtBoxEuro_MouseLeave(object sender, EventArgs e) { if (!String.IsNullOrWhiteSpace(txtBoxEuro.Text) && Double.TryParse(txtBoxEuro.Text, out double equivalentEuro)) { Euro.SetCotizacion(equivalentEuro); } else { txtBoxEuro.Focus(); MessageError("Monto en Euros Invalido", "Error"); } }
private void TxtCotizacionEuro_Leave(object sender, EventArgs e) { double aux; if (double.TryParse(txtCotizacionEuro.Text, out aux)) { Euro.SetCotizacion(aux); } else { txtCotizacionEuro.Focus(); } }
private void btnLockCotizacion_Click(object sender, EventArgs e) { if (btnLockCotizacion.ImageIndex == 0) { btnLockCotizacion.ImageIndex = 1; txtCotizacionPeso.Enabled = true; txtCotizacionEuro.Enabled = true; } else { Pesos.SetCotizacion(double.Parse(txtCotizacionPeso.Text)); Euro.SetCotizacion(double.Parse(txtCotizacionEuro.Text)); btnLockCotizacion.ImageIndex = 0; txtCotizacionPeso.Enabled = false; txtCotizacionEuro.Enabled = false; } }
private void CotizacionMonedas(double dolar, double peso, double euro) { Euro.SetCotizacion(euro); Dolar.SetCotizacion(dolar); Pesos.SetCotizacion(peso); }