コード例 #1
0
ファイル: GestorUsuario.cs プロジェクト: josegomez-dev/TRAVEL
        public Usuario RetrievePorAutentificacion(Usuario usuario, string contraseña)
        {
            try
            {
                HashedPass = GetMD5(contraseña);
                contraseña = HashedPass;
                usr        = _crudFactory.RetrieveAutentificacion <Usuario>(usuario);

                if (usr != null)
                {
                    if (ValidarContraseñas(HashedPass, usr.Contrasena) == true)
                    {
                        return(usr);
                    }
                    else
                    {
                        throw gestorEx.controlarExcepcion(new TRV_Exception(TRV_Exception.ExceptionCode.ContrasenaNotMatch));
                    }
                }
                else
                {
                    throw gestorEx.controlarExcepcion(new TRV_Exception(TRV_Exception.ExceptionCode.CorreoNotExist));
                }
            }
            catch (TRV_Exception ex)
            {
                throw ControlarExcepcion(ex);
            }
        }