예제 #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);
        }
예제 #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);
        }
예제 #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());
        }
예제 #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());
        }