private void EstabacerPilotoSeleccionado()
 {
     try
     {
         if (!TieneSeleccionadoUnaFilaEnLaVista(UiVistaPilotos))
         {
             return;
         }
         Piloto = ((Piloto)ObtenerFilaSelecciondaDeLaVista(UiVistaPilotos)).ShallowCopy();
         if (string.IsNullOrEmpty(Piloto.ROLE_ID))
         {
             if (RolesDeUsuario == null || RolesDeUsuario.Count <= 0)
             {
                 return;
             }
             Piloto.ROLE_ID = RolesDeUsuario[0].ROLE_ID;
         }
         UsuarioDeseaObtenerUsuariosPorRol?.Invoke(null, new PilotoArgumento {
             RolDeUsuario = new RolDeUsuario {
                 ROLE_ID = Piloto.ROLE_ID, USER_CODE = Piloto.USER_CODE
             }
         });
         UiGridDePropiedadesPilotos.Refresh();
     }
     catch (Exception ex)
     {
         InteraccionConUsuarioServicio.Alerta(ex.Message);
     }
 }
        private bool ValidarDatosGenerales()
        {
            try
            {
                UiVistasPrincipal.Focus();
                if (string.IsNullOrEmpty(Piloto.NAME))
                {
                    InteraccionConUsuarioServicio.Alerta("Ingrese el nombre.");
                    UiGridDePropiedadesPilotos.Focus();
                    return(false);
                }
                if (string.IsNullOrEmpty(Piloto.LAST_NAME))
                {
                    InteraccionConUsuarioServicio.Alerta("Ingrese el apellido.");
                    UiGridDePropiedadesPilotos.Focus();
                    return(false);
                }
                if (string.IsNullOrEmpty(Piloto.IDENTIFICATION_DOCUMENT_NUMBER))
                {
                    InteraccionConUsuarioServicio.Alerta("Ingrese el numero de identificacón.");
                    UiGridDePropiedadesPilotos.Focus();
                    return(false);
                }
                if (string.IsNullOrEmpty(Piloto.LICENSE_NUMBER))
                {
                    InteraccionConUsuarioServicio.Alerta("Ingrese el numero de licencia.");
                    UiGridDePropiedadesPilotos.Focus();
                    return(false);
                }
                if (string.IsNullOrEmpty(Piloto.LICESE_TYPE))
                {
                    InteraccionConUsuarioServicio.Alerta("Ingrese el tipo de licencia.");
                    UiGridDePropiedadesPilotos.Focus();
                    return(false);
                }
                if (Piloto.LICENSE_EXPIRATION_DATE == null)
                {
                    InteraccionConUsuarioServicio.Alerta("Ingrese la fecha de vencimiento.");
                    UiGridDePropiedadesPilotos.Focus();
                    return(false);
                }
                else
                {
                    if (Piloto.LICENSE_EXPIRATION_DATE <= DateTime.Now)
                    {
                        InteraccionConUsuarioServicio.Alerta("La fecha tiene que ser mayor a la fecha actual.");
                        UiGridDePropiedadesPilotos.Focus();
                        return(false);
                    }
                }

                if (string.IsNullOrEmpty(Piloto.ADDRESS))
                {
                    InteraccionConUsuarioServicio.Alerta("Ingrese la dirección.");
                    UiGridDePropiedadesPilotos.Focus();
                    return(false);
                }
                if (string.IsNullOrEmpty(Piloto.TELEPHONE))
                {
                    InteraccionConUsuarioServicio.Alerta("Ingrese el telefono.");
                    UiGridDePropiedadesPilotos.Focus();
                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                InteraccionConUsuarioServicio.Alerta(ex.Message);
                return(false);
            }
        }