Exemplo n.º 1
0
        public async Task <SectionList> SearchGroupDataAsync(CourseId course, Term term)
        {
            var response = await RequestGet <SectionList>(WebRegApi.SearchGroupData, new NameValueCollection
            {
                ["subjcode"] = course.Subject,
                ["crsecode"] = course.Code,
                ["termcode"] = term.Code
            });

            return(response);
        }
Exemplo n.º 2
0
        public async Task <string> SearchCatelogAsync(CourseId course, Term term)
        {
            var responseType = new
            {
                CATALOG_DATA = string.Empty
            };

            var response = await RequestGet(WebRegApi.SearchCatelog, responseType, new NameValueCollection
            {
                ["subjcode"] = course.Subject,
                ["crsecode"] = course.Code,
                ["termcode"] = term.Code,
            });

            return(response.CATALOG_DATA);
        }
Exemplo n.º 3
0
        public async Task <IReadOnlyList <string> > SearchRestrictionAsync(CourseId course, Term term)
        {
            var responseType = new[]
            {
                new
                {
                    CRSE_REGIS_TYPE_CD = string.Empty,
                    CRSE_REGIS_FLAG    = string.Empty,
                    CRSE_REGIS_CODE    = string.Empty
                }
            };

            var response = await RequestGet(WebRegApi.SearchRestriction, responseType, new NameValueCollection
            {
                ["subjcode"] = course.Subject,
                ["crsecode"] = course.Code,
                ["termcode"] = term.Code,
            });

            return(response.Select(x => x.CRSE_REGIS_CODE).ToArray());
        }
Exemplo n.º 4
0
        public async Task <IReadOnlyList <(int order, CourseId course)> > GetPrerequisitesAsync(Term term, CourseId course)
        {
            var responseType = new[]
            {
                new
                {
                    SUBJECT_CODE  = string.Empty,
                    PREREQ_SEQ_ID = 0,
                    CRSE_TITLE    = string.Empty,
                    COURSE_CODE   = string.Empty,
                    GRADE_SEQ_ID  = string.Empty,
                    TYPE          = string.Empty
                }
            };

            var response = await RequestGet(WebRegApi.GetPrerequisites, responseType, new NameValueCollection
            {
                ["termcode"] = term.Code,
                ["subjcode"] = course.Subject,
                ["crsecode"] = course.Code
            });

            return(response.Select(x => (order: x.PREREQ_SEQ_ID, course: new CourseId
            {
                Code = x.COURSE_CODE.Trim(),
                Subject = x.SUBJECT_CODE.Trim()
            })).ToArray());
        }