Ejemplo n.º 1
0
 private void btnCrearAutomovil_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(cmbMarca.Text) && !string.IsNullOrWhiteSpace(cmbModelo.Text) && !string.IsNullOrWhiteSpace(txtPatente.Text) && !string.IsNullOrWhiteSpace(txtLicencia.Text) && !string.IsNullOrWhiteSpace(txtChoferDni.Text) && turnos.Count != 0)
     {
         try
         {
             AutomovilDTO nuevoAutomovil = this.cargarAutomovil();
             AutomovilDAO.addNewAutomovil(nuevoAutomovil, turnos);
             MessageBox.Show("Se agrego el automovil correctamente");
             listener.onOperationFinish();
             this.Close();
         }
         catch (ApplicationException ex)
         {
             Utility.ShowError("Error al agregar el automovil", ex);
         }
     }
     else
     {
         MessageBox.Show("Debe completar todos los campos", "Error");
     }
 }