@@ -49,12 +49,19 @@ public HttpWebResponse Login(string link, string username, string password, out
4949
5050 public Response GetAll ( CookieContainer cookies , Uri requestUri , string link )
5151 {
52+ var studentInfo = new Student ( ) ;
5253 var oldAssignmentList = new List < List < TranscriptCourse > > ( ) ;
5354 var currentAssignmentList = new List < List < AssignmentCourse > > ( ) ;
5455 var reportCardList = new List < List < Course > > ( ) ;
5556 var iprList = new List < List < Course > > ( ) ;
5657 try
5758 {
59+ //student info
60+ string studentData = Utils . GetData ( cookies , requestUri , link , ResponseType . Registration ) ;
61+ var studentDataDocument = new HtmlDocument ( ) ;
62+ studentDataDocument . LoadHtml ( studentData ) ;
63+ studentInfo = StudentInfo . GetAllStudentInfo ( studentDataDocument ) ;
64+
5865 //report card
5966 string reportCardData = Utils . GetData ( cookies , requestUri , link , ResponseType . ReportCards ) ;
6067 var reportCardHtmlDocument = new HtmlDocument ( ) ;
@@ -85,12 +92,41 @@ public Response GetAll(CookieContainer cookies, Uri requestUri, string link)
8592 return new Response
8693 {
8794 Message = "Success" ,
95+ StudentInfo = studentInfo ,
8896 AssignmentList = currentAssignmentList ,
8997 TranscriptList = oldAssignmentList ,
9098 ReportCardList = reportCardList ,
9199 IprList = iprList
92100 } ;
93101 }
102+
103+ public Response GetStudentInfo ( CookieContainer cookies , Uri requestUri , string link )
104+ {
105+ var studentInfo = new Student ( ) ;
106+ var reportCardCourses = new List < List < Course > > ( ) ;
107+ try
108+ {
109+ string studentData = Utils . GetData ( cookies , requestUri , link , ResponseType . Registration ) ;
110+ var studentDataDocument = new HtmlDocument ( ) ;
111+ studentDataDocument . LoadHtml ( studentData ) ;
112+ studentInfo = StudentInfo . GetAllStudentInfo ( studentDataDocument ) ;
113+ }
114+ catch ( Exception e )
115+ {
116+ Console . WriteLine ( e ) ;
117+ return new Response
118+ {
119+ Message = $ "Error 404: Could not fetch information. Exception: { e } "
120+ } ;
121+ }
122+
123+ return new Response
124+ {
125+ Message = "Success" ,
126+ StudentInfo = studentInfo
127+ } ;
128+ }
129+
94130
95131 public Response GetCourses ( CookieContainer cookies , Uri requestUri , string link )
96132 {
0 commit comments