Esempio n. 1
0
 private void UiBotonRefrescar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         UsuarioDeseaObtenerEmpresasDeTransporte?.Invoke(null, new EmpresaDeTransporteArgumento {
             EmpresaDeTransporte = new EmpresaDeTransporte()
         });
     }
     catch (Exception ex)
     {
         InteraccionConUsuarioServicio.Alerta(ex.Message);
     }
 }
Esempio n. 2
0
        private void UiListaPiloto_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            try
            {
                UiVistaVehiculos.Focus();
                if (BotonSeleccionadoNoTieneEtiqueta(e))
                {
                    return;
                }
                switch (e.Button.Tag.ToString())
                {
                case "UiBotonRefrescarListaEmpresas":
                    UsuarioDeseaObtenerEmpresasDeTransporte?.Invoke(null, new EmpresaDeTransporteArgumento {
                        EmpresaDeTransporte = new EmpresaDeTransporte()
                    });
                    break;

                case "UiBotonRefrescarListaPilotos":
                    var piloto = new Piloto();

                    if (ExisteRegistro(Vehiculo.VEHICLE_CODE))
                    {
                        var firstOrDefault = Vehiculos.ToList().FirstOrDefault(v => v.VEHICLE_CODE == Vehiculo.VEHICLE_CODE);
                        if (firstOrDefault != null)
                        {
                            piloto.PILOT_CODE = firstOrDefault.PILOT_CODE;
                        }
                    }

                    UsuarioDeseaObtenerPilotosNoAsociadosAVehiculos?.Invoke(null, new PilotoArgumento {
                        Piloto = piloto
                    });
                    break;

                case "UiBotonRefrescarPolizas":
                    UsuarioDeseaObtenerPolizas?.Invoke(null, new VehiculoArgumento());
                    break;
                }
            }
            catch (Exception ex)
            {
                InteraccionConUsuarioServicio.Alerta(ex.Message);
            }
        }