예제 #1
0
 public void LimpiarInformacionBajadaDeRelojes()
 {
     c.Clear();
     d = null;
     e.Clear();
     f = null;
     GC.Collect();
 }
예제 #2
0
        public bool BuscarUsuarioPorId(int NumeroCredencial)
        {
            this.a = string.Empty;
            this.g = false;
            string Name      = string.Empty;
            string Password  = string.Empty;
            string TmpData   = string.Empty;
            int    Privilege = 0;
            int    TmpLength = 0;
            bool   Enabled   = false;

            if (this.i.SSR_GetUserInfo(1, NumeroCredencial.ToString(), out Name, out Password, out Privilege, out Enabled))
            {
                this.d = new UsuarioInformacion();
                this.d.NumeroCredencial = NumeroCredencial;
                this.d.Nombre           = Name;
                this.d.Contrasenia      = Password;
                this.d.Permiso          = (Permiso)Privilege;
                this.d.Activo           = Enabled;
                this.d.Huellas          = new List <UsuarioHuella>();
                for (int dwFingerIndex = 0; dwFingerIndex < 10; ++dwFingerIndex)
                {
                    if (this.i.SSR_GetUserTmpStr(1, NumeroCredencial.ToString(), dwFingerIndex, out TmpData, out TmpLength))
                    {
                        this.d.Huellas.Add(new UsuarioHuella()
                        {
                            IndexHuella    = dwFingerIndex,
                            B64Huella      = TmpData,
                            LongitudHuella = TmpLength
                        });
                    }
                }
                this.g = true;
            }
            else
            {
                this.a = "(Método: UsuarioBuscar) - Error al buscar el usuario. Código de error: " + this.h.ToString() + " - " + this.GenerarMensajeDeError(this.h);
            }
            return(this.g);
        }
예제 #3
0
        public List <UsuarioInformacion> BuscarTodosLosUsuarios(bool DeshabilitarDispositivo)
        {
            this.a = string.Empty;
            this.g = false;
            this.c = new List <UsuarioInformacion>();

            if (DeshabilitarDispositivo && !this.CambiarEstatusReloj(Estatus.Deshabilitar))
            {
                this.a = "(Método: UsuarioBuscarTodos) - Error al cambiar estatus de dispositivo. Código de error: " + this.h.ToString() + " - " + this.GenerarMensajeDeError(this.h);
                return(this.c);
            }
            if (this.i.ReadAllUserID(1))
            {
                if (!this.i.ReadAllTemplate(1))
                {
                    this.a = "(Método: UsuarioBuscarTodos) - Error al obtener las huellas de los usuarios. Código de error: " + this.h.ToString() + " - " + this.GenerarMensajeDeError(this.h);
                    return(this.c);
                }
                string dwEnrollNumber = string.Empty;
                string Name           = string.Empty;
                string Password       = string.Empty;
                int    Privilege      = 0;
                bool   Enabled        = false;
                string TmpData        = string.Empty;
                int    TmpLength      = 0;
                int    Flag           = 0;
                if (!this.i.ReadAllUserID(1))
                {
                    this.a = "(Método: UsuarioBuscarTodos) - No se pudo obtener la información de la memoria. Código de error: " + this.h.ToString() + " - " + this.GenerarMensajeDeError(this.h);
                    return(this.c);
                }
                if (!this.i.ReadAllTemplate(1))
                {
                    this.a = "(Método: UsuarioBuscarTodos) - No se pudieron obtener las huellas de la memoria. Código de error: " + this.h.ToString() + " - " + this.GenerarMensajeDeError(this.h);
                    return(this.c);
                }
                this.c = new List <UsuarioInformacion>();
                while (this.i.SSR_GetAllUserInfo(1, out dwEnrollNumber, out Name, out Password, out Privilege, out Enabled))
                {
                    this.f = new UsuarioInformacion();
                    this.f.NumeroCredencial = int.Parse(dwEnrollNumber);
                    this.f.Nombre           = Name;
                    this.f.Permiso          = (Permiso)Privilege;
                    this.f.Contrasenia      = Password;
                    this.f.Activo           = Enabled;
                    this.f.Huellas          = new List <UsuarioHuella>();
                    for (int dwFingerIndex = 0; dwFingerIndex < 10; ++dwFingerIndex)
                    {
                        if (this.i.GetUserTmpExStr(1, dwEnrollNumber, dwFingerIndex, out Flag, out TmpData, out TmpLength))
                        {
                            this.f.Huellas.Add(new UsuarioHuella()
                            {
                                IndexHuella    = dwFingerIndex,
                                B64Huella      = TmpData,
                                LongitudHuella = TmpLength
                            });
                        }
                    }
                    this.c.Add(this.f);
                }
                if (DeshabilitarDispositivo && !this.CambiarEstatusReloj(Estatus.Habilitar))
                {
                    this.a = "(Método: UsuarioBuscarTodos) - Error al habilitar el dispositivo. Código de error: " + this.h.ToString() + " - " + this.GenerarMensajeDeError(this.h);
                    return(this.c);
                }
                this.g = true;
                return(this.c);
            }
            this.a = "(Método: UsuarioBuscarTodos) - Error al obtener la información de los usuarios. Código de error: " + this.h.ToString() + " - " + this.GenerarMensajeDeError(this.h);
            return(this.c);
        }