private void PopulateUsers() { AllUsers.Add(PurpleUser); AllUsers.Add(PeachUser); AllUsers.Add(AquaUser); AllUsers.Add(BlueUser); AllUsers.Add(PinkUser); AllUsers.Add(GreenUser); }
private void CreateUser() { SelectedUser = new User(); SelectedUser.Username = NewUsername; AllUsers.Add(SelectedUser); SelectedUserNotSaved = true; usekeyfile = false; // HostedServer.settingsrepo.AddUser(new User() { Username = NewUsername }); }
private async Task LoadUsers() { var usersReturned = await _userService.Get <List <Model.UserProfile> >(null); foreach (var item in usersReturned) { AllUsers.Add(item); QueryUsers.Add(item); } }
private TestUser GenerateRandomUser() { var userName = "******" + UserCount++; var user = new TestUser { Id = userName, Password = GenerateRandomPassword(userName), Groups = new HashSet <string>(), Permissions = new Permission() }; AllUsers.Add(user); return(user); }
/// <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); } } }
/// <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); } } }
public void AddUser() { User c = this.dm.CreateObject <User>(); c.Id = GuidComb.Generate(); dm.AddUser(c); UserViewModel vm = new UserViewModel(c); AllUsers.Add(vm); CurrentUser = vm; }
/// <summary> /// We get all employees from DB and populates list to display them. /// </summary> public async void DisplayEmployees() { if (AllEmployees.Count == 0) { AllEmployees = await ApiHelper.Instance.GetAllEmployees(); } foreach (Person p in AllEmployees) { if (!AllUsers.Contains(p)) { AllUsers.Add(p); } } }
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); } }
/// <summary> /// Initializes the state amd data of the view model instance. /// </summary> protected override void OnInitialize() { try { var userList = _userRepository.GetAllUsers(); AllUsers.Add(string.Empty);//For any user if (null != userList && userList.Any()) { var userNameList = userList.Select(u => u.Username); AllUsers.AddRange(userNameList); Username = string.Empty;//set the selected user to all. } } catch (Exception ex) { LogUtil.LogError("TransactionFilterViewModel", "OnInitialize", ex); _messagingService.ShowMessage(ErrorMessages.ERR_FAILED_TO_GET_USERS, DialogType.Error); } }
/// <summary> /// Liest das AD aus und gibt eine Liste mit allen aktivien Usern zurück /// </summary> /// <returns></returns> private Task GetAllADUsers() { return(Task.Factory.StartNew(() => { // create your domain context PrincipalContext ctx = new PrincipalContext(ContextType.Domain); // define a "query-by-example" principal - here, we search for a UserPrincipal UserPrincipal qbeUser = new UserPrincipal(ctx); // Erstellt den Eintrag der während des Ladens angezeigt wird UserPrincipal loading = new UserPrincipal(ctx) { Name = "loading ..." }; // Fügt den Lade User der Liste hinzu die angezeigt wird UsersFiltered = new ObservableCollection <UserPrincipal> { loading }; // create your principal searcher passing in the QBE principal PrincipalSearcher srch = new PrincipalSearcher(qbeUser); List <UserPrincipal> lst = new List <UserPrincipal>(); // find all matches foreach (var found in srch.FindAll()) { if (found is UserPrincipal user) { if (user.Enabled.Value) { AllUsers.Add(user); } } } // Sortiert die Liste Aller User AllUsers.Sort((x, y) => x.Name.CompareTo(y.Name)); // Kopiert zum Start alle User in die gefilterte Liste UsersFiltered = new ObservableCollection <UserPrincipal>(AllUsers); })); }
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); } } }
/// <summary> /// Get the User object for the current identity /// </summary> /// <param name="usr">The identity of the user</param> /// <returns>Populated User if it exists, otherwise null</returns> public static User CreateOrGetUser(IIdentity usr) { AllUsers items = new AllUsers(); User item = null; try { item = items.Where(i => String.Equals(i.UserName, usr.Name, StringComparison.CurrentCultureIgnoreCase)).SingleOrDefault(); } catch (InvalidOperationException ex) { throw new Exceptions.UIMessageException(string.Format("Corrupt Data: Multiple User records with User Name '{0}' found.", usr.Name), ex); } if (item == null) { item = new User { UserId = Guid.NewGuid(), UserName = usr.Name, DisplayName = usr.Name, ShiftDefaultStartTime = System.Convert.ToDateTime(Constants.cstrConfigKeyStandardStartTime), ShiftDefaultEndTime = System.Convert.ToDateTime(Constants.cstrConfigKeyStandardEndTime) }; items.Add(item); items.Save(); } return(item); }
public void CreatePerson(User user) { AllUsers.Add(user); }
/// <summary> /// Used for user to change PIN and/or name. /// </summary> /// <param name="changedUser"></param> public void ChangeLoggedInUser(User changedUser) { AllUsers.Remove(LoggedInUser); AllUsers.Add(changedUser); LoggedInUser = changedUser; }
public void AddNewUser(User newUser) { AllUsers.Add(newUser); }
public void CreatePerson(string firstName, string lastName, List <User> friends, List <Group> groups) { AllUsers.Add(new User(firstName, lastName, friends, groups)); }
private Session() { AllUsers.Add(new RemoteUser { Id = User.Id, Username = User.Username }); }
public User() { Id = GenerateId.GenerateUserId(this); AllUsers.Add(this); }