private void RealizarBusqueda() { Cursor = Cursors.WaitCursor; try { var clientesSeleccionados = Clientes.Where(cliente => cliente.IS_SELECTED).Select(cliente => cliente.CLIENT_CODE); var clientes = new XDocument(); clientes.Add(new XElement("Data", clientesSeleccionados.Select(cl => new XElement("CLIENT_CODE", cl)))); var polizaArgumento = new PolizaArgumento { START_DATE = UiFechaInicial.DateTime , END_DATE = UiFechaFinal.DateTime , DAYS = (int)UiGrupoRadioFechas.EditValue , CUSTOMER = clientes.ToString() , BLOCKED_ONLY = UiSwitchVencidas.IsOn ? (int)SiNo.Si : (int)SiNo.No }; UsuarioDeseaObtenerPolizas?.Invoke(null, polizaArgumento); } catch (Exception exception) { InteraccionConUsuarioServicio.Mensaje(exception.Message); } finally { Cursor = Cursors.Default; } }
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); } }