private void LoadAllUsers() { AllUsers.Clear(); var users = _userRepository.GetAll(); AllUsers.AddRange(users); }
/// <summary> /// Displays employee by searched Id /// </summary> /// <param name="id"></param> public void DisplayEmployeeById(int id) { AllUsers.Clear(); foreach (Employee e in AllEmployees.ToList()) { if (e.EmployeeId == id) { AllUsers.Add(e); } } }
/// <summary> /// Displays student by searched Id. /// </summary> /// <param name="id"></param> public void DisplayStudentById(int id) { AllUsers.Clear(); foreach (Student p in AllStudents.ToList()) { if (p.StudentId == id) { AllUsers.Add(p); } } }
private void ClearTabs() { AllUsers.Clear(); foreach (var room in Rooms) { room.Dispose(); } Rooms.Clear(); Rooms.Add(new RoomViewModel(this, new Room(null, ServerModel.MainRoomName), null)); SelectedRoomIndex = 0; }
public async Task LoadAsync() { AllUsers.Clear(); var users = await _userRepository.GetAllAsync(); foreach (var user in users) { if (user.UserName == "*****@*****.**") { continue; } var modelWrapper = new UserWrapper(user); AllUsers.Add(modelWrapper); } }
private async void GetAllUsers() { try { var users = await remoteService.GetAllUser(); AllUsers.Clear(); foreach (var item in users) { if (item.Id != Settings.KeySettings) { AllUsers.Add(item); } } } catch { } }
private void ClientRoomRefreshed(object sender, RoomEventArgs e) { Dispatcher.BeginInvoke(new Action <RoomEventArgs>(args => { if (args.Room.Name == ServerModel.MainRoomName) { AllUsers.Clear(); using (var client = ClientModel.Get()) foreach (string nick in args.Room.Users) { User user = args.Users.Single(u => u.Equals(nick)); AllUsers.Add(new UserViewModel(user, null) { IsClient = user.Equals(client.User) }); } } }), e); }
private async void OpenAndFilterNavigationView(OpenAndFilterNavigationViewEventArgs args) { if (String.IsNullOrEmpty(args.SelectedItem)) { await LoadAsync(); } else { var filteredUsers = AllUsers.Where(u => u.FullName.ToLower().StartsWith(args.SelectedItem.ToLower())); List <UserWrapper> tempList = new List <UserWrapper>(); foreach (var filteredUser in filteredUsers) { tempList.Add(filteredUser); } AllUsers.Clear(); foreach (var item in tempList) { AllUsers.Add(item); } } }