private void CotizacionPeso_Leave(object sender, EventArgs e) { if (double.TryParse(CotizacionPeso.Text, out double auxCotizacion)) { Pesos.SetCotizacion(auxCotizacion); } else { CotizacionPeso.Focus(); } }
private void txtCotizacionPeso_MouseLeave(object sender, EventArgs e) { if ((!(String.IsNullOrWhiteSpace(txtCotizacionPeso.Text))) && (Double.TryParse(txtCotizacionPeso.Text, out double cotizacionPesos))) { Pesos.SetCotizacion(cotizacionPesos); } else { txtCotizacionEuro.Focus(); MessageBox.Show("Debe ingresar un valor valido", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void TxtCotizacionPesos_Leave(object sender, EventArgs e) { double aux; if (double.TryParse(txtCotizacionPesos.Text, out aux)) { Pesos.SetCotizacion(aux); } else { txtCotizacionPesos.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 btnPeso_Click(object sender, EventArgs e) { if (!locked) { MessageBox.Show("Debe bloquearse el candado para asegurar las cotizaciones", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (Double.TryParse(txtPeso.Text, out double equivalentePesos)) { Pesos myPeso = new Pesos(equivalentePesos); Pesos.SetCotizacion(Double.Parse(txtCotizacionPeso.Text)); txtPesoEuro.Text = (((Euros)myPeso).GetCantidad()).ToString(); txtPesoDolar.Text = (((Dolar)myPeso).GetCantidad()).ToString(); txtPesoPeso.Text = (myPeso.GetCantidad()).ToString(); } } }
private void CotizacionMonedas(double dolar, double peso, double euro) { Euro.SetCotizacion(euro); Dolar.SetCotizacion(dolar); Pesos.SetCotizacion(peso); }