private void FillForm(){ ProgramProperties.RefreshCache(); PropertyList=ProgramProperties.GetForProgram(ProgramCur.ProgramNum); textProgName.Text=ProgramCur.ProgName; textProgDesc.Text=ProgramCur.ProgDesc; checkEnabled.Checked=ProgramCur.Enabled; if(GetProp("HideChartRxButtons")=="1") { checkHideButChartRx.Checked=true; } else { checkHideButChartRx.Checked=false; } if(GetProp("ProcRequireSignature")=="1") { checkProcRequireSignature.Checked=true; } else { checkProcRequireSignature.Checked=false; } if(GetProp("ProcNotesNoIncomplete")=="1") { checkProcNotesNoIncomplete.Checked=true; } else { checkProcNotesNoIncomplete.Checked=false; } SetModeRadioButtons(GetProp("eClinicalWorksMode")); SetModeVisibilities(); textECWServer.Text=GetProp("eCWServer");//this property will not exist if using Oracle, eCW will never use Oracle if(HL7Defs.IsExistingHL7Enabled()) { HL7Def def=HL7Defs.GetOneDeepEnabled(); textHL7Server.Text=def.HL7Server; textHL7ServiceName.Text=def.HL7ServiceName; textHL7FolderIn.Text=def.OutgoingFolder;//because these are the opposite of the way they are in the HL7Def textHL7FolderOut.Text=def.IncomingFolder; checkQuadAsToothNum.Checked=def.IsQuadAsToothNum; } else { textHL7Server.Text=GetProp("HL7Server");//this property will not exist if using Oracle, eCW will never use Oracle textHL7ServiceName.Text=GetProp("HL7ServiceName");//this property will not exist if using Oracle, eCW will never use Oracle textHL7FolderIn.Text=PrefC.GetString(PrefName.HL7FolderIn); textHL7FolderOut.Text=PrefC.GetString(PrefName.HL7FolderOut); //if a def is enabled, the value associated with the def will override this setting checkQuadAsToothNum.Checked=GetProp("IsQuadAsToothNum")=="1";//this property will not exist if using Oracle, eCW will never use Oracle } textODServer.Text=MiscData.GetODServer(); comboDefaultUserGroup.Items.Clear(); _listUserGroups=UserGroups.GetList(); for(int i=0;i<_listUserGroups.Count;i++) { comboDefaultUserGroup.Items.Add(_listUserGroups[i].Description); if(GetProp("DefaultUserGroup")==_listUserGroups[i].UserGroupNum.ToString()) { comboDefaultUserGroup.SelectedIndex=i; } } checkShowImages.Checked=GetProp("ShowImagesModule")=="1"; checkFeeSchedules.Checked=GetProp("FeeSchedulesSetManually")=="1"; textMedPanelURL.Text=GetProp("MedicalPanelUrl");//this property will not exist if using Oracle, eCW will never use Oracle checkLBSessionId.Checked=GetProp("IsLBSessionIdExcluded")=="1"; }
///<summary>Fills listUserTabUserGroups.</summary> private void FillUserTabGroups() { _isFillingList = true; listUserTabUserGroups.Items.Clear(); foreach (UserGroup groupCur in UserGroups.GetList(IsForCEMT)) { listUserTabUserGroups.Items.Add(new ODBoxItem <UserGroup>(groupCur.Description, groupCur)); } _isFillingList = false; }
private void InitializeOnStartup() { _listUserGroups = UserGroups.GetList(); comboUserGroup.Items.AddList(_listUserGroups, x => x.Description); comboUserGroup.SetSelectedKey <UserGroup>(_userGroupNum, x => x.UserGroupNum); if (comboUserGroup.SelectedIndex == -1) { comboUserGroup.SelectedIndex = 0; } _listGroupPermissions = GroupPermissions.GetForUserGroups(_listUserGroups.Select(x => x.UserGroupNum).ToList(), Permissions.DashboardWidget); _listGroupPermissionsOld = _listGroupPermissions.Select(x => x.Copy()).ToList(); }
///<summary>Refreshes the UserGroups list box on the "User" tab. Also refreshes the security tree. ///Public so that it can be called from the Form that implements this control.</summary> public void RefreshUserTabGroups() { List <UserGroup> listUserGroups = (SelectedUser == null) ? UserGroups.GetList(IsForCEMT) : SelectedUser.GetGroups(IsForCEMT); _isFillingList = true; listUserTabUserGroups.Items.Clear(); for (int i = 0; i < listUserGroups.Count; i++) { listUserTabUserGroups.Items.Add(new ODBoxItem <UserGroup>(listUserGroups[i].Description, listUserGroups[i])); if (SelectedUser != null) { listUserTabUserGroups.SetSelected(i, true); } } _isFillingList = false; //RefreshTree takes a while (it has to draw many images) so this is to show the usergroup selections before loading the tree. Application.DoEvents(); RefreshUserTree(); }
private void FormGlobalSecurity_Load(object sender, EventArgs e) { textLogOffAfterMinutes.Text = PrefC.GetInt(PrefName.SecurityLogOffAfterMinutes).ToString(); checkAllowLogoffOverride.Checked = PrefC.GetBool(PrefName.SecurityLogOffAllowUserOverride); checkPasswordsMustBeStrong.Checked = PrefC.GetBool(PrefName.PasswordsMustBeStrong); checkPasswordsStrongIncludeSpecial.Checked = PrefC.GetBool(PrefName.PasswordsStrongIncludeSpecial); checkPasswordForceWeakToStrong.Checked = PrefC.GetBool(PrefName.PasswordsWeakChangeToStrong); checkTimecardSecurityEnabled.Checked = PrefC.GetBool(PrefName.TimecardSecurityEnabled); checkCannotEditOwn.Checked = PrefC.GetBool(PrefName.TimecardUsersDontEditOwnCard); checkCannotEditOwn.Enabled = checkTimecardSecurityEnabled.Checked; checkDomainLoginEnabled.Checked = PrefC.GetBool(PrefName.DomainLoginEnabled); textDomainLoginPath.ReadOnly = !checkDomainLoginEnabled.Checked; textDomainLoginPath.Text = PrefC.GetString(PrefName.DomainLoginPath); checkLogOffWindows.Checked = PrefC.GetBool(PrefName.SecurityLogOffWithWindows); checkUserNameManualEntry.Checked = PrefC.GetBool(PrefName.UserNameManualEntry); if (PrefC.GetDate(PrefName.BackupReminderLastDateRun).ToShortDateString() == DateTime.MaxValue.AddMonths(-1).ToShortDateString()) { checkDisableBackupReminder.Checked = true; } if (PrefC.GetInt(PrefName.SecurityLockDays) > 0) { textDaysLock.Text = PrefC.GetInt(PrefName.SecurityLockDays).ToString(); } if (PrefC.GetDate(PrefName.SecurityLockDate).Year > 1880) { textDateLock.Text = PrefC.GetDate(PrefName.SecurityLockDate).ToShortDateString(); } if (PrefC.GetBool(PrefName.CentralManagerSecurityLock)) { butChange.Enabled = false; labelGlobalDateLockDisabled.Visible = true; } List <UserGroup> listGroupsNotAdmin = UserGroups.GetList().FindAll(x => !GroupPermissions.HasPermission(x.UserGroupNum, Permissions.SecurityAdmin, 0)); for (int i = 0; i < listGroupsNotAdmin.Count; i++) { comboGroups.Items.Add(listGroupsNotAdmin[i].Description, listGroupsNotAdmin[i]); if (PrefC.GetLong(PrefName.DefaultUserGroup) == listGroupsNotAdmin[i].UserGroupNum) { comboGroups.SelectedIndex = i; } } }
///<summary>Fills listUserGroupTabUserGroups. Public so that it can be called from the Form that implements this control.</summary> public void FillListUserGroupTabUserGroups() { _isFillingList = true; UserGroup selectedGroup = SelectedUserGroup; //Preserve Usergroup selection. listUserGroupTabUserGroups.Items.Clear(); foreach (UserGroup groupCur in UserGroups.GetList(IsForCEMT)) { ODBoxItem <UserGroup> boxItemCur = new ODBoxItem <UserGroup>(groupCur.Description, groupCur); listUserGroupTabUserGroups.Items.Add(boxItemCur); if (selectedGroup != null && groupCur.UserGroupNum == selectedGroup.UserGroupNum) { listUserGroupTabUserGroups.SelectedItem = boxItemCur; } } _isFillingList = false; if (listUserGroupTabUserGroups.SelectedItem == null) { listUserGroupTabUserGroups.SetSelected(0, true); } }
///<summary>Fills the filter comboboxes on the "Users" tab.</summary> private void FillFilters() { foreach (UserFilters filterCur in Enum.GetValues(typeof(UserFilters))) { if (PrefC.GetBool(PrefName.EasyHideDentalSchools) && (filterCur == UserFilters.Students || filterCur == UserFilters.Instructors)) { continue; } comboShowOnly.Items.Add(new ODBoxItem <UserFilters>(Lan.g(this, filterCur.GetDescription()), filterCur)); } comboShowOnly.SelectedIndex = 0; comboSchoolClass.Items.Add(new ODBoxItem <SchoolClass>(Lan.g(this, "All"))); comboSchoolClass.SelectedIndex = 0; foreach (SchoolClass schoolClassCur in SchoolClasses.GetDeepCopy()) { comboSchoolClass.Items.Add(new ODBoxItem <SchoolClass>(SchoolClasses.GetDescript(schoolClassCur), schoolClassCur)); } if (PrefC.HasClinicsEnabled) { comboClinic.Visible = true; labelClinic.Visible = true; comboClinic.Items.Clear(); comboClinic.Items.Add(new ODBoxItem <Clinic>(Lan.g(this, "All Clinics"))); comboClinic.SelectedIndex = 0; foreach (Clinic clinicCur in Clinics.GetDeepCopy(true)) { comboClinic.Items.Add(new ODBoxItem <Clinic>(clinicCur.Abbr, clinicCur)); } } comboGroups.Items.Clear(); comboGroups.Items.Add(new ODBoxItem <UserGroup>(Lan.g(this, "All Groups"))); comboGroups.SelectedIndex = 0; foreach (UserGroup groupCur in UserGroups.GetList(IsForCEMT)) { comboGroups.Items.Add(new ODBoxItem <UserGroup>(groupCur.Description, groupCur)); } }
private void FormUserEdit_Load(object sender, System.EventArgs e) { checkIsHidden.Checked = UserCur.IsHidden; if (UserCur.UserNum != 0) { textUserNum.Text = UserCur.UserNum.ToString(); } textUserName.Text = UserCur.UserName; textDomainUser.Text = UserCur.DomainUser; if (!PrefC.GetBool(PrefName.DomainLoginEnabled)) { labelDomainUser.Visible = false; textDomainUser.Visible = false; butPickDomainUser.Visible = false; } checkRequireReset.Checked = UserCur.IsPasswordResetRequired; _listUserGroups = UserGroups.GetList(); _isFillingList = true; for (int i = 0; i < _listUserGroups.Count; i++) { listUserGroup.Items.Add(new ODBoxItem <UserGroup>(_listUserGroups[i].Description, _listUserGroups[i])); if (!_isFromAddUser && UserCur.IsInUserGroup(_listUserGroups[i].UserGroupNum)) { listUserGroup.SetSelected(i, true); } if (_isFromAddUser && _listUserGroups[i].UserGroupNum == PrefC.GetLong(PrefName.DefaultUserGroup)) { 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(); listEmployee.Items.Clear(); listEmployee.Items.Add(Lan.g(this, "none")); listEmployee.SelectedIndex = 0; _listEmployees = Employees.GetDeepCopy(true); for (int i = 0; i < _listEmployees.Count; i++) { listEmployee.Items.Add(Employees.GetNameFL(_listEmployees[i])); if (UserCur.EmployeeNum == _listEmployees[i].EmployeeNum) { listEmployee.SelectedIndex = i + 1; } } listProv.Items.Clear(); listProv.Items.Add(Lan.g(this, "none")); listProv.SelectedIndex = 0; _listProviders = Providers.GetDeepCopy(true); for (int i = 0; i < _listProviders.Count; i++) { listProv.Items.Add(_listProviders[i].GetLongDesc()); if (UserCur.ProvNum == _listProviders[i].ProvNum) { listProv.SelectedIndex = i + 1; } } _listClinics = Clinics.GetDeepCopy(true); _listUserAlertTypesOld = AlertSubs.GetAllForUser(UserCur.UserNum); List <long> listSubscribedClinics; bool isAllClinicsSubscribed = false; if (_listUserAlertTypesOld.Select(x => x.ClinicNum).Contains(-1)) //User subscribed to all clinics { isAllClinicsSubscribed = true; listSubscribedClinics = _listClinics.Select(x => x.ClinicNum).Distinct().ToList(); } else { listSubscribedClinics = _listUserAlertTypesOld.Select(x => x.ClinicNum).Distinct().ToList(); } List <long> listAlertCatNums = _listUserAlertTypesOld.Select(x => x.AlertCategoryNum).Distinct().ToList(); listAlertSubMulti.Items.Clear(); _listAlertCategories = AlertCategories.GetDeepCopy(); List <long> listUserAlertCatNums = _listUserAlertTypesOld.Select(x => x.AlertCategoryNum).ToList(); foreach (AlertCategory cat in _listAlertCategories) { int index = listAlertSubMulti.Items.Add(Lan.g(this, cat.Description)); listAlertSubMulti.SetSelected(index, listUserAlertCatNums.Contains(cat.AlertCategoryNum)); } if (!PrefC.HasClinicsEnabled) { tabClinics.Enabled = false; //Disables all controls in the clinics tab. Tab is still selectable. listAlertSubsClinicsMulti.Visible = false; labelAlertClinic.Visible = false; } else { listClinic.Items.Clear(); listClinic.Items.Add(Lan.g(this, "All")); listAlertSubsClinicsMulti.Items.Add(Lan.g(this, "All")); listAlertSubsClinicsMulti.Items.Add(Lan.g(this, "Headquarters")); if (UserCur.ClinicNum == 0) //Unrestricted { listClinic.SetSelected(0, true); checkClinicIsRestricted.Enabled = false; //We don't really need this checkbox any more but it's probably better for users to keep it.... } if (isAllClinicsSubscribed) //They are subscribed to all clinics { listAlertSubsClinicsMulti.SetSelected(0, true); } else if (listSubscribedClinics.Contains(0)) //They are subscribed to Headquarters { listAlertSubsClinicsMulti.SetSelected(1, true); } List <UserClinic> listUserClinics = UserClinics.GetForUser(UserCur.UserNum); for (int i = 0; i < _listClinics.Count; i++) { listClinic.Items.Add(_listClinics[i].Abbr); listClinicMulti.Items.Add(_listClinics[i].Abbr); listAlertSubsClinicsMulti.Items.Add(_listClinics[i].Abbr); if (UserCur.ClinicNum == _listClinics[i].ClinicNum) { listClinic.SetSelected(i + 1, true); } if (UserCur.ClinicNum != 0 && listUserClinics.Exists(x => x.ClinicNum == _listClinics[i].ClinicNum)) { listClinicMulti.SetSelected(i, true); //No "All" option, don't select i+1 } if (!isAllClinicsSubscribed && _listUserAlertTypesOld.Exists(x => x.ClinicNum == _listClinics[i].ClinicNum)) { listAlertSubsClinicsMulti.SetSelected(i + 2, true); //All+HQ } } checkClinicIsRestricted.Checked = UserCur.ClinicIsRestricted; } if (string.IsNullOrEmpty(UserCur.PasswordHash)) { butPassword.Text = Lan.g(this, "Create Password"); } if (!PrefC.IsODHQ) { butJobRoles.Visible = false; } if (IsNew) { butUnlock.Visible = false; } _listDoseSpotUserPrefOld = UserOdPrefs.GetByUserAndFkeyAndFkeyType(UserCur.UserNum, Programs.GetCur(ProgramName.eRx).ProgramNum, UserOdFkeyType.Program, Clinics.GetForUserod(Security.CurUser, true).Select(x => x.ClinicNum) .Union(new List <long>() { 0 }) //Always include 0 clinic, this is the default, NOT a headquarters only value. .Distinct() .ToList()); _listDoseSpotUserPrefNew = _listDoseSpotUserPrefOld.Select(x => x.Clone()).ToList(); _doseSpotUserPrefDefault = _listDoseSpotUserPrefNew.Find(x => x.ClinicNum == 0); if (_doseSpotUserPrefDefault == null) { _doseSpotUserPrefDefault = DoseSpot.GetDoseSpotUserIdFromPref(UserCur.UserNum, 0); _listDoseSpotUserPrefNew.Add(_doseSpotUserPrefDefault); } textDoseSpotUserID.Text = _doseSpotUserPrefDefault.ValueString; if (_isFromAddUser && !Security.IsAuthorized(Permissions.SecurityAdmin, true)) { butPassword.Visible = false; checkRequireReset.Checked = true; checkRequireReset.Enabled = false; butUnlock.Visible = false; butJobRoles.Visible = false; } if (!PrefC.HasClinicsEnabled) { butDoseSpotAdditional.Visible = false; } }