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

                return(user);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Пример #2
0
        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>());
            }
        }
Пример #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>());
            }
        }
Пример #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>());
            }
        }
Пример #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>());
            }
        }
Пример #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>());
            }
        }
Пример #7
0
        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>());
            }
        }
Пример #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>());
            }
        }
Пример #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>());
            }
        }
Пример #10
0
        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>());
            }
        }
Пример #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>());
            }
        }
Пример #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());
            }
        }
Пример #13
0
        public async Task <RoleVM> GetCurrentClientInfo()
        {
            try
            {
                RoleVM role = await HttpMethods <RoleVM> .GetAsync(Client, "/currentClientInfo");

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

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

                return(course);
            }
            catch (Exception)
            {
                return(new CourseVM {
                });
            }
        }
Пример #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
                });
            }
        }
Пример #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
                });
            }
        }
Пример #18
0
        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
                });
            }
        }
Пример #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
                });
            }
        }
Пример #20
0
 public async Task <Member> GetCurrentClient()
 {
     return(await HttpMethods <Member> .GetAsync(Client, "/currentClient"));
 }