private void ProcessUserSelection() { if (UsersList.SelectedItems.Count != 1) { EditVoiceSamples.Enabled = false; } else { EditVoiceSamples.Enabled = true; } if (UsersList.SelectedItems.Count < 1) { return; } AccessibleLocationsList.Items.Clear(); //ListViewItemWithId selected = (ListViewItemWithId)UsersList.SelectedItems[0]; foreach (ListViewItemWithId item in UsersList.SelectedItems) { IList <Location> list = _secSystem.GetAccessibleLocations(item.Id); foreach (var loc in list) { if (!ContainsId(AccessibleLocationsList.Items, loc.Id)) { ListViewItemWithId locItem = new ListViewItemWithId(loc.Id, loc.Name); AccessibleLocationsList.Items.Add(locItem); } } } }
private void LoadAccessibleLocations(int levelId) { var list = _secSystem.GetSecLevelLocations(levelId); AccessibleLocationsList.Items.Clear(); foreach (Location loc in list) { ListViewItemWithId item = new ListViewItemWithId(loc.Id, loc.Id + ". " + loc.Name); AccessibleLocationsList.Items.Add(item); } }
private void EditVoiceSamples_Click(object sender, EventArgs e) { if (UsersList.SelectedItems.Count != 1) { return; } ListViewItemWithId item = (ListViewItemWithId)UsersList.SelectedItems[0]; int userId = item.Id; VoiceSampleEditor editorForm = new VoiceSampleEditor(userId, _secSystem); editorForm.ShowDialog(); }
private void UpdateLocationsList() { if (!EnsureLoginState()) { return; } var locationList = _secSystem.GetLocations(); LocationsList.Items.Clear(); foreach (var loc in locationList) { var item = new ListViewItemWithId(loc.Id, loc.Id.ToString() + ". " + loc.Name); LocationsList.Items.Add(item); } }
private void UpdateUserList() { if (!EnsureLoginState()) { return; } var userList = _secSystem.GetUsers(); UsersList.Items.Clear(); foreach (var user in userList) { SecLevel secLevel = _secSystem.GetSecLevelById(user.SecLevelId); var secLevelName = secLevel.Name; var item = new ListViewItemWithId(user.Id, user.FirstName + " " + user.LastName + " ---- " + secLevelName); UsersList.Items.Add(item); } }