コード例 #1
0
 private void FillList()
 {
     UserGroups.RefreshCache();
     listGroups.Items.Clear();
     _listUserGroups = UserGroups.GetDeepCopy();
     for (int i = 0; i < _listUserGroups.Count; i++)
     {
         listGroups.Items.Add(_listUserGroups[i].Description);
     }
 }
コード例 #2
0
        private void FormCentralUserEdit_Load(object sender, EventArgs e)
        {
            checkIsHidden.Checked = UserCur.IsHidden;
            textUserName.Text     = UserCur.UserName;
            List <UserGroup> listUserGroups = UserGroups.GetDeepCopy();

            _isFillingList = true;
            for (int i = 0; i < listUserGroups.Count; i++)
            {
                UserGroup             groupCur     = listUserGroups[i];
                ODBoxItem <UserGroup> boxItemGroup = new ODBoxItem <UserGroup>(groupCur.Description, groupCur);
                listUserGroup.Items.Add(boxItemGroup);
                if (UserCur.IsInUserGroup(groupCur.UserGroupNum))
                {
                    listUserGroup.SetSelected(i, true);
                }
            }
            if (listUserGroup.SelectedIndex == -1)          //never allowed to delete last group, so this won't fail
            {
                listUserGroup.SelectedIndex = 0;
            }
            _isFillingList = false;
            securityTreeUser.FillTreePermissionsInitial();
            RefreshUserTree();
            if (UserCur.PasswordHash == "")
            {
                butPassword.Text = "Create Password";
            }
            _listAlertSubsOld = AlertSubs.GetAllForUser(Security.CurUser.UserNum);
            listAlertSubMulti.Items.Clear();
            string[] arrayAlertTypes = Enum.GetNames(typeof(AlertType));
            for (int i = 0; i < arrayAlertTypes.Length; i++)
            {
                listAlertSubMulti.Items.Add(arrayAlertTypes[i]);
                listAlertSubMulti.SetSelected(i, _listAlertSubsOld.Exists(x => x.Type == (AlertType)i));
            }
            if (UserCur.IsNew)
            {
                butUnlock.Visible = false;
            }
        }