コード例 #1
0
 private void btnIngresar_Click(object sender, EventArgs e)
 {
     if (txtNroVuelo.Text.Trim() == "")
     {
         MessageBox.Show("Asegurese de ingresar el numero de vuelo.", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtNroVuelo.Focus();
     }
     else if (txtCondicion.Text.Trim() == "")
     {
         MessageBox.Show("Asegurese de ingresar la condicion del vuelo.", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtNroVuelo.Focus();
     }
     else if (txtTotalTv.Text.Trim() == "")
     {
         MessageBox.Show("Asegurese de ingresar el total tv.", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtNroVuelo.Focus();
     }
     else if (fecha.Text.Trim() == "")
     {
         MessageBox.Show("Asegurese de ingresar la fecha.", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtNroVuelo.Focus();
     }
     else if (txtMision.Text.Trim() == "")
     {
         MessageBox.Show("Asegurese de ingresar la mision.", "Close Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtNroVuelo.Focus();
     }
     else
     {
         ConsumeWebApi consume        = new ConsumeWebApi();
         Boolean       registrarVuelo = consume.nuevoVuelo(Int32.Parse(txtNroVuelo.Text), txtCondicion.Text, Int32.Parse(txtTotalTv.Text), fecha.Text, Int32.Parse(txtMision.Text), Int32.Parse(txtAeronave.Text));
         if (registrarVuelo)
         {
             MessageBox.Show("Nuevo vuelo creado.", "Close Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             MessageBox.Show("Ha ocurrido un error.", "Close Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }