コード例 #1
0
ファイル: Form1.cs プロジェクト: MrXerox1/Ejercicio_23
 private void CotizacionEuro_Leave(object sender, EventArgs e)
 {
     if (double.TryParse(CotizacionEuro.Text, out double auxCotizacion))
     {
         Euros.SetCotizacion(auxCotizacion);
     }
     else
     {
         CotizacionEuro.Focus();
     }
 }
コード例 #2
0
 private void txtCotizacionEuro_MouseLeave(object sender, EventArgs e)
 {
     if ((!(String.IsNullOrWhiteSpace(txtCotizacionEuro.Text))) && (Double.TryParse(txtCotizacionEuro.Text, out double cotizacionEuro)))
     {
         Euros.SetCotizacion(cotizacionEuro);
     }
     else
     {
         txtCotizacionEuro.Focus();
         MessageBox.Show("Debe ingresar un valor valido", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #3
0
 private void btnEuro_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(txtEuro.Text, out double equivalenteEuro))
         {
             Euros myEuro = new Euros(equivalenteEuro);
             Euros.SetCotizacion(Double.Parse(txtCotizacionEuro.Text));
             txtEuroEuro.Text  = (myEuro.GetCantidad()).ToString();
             txtEuroDolar.Text = (((Dolar)myEuro).GetCantidad()).ToString();
             txtEuroPeso.Text  = (((Pesos)myEuro).GetCantidad()).ToString();
         }
     }
 }