Пример #1
0
        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);
                    }
                }
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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();
        }
Пример #4
0
        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);
            }
        }
Пример #5
0
        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);
            }
        }