Example #1
0
        public async Task <UserVM> GetCurrentClient()
        {
            try
            {
                UserVM user = await HttpMethods <UserVM> .GetAsync(Client, "/getUser");

                return(user);
            }
            catch (Exception)
            {
                return(null);
            }
        }
        public async Task <List <StudentVM> > GetStudentsToJoinIn(string courseid, string schoolid)
        {
            try
            {
                List <StudentVM> students = await HttpMethods <List <StudentVM> > .GetAsync(Client, "/getStudentsToJoinIn/" + courseid + "/" + schoolid);

                return(students);
            }
            catch (Exception)
            {
                return(new List <StudentVM>());
            }
        }
Example #3
0
        public async Task <List <StudentVM> > GetAllStudents()
        {
            try
            {
                List <StudentVM> students = await HttpMethods <List <StudentVM> > .GetAsync(Client, "/getAllStudents");

                return(students);
            }
            catch (Exception)
            {
                return(new List <StudentVM>());
            }
        }
Example #4
0
        public async Task <List <SchoolVM> > GetAllSchools()
        {
            try
            {
                List <SchoolVM> schools = await HttpMethods <List <SchoolVM> > .GetAsync(Client, "/getAllSchools");

                return(schools);
            }
            catch (Exception)
            {
                return(new List <SchoolVM>());
            }
        }
Example #5
0
        public async Task <List <TeacherVM> > GetAllTeachers()
        {
            try
            {
                List <TeacherVM> teachers = await HttpMethods <List <TeacherVM> > .GetAsync(Client, "/getAllTeachers");

                return(teachers);
            }
            catch (Exception)
            {
                return(new List <TeacherVM>());
            }
        }
Example #6
0
        public async Task <List <AddUserRoleVM> > GetUsersWithoutRoles(string roleId)
        {
            try
            {
                List <AddUserRoleVM> model = await HttpMethods <List <AddUserRoleVM> > .GetAsync(Client, "/getUsersWithoutRole/" + roleId);

                return(model);
            }
            catch (Exception)
            {
                return(new List <AddUserRoleVM>());
            }
        }
        public async Task <List <MarkVM> > GetMarks(string studentid, string courseid)
        {
            try
            {
                List <MarkVM> marks = await HttpMethods <List <MarkVM> > .GetAsync(Client, "/getMarks/" + studentid + "/" + courseid);

                return(marks);
            }
            catch (Exception)
            {
                return(new List <MarkVM>());
            }
        }
Example #8
0
        public async Task <List <EditRoleVM> > GetAllRoles()
        {
            try
            {
                List <EditRoleVM> roles = await HttpMethods <List <EditRoleVM> > .GetAsync(Client, "/getAllRoles");

                return(roles);
            }
            catch (Exception)
            {
                return(new List <EditRoleVM>());
            }
        }
Example #9
0
        public async Task <List <IdentityRole> > GetRolesList()
        {
            try
            {
                List <IdentityRole> roles = await HttpMethods <List <IdentityRole> > .GetAsync(Client, "/getRolesList");

                return(roles);
            }
            catch (Exception)
            {
                return(new List <IdentityRole>());
            }
        }
        public async Task <List <CourseVM> > GetCourses(string teacherid)
        {
            try
            {
                List <CourseVM> courses = await HttpMethods <List <CourseVM> > .GetAsync(Client, "/getCourses/" + teacherid);

                return(courses);
            }
            catch (Exception)
            {
                return(new List <CourseVM>());
            }
        }
Example #11
0
        public async Task <List <ExerciseVM> > GetAllExercises()
        {
            try
            {
                List <ExerciseVM> exercises = await HttpMethods <List <ExerciseVM> > .GetAsync(Client, "/getAllExercises");

                return(exercises);
            }
            catch (Exception)
            {
                return(new List <ExerciseVM>());
            }
        }
Example #12
0
        public async Task <StudentVM> GetStudentInfo(string studentid)
        {
            try
            {
                StudentVM student = await HttpMethods <StudentVM> .GetAsync(Client, "/getStudentInfo/" + studentid);

                return(student);
            }
            catch (Exception)
            {
                return(new StudentVM());
            }
        }
        public async Task <RoleVM> GetCurrentClientInfo()
        {
            try
            {
                RoleVM role = await HttpMethods <RoleVM> .GetAsync(Client, "/currentClientInfo");

                return(role);
            }
            catch (Exception)
            {
                return(new RoleVM {
                });
            }
        }
        public async Task <TeacherVM> GetTeacherInfo(string teacherid)
        {
            try
            {
                TeacherVM teacher = await HttpMethods <TeacherVM> .GetAsync(Client, "/getTeacherInfo/" + teacherid);

                return(teacher);
            }
            catch (Exception)
            {
                return(new TeacherVM {
                });
            }
        }
        public async Task <CourseVM> GetCourse(string courseid)
        {
            try
            {
                CourseVM course = await HttpMethods <CourseVM> .GetAsync(Client, "/getCourse/" + courseid);

                return(course);
            }
            catch (Exception)
            {
                return(new CourseVM {
                });
            }
        }
Example #16
0
        public async Task <ResultVM> RemoveRole(string roleid)
        {
            try
            {
                ResultVM result = await HttpMethods <ResultVM> .GetAsync(Client, "/removeRole/" + roleid);

                return(result);
            }
            catch (Exception e)
            {
                return(new ResultVM
                {
                    Message = e.Message,
                    Status = Status.Error
                });
            }
        }
Example #17
0
        public async Task <ResultVM> RemoveStudent(string studentid)
        {
            try
            {
                ResultVM result = await HttpMethods <ResultVM> .GetAsync(Client, "/deleteStudent/" + studentid);

                return(result);
            }
            catch (Exception e)
            {
                return(new ResultVM
                {
                    Message = e.Message,
                    Status = Status.Error
                });
            }
        }
        public async Task <ResultVM> RemoveCourse(string courseid)
        {
            try
            {
                ResultVM result = await HttpMethods <ResultVM> .GetAsync(Client, "/removeCourse/" + courseid);

                return(result);
            }
            catch (Exception e)
            {
                return(new ResultVM
                {
                    Status = Status.Error,
                    Message = e.Message
                });
            }
        }
Example #19
0
        public async Task <ResultVM> Logout()
        {
            try
            {
                ResultVM result = await HttpMethods <ResultVM> .GetAsync(Client, "/logout");

                return(result);
            }
            catch (Exception e)
            {
                return(new ResultVM
                {
                    Message = e.Message,
                    Status = Status.Error
                });
            }
        }
 public async Task <Member> GetCurrentClient()
 {
     return(await HttpMethods <Member> .GetAsync(Client, "/currentClient"));
 }