/// <summary> /// Submit a list of attendances for this section. /// </summary> /// <param name="attendances"></param> /// <returns></returns> public async Task <bool> SubmitAttendance(List <AttendanceInfo> attendances) { List <AttendanceInfo> submitted = (List <AttendanceInfo>) await WebhostAPICall.GetObjectAsync(String.Format("api/self/section/{0}/attendance", this.Id), typeof(List <AttendanceInfo>), "PUT", typeof(List <AttendanceInfo>), attendances); return(submitted.Count == attendances.Count); }
public async Task <CommentHeaderInfo> CurrentCommentHeaderAsync() { try { return((CommentHeaderInfo)await WebhostAPICall.GetObjectAsync(String.Format("api/self/sections/{0}/comment_header", this.Id), typeof(CommentHeaderInfo))); } catch (WebException) { return(await CreateBlankHeaderAsync()); } }
public async Task <CommentInfo> CurrentCommentAsync() { try { return((CommentInfo)await WebhostAPICall.GetObjectAsync(String.Format("api/self/sections/{0}/students/{1}/comment", Comments.CommentSettings.CurrentHeaderParagraph.SectionId, this.Id), typeof(CommentHeaderInfo))); } catch (WebException) { return(await CreateBlankCommentAsync()); } }
public async static Task <UserInfo> GetCurrent(bool isTeacher = true) { if (_Current == null && isTeacher) { _Current = (TeacherInfo)(await WebhostAPICall.GetObjectAsync("api/self", typeof(TeacherInfo))); } else if (_Current == null) { _Current = (StudentInfo)await WebhostAPICall.GetObjectAsync("api/self", typeof(StudentInfo)); } return(_Current); }
/// <summary> /// Get attendances for a particular date. /// </summary> /// <param name="date"></param> /// <returns></returns> public async Task <List <AttendanceInfo> > GetAttendances(DateTime date) { return((List <AttendanceInfo>) await WebhostAPICall.GetObjectAsync(String.Format("api/self/sections/{0}/attendance?datebinary={1}", this.Id, date.ToBinary()), typeof(List <AttendanceInfo>))); }
/// <summary> /// Get today's attendances. /// </summary> public async Task <List <AttendanceInfo> > AttendancesToday() { return((List <AttendanceInfo>) await WebhostAPICall.GetObjectAsync(String.Format("api/self/sections/{0}/attendance", this.Id), typeof(List <AttendanceInfo>))); }
public async Task <HttpWebResponse> SaveCommentHeaderAsync(String data) { return(await WebhostAPICall.SendAuthorizedApiRequestAsync(String.Format("api/self/sections/{0}/comment_header", this.Id), "PUT", typeof(String), data)); }
public async Task <CommentHeaderInfo> CreateBlankHeaderAsync() { return((CommentHeaderInfo)await WebhostAPICall.GetObjectAsync(String.Format("api/self/sections/{0}/comment_header", this.Id), typeof(CommentHeaderInfo), "PUT", typeof(String), "")); }
public async Task <HttpWebResponse> SaveCommentAsync(String data) { return(await WebhostAPICall.SendAuthorizedApiRequestAsync(String.Format("api/self/sections/{0}/students/{1}/comment", Comments.CommentSettings.CurrentHeaderParagraph.SectionId, this.Id), "PUT", typeof(String), data)); }
public async Task <List <SectionInfo> > CurrentSections() { return((List <SectionInfo>) await WebhostAPICall.GetObjectAsync("api/self/sections/current?detailed=true", typeof(List <SectionInfo>))); }
public async Task <List <StudentInfo> > Advisees() { return((List <StudentInfo>) await WebhostAPICall.GetObjectAsync("api/self/advisees", typeof(List <StudentInfo>))); }