示例#1
0
 public ActionResult Index()
 {
     ViewBag.Title = "Classes";
     var sectionService = new SectionDataService();
     dynamic sections = sectionService.GetSections(SessionInfo.Current.AccessToken, SessionInfo.Current.UserId);
     var model = new SectionListViewModel {Sections = sections};
     return View(model);
 }
示例#2
0
 public async Task<ActionResult> IndexAsync(int? limit, int? offset)
 {
     ViewBag.Title = "Classes";
     var sectionService = new SectionDataService();
     var sections = await sectionService.GetSectionsAsync(SessionInfo.Current.AccessToken, SessionInfo.Current.UserId, limit, offset)
                                         .ContinueWith(t => new SectionListViewModel { Sections = t.Result });
     return View("Index", sections);
 }
示例#3
0
 public async Task<ActionResult> GetStudentsAsync(string sectionId, int? limit, int? offset, string view)
 {
     if (string.IsNullOrEmpty(sectionId))
     {
         return RedirectToAction("IndexAsync");
     }
     try
     {
         var sectionService = new SectionDataService();
         return View("GetStudents", await sectionService.GetSectionStudentAssociationStudentListAsync(SessionInfo.Current.AccessToken, sectionId, limit, offset, view));
     }
     catch(Exception ex)
     {
         Trace.TraceError(ex.Message);
         ViewBag.Error = ex.Message;
         return Content("No students found");
     }
 }