コード例 #1
0
        public List<Falta> GetFaltas(string username, string password)
        {
            Uniara ctx = new Uniara();
            List<Falta> faltas = null;
            bool isLogged = false;

            try
            {
                isLogged = ctx.GetAuthentication(username, password);
                if (isLogged)
                {
                    faltas = ctx.GetFaltas();
                }
            }
            catch (Exception ex)
            {
                throw new ServiceException(ex.Message);
            }

            if(!isLogged)
            {
                throw new NotAuthorizedExcetion(AppConstants.INVALID_CREDENTIAL);
            }

            return faltas;
        }
コード例 #2
0
        public Aluno GetFullAluno(string username, string password)
        {
            Uniara ctx = new Uniara();
            Aluno aluno = null;
            bool isLogged = false;

            try
            {
                isLogged = ctx.GetAuthentication(username, password);
                if (isLogged)
                {
                    aluno = ctx.GetAluno();
                }
            }
            catch (Exception ex)
            {
                throw new ServiceException(ex.Message);
            }

            if(!isLogged)
            {
                throw new NotAuthorizedExcetion(AppConstants.INVALID_CREDENTIAL);
            }

            return aluno;
        }
コード例 #3
0
        public Perfil GetPerfilAluno(string username, string password)
        {
            Uniara ctx = new Uniara();
            Perfil perfil = null;
            bool isLogged = false;

            try
            {
                isLogged = ctx.GetAuthentication(username, password);
                if(isLogged)
                {
                    perfil = ctx.GetPartialAluno().Perfil;
                }
            }
            catch(Exception ex)
            {
                throw new ServiceException(ex.Message);
            }

            if(!isLogged)
            {
                throw new NotAuthorizedExcetion(AppConstants.INVALID_CREDENTIAL);
            }

            return perfil;
        }