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; }
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; }
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; }