async Task LoadUser() { if (IsBusy) { return; } IsBusy = true; try { AllUserList.Clear(); var userList = await UserStore.GetAllUsersAsync(); foreach (var user in userList) { AllUserList.Add(user); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
/// <summary> /// 5 April 2014 /// Jonathan Sanborn & Harvey Mercado /// /// Removes all the students and their asscoiated objects in the passed in list from the system. /// </summary> /// <param name="RemoveList">The List of students to remove</param> public void RemoveStudents(List <Student> RemoveList) { foreach (Student s in RemoveList) { foreach (Assignment a in s.Assignments) { foreach (AssignmentAttempt aa in a.AssignmentAttempts) { FileHandler.DeleteAssignmentAttempt(aa); } FileHandler.DeleteAssignment(a); } StudentList.Remove(s); AllUserList.Remove(s); FileHandler.DeleteUser(s); } }
/// <summary> /// 22 March 2014 /// Jonathan Sanborn & Harvey Mercado /// Adds a new student to the system /// </summary> /// <param name="newUser">A student user to add to the system</param> internal void AddNewStudent(Student newUser) { AllUserList.Add(newUser); StudentList.Add(newUser); this.FileHandler.SaveNewUser(newUser); }