Exemplo n.º 1
0
 private void CotizacionPeso_Leave(object sender, EventArgs e)
 {
     if (double.TryParse(CotizacionPeso.Text, out double auxCotizacion))
     {
         Pesos.SetCotizacion(auxCotizacion);
     }
     else
     {
         CotizacionPeso.Focus();
     }
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
        private void TxtCotizacionPesos_Leave(object sender, EventArgs e)
        {
            double aux;

            if (double.TryParse(txtCotizacionPesos.Text, out aux))
            {
                Pesos.SetCotizacion(aux);
            }
            else
            {
                txtCotizacionPesos.Focus();
            }
        }
Exemplo n.º 4
0
 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;
     }
 }
Exemplo n.º 5
0
 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();
         }
     }
 }
Exemplo n.º 6
0
 private void CotizacionMonedas(double dolar, double peso, double euro)
 {
     Euro.SetCotizacion(euro);
     Dolar.SetCotizacion(dolar);
     Pesos.SetCotizacion(peso);
 }