private void FillListBox() { Userods.RefreshCache(); UserGroups.RefreshCache(); GroupPermissions.RefreshCache(); listUser.BeginUpdate(); listUser.Items.Clear(); if (PrefC.GetBool(PrefName.UserNameManualEntry)) { //Because _listUsers is used to verify the user name typed in, we need to include both non-hidden and CEMT users for offices that type in their credentials instead of picking. _listUsers = Userods.GetUsers(true); } else if (checkShowCEMTUsers.Checked) //Only show list of CEMT users. { _listUsers = Userods.GetUsersForCEMT().Where(x => !x.IsHidden).ToList(); } else //This will be the most common way to fill the user list. Only includes non-hidden, non-CEMT users. { _listUsers = Userods.GetUsers(); } _listUsers.ForEach(x => listUser.Items.Add(x)); if (UserNumPrompt > 0) { listUser.SelectedIndex = _listUsers.FindIndex(x => x.UserNum == UserNumPrompt); //can be -1 if not found } else if (Security.CurUser != null) { listUser.SelectedIndex = _listUsers.FindIndex(x => x.UserNum == Security.CurUser.UserNum); //can be -1 if not found } if (listUser.SelectedIndex == -1 && listUser.Items.Count > 0) //It is possible there are no users in the list if all users are CEMT users. { listUser.SelectedIndex = 0; } listUser.EndUpdate(); }
private void FillList() { UserGroups.RefreshCache(); listGroups.Items.Clear(); for (int i = 0; i < UserGroups.List.Length; i++) { listGroups.Items.Add(UserGroups.List[i].Description); } }
private void FillList() { UserGroups.RefreshCache(); listGroups.Items.Clear(); _listUserGroups = UserGroups.GetWhere(x => IsAdminMode || !GroupPermissions.HasPermission(x.UserGroupNum, Permissions.SecurityAdmin, 0)); for (int i = 0; i < _listUserGroups.Count; i++) { listGroups.Items.Add(_listUserGroups[i].Description); } }
private void FillListBox() { Userods.RefreshCache(); UserGroups.RefreshCache(); GroupPermissions.RefreshCache(); listUser.BeginUpdate(); listUser.Items.Clear(); shortList = UserodC.ShortList; for (int i = 0; i < shortList.Count; i++) { listUser.Items.Add(shortList[i]); if (Security.CurUser != null && shortList[i].UserNum == Security.CurUser.UserNum) { listUser.SelectedIndex = i; } } if (listUser.SelectedIndex == -1) { listUser.SelectedIndex = 0; } listUser.EndUpdate(); }
private void FillUsers() { UserGroups.RefreshCache(); Cache.Refresh(InvalidType.Security); SelectedGroupNum = 0; gridMain.BeginUpdate(); gridMain.Columns.Clear(); ODGridColumn col = new ODGridColumn(Lan.g("TableSecurity", "Username"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Group"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Employee"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Provider"), 90); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Clinic"), 80); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "ClinicRestricted"), 100, HorizontalAlignment.Center); gridMain.Columns.Add(col); col = new ODGridColumn(Lan.g("TableSecurity", "Strong"), 80, HorizontalAlignment.Center); gridMain.Columns.Add(col); gridMain.Rows.Clear(); ODGridRow row; string usertype = "all"; if (comboUsers.SelectedIndex == 1) { usertype = "prov"; } if (comboUsers.SelectedIndex == 2) { usertype = "emp"; } if (comboUsers.SelectedIndex == 3) { usertype = "other"; } long classNum = 0; if (comboSchoolClass.Visible && comboSchoolClass.SelectedIndex > 0) { classNum = SchoolClasses.List[comboSchoolClass.SelectedIndex - 1].SchoolClassNum; } ListUser = Userods.RefreshSecurity(usertype, classNum); string userdesc; for (int i = 0; i < ListUser.Count; i++) { row = new ODGridRow(); userdesc = ListUser[i].UserName; if (ListUser[i].IsHidden) { userdesc += Lan.g(this, "(hidden)"); } row.Cells.Add(userdesc); row.Cells.Add(UserGroups.GetGroup(ListUser[i].UserGroupNum).Description); row.Cells.Add(Employees.GetNameFL(ListUser[i].EmployeeNum)); row.Cells.Add(Providers.GetLongDesc(ListUser[i].ProvNum)); row.Cells.Add(Clinics.GetDesc(ListUser[i].ClinicNum)); row.Cells.Add(ListUser[i].ClinicIsRestricted?"X":""); row.Cells.Add(ListUser[i].PasswordIsStrong?"X":""); gridMain.Rows.Add(row); } gridMain.EndUpdate(); }