예제 #1
0
        private void buttonSeleccionarChofer_Click(object sender, EventArgs e)
        {
            Chofer seleccionado = new SeleccionarChoferForm(this).getChofer(); // Selecciono un chofer

            if (seleccionado != null)
            {
                Chofer = seleccionado;                          // Si es null (porque apretaron el botón cancelar) no hago nada, sino, me lo quedo
            }
        }
예제 #2
0
        private void buttonSeleccionarChofer_Click(object sender, EventArgs e)
        {
            Chofer seleccionado = new SeleccionarChoferForm(this).getChofer(); // selecciono chofer

            if (seleccionado != null)
            {
                Chofer = seleccionado;                          // si no es null cargo los campos
            }
        }
        private void buttonSeleccionarChofer_Click(object sender, EventArgs e)
        {
            Chofer seleccionado = new SeleccionarChoferForm(this).getChofer(); // selecciono chofer

            if (seleccionado != null)                                          // si no es null...
            {
                try {
                    Automovil = Automovil.getAutomovilDe(seleccionado.id); // obtengo su auto (si no tiene un auto habilitado tira excepcion y catcheo)
                    Chofer    = seleccionado;                              // cargo campos
                    Turno     = automovil.turno;
                }
                catch (IndexOutOfRangeException) {
                    Error.show("El chofer seleccionado no tiene ningún automovil habilitado asignado.");
                }
            }
        }