Beispiel #1
0
        public async Task <CounselDto[]> GetAvailableCounselsBySubject(SubjectDto subject)
        {
            string endpoint = endpointResolver.ResolveUrl("GetListProfesorMateriaApp", "AlumnoMateria") + "?idMateria=" + subject.SubjectId;
            IHttpClientResponse clientResponse = await httpClient.Get(endpoint);

            return(clientResponse.GetContentAsObject <CounselDto[]>());
        }
Beispiel #2
0
        public async Task <List <SubjectDto> > GetSubjects()
        {
            string endpoint = endpointResolver.ResolveUrl("GetListMateriaApps", "Materia");
            IHttpClientResponse clientResponse = await httpClient.Get(endpoint);

            return(clientResponse.GetContentAsObject <List <SubjectDto> >());
        }
Beispiel #3
0
        public async Task <CounselDto> RegisterCounsel(CounselDto counsel)
        {
            string endpoint = endpointResolver.ResolveUrl("InsProfesorMateriaApp", "ProfesorMateria");
            IHttpClientResponse clientResponse = await httpClient.Post(endpoint, counsel);

            return(clientResponse.GetContentAsObject <CounselDto>());
        }
        public async Task <UserDto> GetUserData()
        {
            ITokenProvider tokenProvider = httpClient.GetTokenProvider();

            string endpoint = endpointResolver.ResolveUrl("GetDataPerson", "Usuario") + "?token=" + tokenProvider.GetToken().AccessValue;
            IHttpClientResponse clientResponse = await httpClient.Get(endpoint);

            return(clientResponse.GetContentAsObject <UserDto>());
        }
Beispiel #5
0
        public async Task <CounselRequestDto> AcceptCounselRequest(CounselRequestDto counselRequest)
        {
            string endpoint = endpointResolver.ResolveUrl("SolicitarProfesorMateriaApp", "ProfesorMateria")
                              + "?idProfesor=" + counselRequest.TeacherId + "&idProfesorMateria=" + counselRequest.TeacherSubjectId;

            IHttpClientResponse clientResponse = await httpClient.Post(endpoint, new { });

            return(clientResponse.GetContentAsObject <CounselRequestDto>());
        }
Beispiel #6
0
        public async Task <CounselRequestDto[]> GetCounselRequestsForStudent(UserDto studentUser)
        {
            string endpoint = endpointResolver.ResolveUrl("GetListAlumnoMateriaApps", "AlumnoMateria")
                              + "?idAlumno=" + studentUser.UserId;

            IHttpClientResponse clientResponse = await httpClient.Get(endpoint);

            return(clientResponse.GetContentAsObject <CounselRequestDto[]>());
        }
Beispiel #7
0
        public async Task <CounselRequestDto[]> GetCounselRequestsForTeacher(UserDto teacherUser, bool acceptedRequests)
        {
            string endpoint = endpointResolver.ResolveUrl("GetListProfesorMateriaApps", "ProfesorMateria")
                              + "?idProfesor=" + teacherUser.UserId + "&aceptada=" + (acceptedRequests ? "true" : "false");

            IHttpClientResponse clientResponse = await httpClient.Get(endpoint);

            return(clientResponse.GetContentAsObject <CounselRequestDto[]>());
        }
Beispiel #8
0
        public async Task <StudentCounselDto> SignupToCounsel(UserDto student, CounselDto counsel)
        {
            string endpoint = endpointResolver.ResolveUrl("InsProfesorMateriaApp", "AlumnoMateria")
                              + "?idAlumno=" + student.UserId + "&idProfesorMateria=" + counsel.TeacherSubjectId;

            IHttpClientResponse clientResponse = await httpClient.Post(endpoint, new { });

            return(clientResponse.GetContentAsObject <StudentCounselDto>());
        }