Пример #1
0
 private void FormRequirementsNeeded_Load(object sender, System.EventArgs e)
 {
     //comboClass.Items.Add(Lan.g(this,"All"));
     //comboClass.SelectedIndex=0;
     _listSchoolClasses = SchoolClasses.GetDeepCopy();
     _listSchoolCourses = SchoolCourses.GetDeepCopy();
     for (int i = 0; i < _listSchoolClasses.Count; i++)
     {
         comboClassFrom.Items.Add(_listSchoolClasses[i].Descript);
         comboClassTo.Items.Add(_listSchoolClasses[i].Descript);
     }
     for (int i = 0; i < _listSchoolCourses.Count; i++)
     {
         comboCourseFrom.Items.Add(_listSchoolCourses[i].Descript);
         comboCourseTo.Items.Add(_listSchoolCourses[i].Descript);
     }
     if (comboClassFrom.Items.Count > 0)
     {
         comboClassFrom.SelectedIndex = 0;
         comboClassTo.SelectedIndex   = 0;
     }
     if (comboCourseFrom.Items.Count > 0)
     {
         comboCourseFrom.SelectedIndex = 0;
         comboCourseTo.SelectedIndex   = 0;
     }
     ReloadReqList();
     FillGrid();
 }
Пример #2
0
 private void FormSecurity_Load(object sender, System.EventArgs e)
 {
     comboUsers.Items.Add(Lan.g(this, "All Users"));
     comboUsers.Items.Add(Lan.g(this, "Providers"));
     comboUsers.Items.Add(Lan.g(this, "Employees"));
     comboUsers.Items.Add(Lan.g(this, "Other"));
     comboUsers.SelectedIndex = 0;
     if (PrefB.GetBool("EasyHideDentalSchools"))
     {
         comboSchoolClass.Visible = false;
         labelSchoolClass.Visible = false;
     }
     else
     {
         comboSchoolClass.Items.Add(Lan.g(this, "All"));
         comboSchoolClass.SelectedIndex = 0;
         for (int i = 0; i < SchoolClasses.List.Length; i++)
         {
             comboSchoolClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
         }
     }
     FillTreePermissionsInitial();
     FillUsers();
     FillTreePerm();
     checkTimecardSecurityEnabled.Checked = PrefB.GetBool("TimecardSecurityEnabled");
 }
Пример #3
0
 private void FormProviderSelect_Load(object sender, System.EventArgs e)
 {
     if (!Security.IsAuthorized(Permissions.SecurityAdmin, DateTime.MinValue, true))
     {
         groupCreateUsers.Enabled = false;
         groupMovePats.Enabled    = false;
     }
     else
     {
         for (int i = 0; i < UserGroups.List.Length; i++)
         {
             comboUserGroup.Items.Add(UserGroups.List[i].Description);
         }
         //Moved to FillGrid in case the order is manipulated by the user.
         //for(int i=0;i<ProviderC.ListShort.Count;i++) {
         //	comboProv.Items.Add(ProviderC.ListShort[i].GetLongDesc());
         //}
     }
     if (PrefC.GetBool(PrefName.EasyHideDentalSchools))
     {
         groupDentalSchools.Visible = false;
     }
     else
     {
         comboClass.Items.Add(Lan.g(this, "All"));
         comboClass.SelectedIndex = 0;
         for (int i = 0; i < SchoolClasses.List.Length; i++)
         {
             comboClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
         }
         butUp.Visible   = false;
         butDown.Visible = false;
     }
     FillGrid();
 }
Пример #4
0
 private void FormProviderSelect_Load(object sender, System.EventArgs e)
 {
     if (!Security.IsAuthorized(Permissions.SecurityAdmin, DateTime.MinValue, true))
     {
         groupCreateUsers.Enabled = false;
     }
     else
     {
         for (int i = 0; i < UserGroups.List.Length; i++)
         {
             comboUserGroup.Items.Add(UserGroups.List[i].Description);
         }
     }
     if (PrefB.GetBool("EasyHideDentalSchools"))
     {
         groupDentalSchools.Visible = false;
     }
     else
     {
         comboClass.Items.Add(Lan.g(this, "All"));
         comboClass.SelectedIndex = 0;
         for (int i = 0; i < SchoolClasses.List.Length; i++)
         {
             comboClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
         }
         butUp.Visible   = false;
         butDown.Visible = false;
     }
     FillGrid();
 }
Пример #5
0
 private void FormProvStudentEdit_Load(object sender, EventArgs e)
 {
     _existingUser = new Userod();
     //Load the Combo Box
     _listSchoolClasses = SchoolClasses.GetDeepCopy();
     for (int i = 0; i < _listSchoolClasses.Count; i++)
     {
         comboClass.Items.Add(SchoolClasses.GetDescript(_listSchoolClasses[i]));
     }
     comboClass.SelectedIndex = 0;
     //Create a provider object if none has been provided
     if (ProvStudent == null)
     {
         ProvStudent = new Provider();
     }
     //From the add button - Select as much pre-given info as possible
     if (ProvStudent.IsNew)
     {
         labelPassDescription.Visible = false;
         _autoUserName     = Providers.GetNextAvailableProvNum();
         textUserName.Text = POut.Long(_autoUserName);              //User-names are suggested to be the ProvNum of the provider.  This can be changed at will.
         for (int i = 0; i < _listSchoolClasses.Count - 1; i++)
         {
             if (_listSchoolClasses[i].SchoolClassNum != ProvStudent.SchoolClassNum)
             {
                 continue;
             }
             comboClass.SelectedIndex = i;
             break;
         }
         textFirstName.Text = ProvStudent.FName;
         textLastName.Text  = ProvStudent.LName;
     }
     //Double-Clicking an existing student
     else
     {
         _isGeneratingAbbr = false;
         for (int i = 0; i < _listSchoolClasses.Count - 1; i++)
         {
             if (_listSchoolClasses[i].SchoolClassNum != ProvStudent.SchoolClassNum)
             {
                 continue;
             }
             comboClass.SelectedIndex = i;
             break;
         }
         textAbbr.Text      = ProvStudent.Abbr;
         textFirstName.Text = ProvStudent.FName;
         textLastName.Text  = ProvStudent.LName;
         List <Userod> userList = Providers.GetAttachedUsers(ProvStudent.ProvNum);
         if (userList.Count > 0)
         {
             textUserName.Text = userList[0].UserName;                  //Should always happen if they are a student.
             _existingUser     = userList[0];
         }
         textProvNum.Text = POut.Long(ProvStudent.ProvNum);
     }
 }
Пример #6
0
 private void FormDispensary_Load(object sender, EventArgs e)
 {
     comboClass.Items.Add(Lan.g(this, "All"));
     comboClass.SelectedIndex = 0;
     _listSchoolClasses       = SchoolClasses.GetDeepCopy();
     for (int i = 0; i < _listSchoolClasses.Count; i++)
     {
         comboClass.Items.Add(SchoolClasses.GetDescript(_listSchoolClasses[i]));
     }
     FillStudents();
 }
Пример #7
0
 private void FormProviderSelect_Load(object sender, System.EventArgs e)
 {
     SetFilterControlsAndAction(() => FillGrid(),
                                (int)TimeSpan.FromSeconds(0.5).TotalMilliseconds,
                                textFName, textLName, textProvNum);
     checkShowAll.Visible = IsShowAllAvailable;
     if (PrefC.GetBool(PrefName.EasyHideDentalSchools))
     {
         groupDentalSchools.Visible = false;
     }
     else if (IsStudentPicker)
     {
         this.Text      = "Student Picker";
         gridMain.Title = "Students";
         _schoolClasses = SchoolClasses.GetDeepCopy();
         for (int i = 0; i < _schoolClasses.Count; i++)
         {
             comboClass.Items.Add(_schoolClasses[i].GradYear + " " + _schoolClasses[i].Descript);
         }
         if (comboClass.Items.Count > 0)
         {
             comboClass.SelectedIndex = 0;
         }
     }
     else
     {
         comboClass.Visible = false;
         labelClass.Visible = false;
     }
     FillGrid();
     if (_listProviders != null)
     {
         for (int i = 0; i < _listProviders.Count; i++)
         {
             if (_listProviders[i].ProvNum == SelectedProvNum)
             {
                 gridMain.SetSelected(i, true);
                 break;
             }
         }
     }
     else if (SelectedProvNum != 0)
     {
         gridMain.SetSelected(Providers.GetIndex(SelectedProvNum), true);
     }
     butSelectNone.Visible = IsNoneAvailable;
     if (IsNoneAvailable)
     {
         //Default value for the selected provider when none is an option is always -1
         SelectedProvNum = -1;
     }
 }
Пример #8
0
 private void FormProvStudentBulkEdit_Load(object sender, EventArgs e)
 {
     SetFilterControlsAndAction(() => FillGrid(),
                                (int)TimeSpan.FromSeconds(0.5).TotalMilliseconds,
                                textProvNum);
     comboClass.Items.Add(Lan.g(this, "All"));
     comboClass.SelectedIndex = 0;
     _listSchoolClasses       = SchoolClasses.GetDeepCopy();
     for (int i = 0; i < _listSchoolClasses.Count; i++)
     {
         comboClass.Items.Add(SchoolClasses.GetDescript(_listSchoolClasses[i]));
     }
     FillGrid();
 }
Пример #9
0
		private void FormReqStudentsMany_Load(object sender,EventArgs e) {
			for(int i=0;i<SchoolClasses.List.Length;i++) {
				comboClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
			}
			if(comboClass.Items.Count>0) {
				comboClass.SelectedIndex=0;
			}
			for(int i=0;i<SchoolCourses.List.Length;i++) {
				comboCourse.Items.Add(SchoolCourses.GetDescript(SchoolCourses.List[i]));
			}
			if(comboCourse.Items.Count>0) {
				comboCourse.SelectedIndex=0;
			}
			FillGrid();
		}
Пример #10
0
		private void butOK_Click(object sender, System.EventArgs e) {
			if(textGradYear.errorProvider1.GetError(textGradYear)!=""
				){
				MsgBox.Show(this,"Please fix data entry errors first.");
				return;
			}
			if(textGradYear.Text==""){
				MsgBox.Show(this,"Please enter a graduation year.");
				return;
			}
			ClassCur.GradYear=PIn.Int(textGradYear.Text);
			ClassCur.Descript=textDescript.Text;
			SchoolClasses.InsertOrUpdate(ClassCur,IsNew);
			DialogResult=DialogResult.OK;
		}
Пример #11
0
		private void butDelete_Click(object sender, System.EventArgs e) {
			if(IsNew){
				DialogResult=DialogResult.Cancel;
			}
			else{
				if(!MsgBox.Show(this,true,"Delete this Dental School Class?")){
					return;
				}
				try{
					SchoolClasses.Delete(ClassCur.SchoolClassNum);
				}
				catch(Exception ex){
					MessageBox.Show(ex.Message);
					return;
				}
			}
			DialogResult=DialogResult.OK;
		}
Пример #12
0
        private void FillList()
        {
            long previousSelected = -1;

            if (listMain.SelectedIndex != -1)
            {
                previousSelected = _listSchoolCasses[listMain.SelectedIndex].SchoolClassNum;
            }
            SchoolClasses.RefreshCache();
            listMain.Items.Clear();
            for (int i = 0; i < _listSchoolCasses.Count; i++)
            {
                listMain.Items.Add(_listSchoolCasses[i].GradYear.ToString() + " - " + _listSchoolCasses[i].Descript);
                if (_listSchoolCasses[i].SchoolClassNum == previousSelected)
                {
                    listMain.SelectedIndex = i;
                }
            }
        }
Пример #13
0
        private void FillList()
        {
            int previousSelected = -1;

            if (listMain.SelectedIndex != -1)
            {
                previousSelected = SchoolClasses.List[listMain.SelectedIndex].SchoolClassNum;
            }
            SchoolClasses.Refresh();
            listMain.Items.Clear();
            for (int i = 0; i < SchoolClasses.List.Length; i++)
            {
                listMain.Items.Add(SchoolClasses.List[i].GradYear.ToString() + " - " + SchoolClasses.List[i].Descript);
                if (SchoolClasses.List[i].SchoolClassNum == previousSelected)
                {
                    listMain.SelectedIndex = i;
                }
            }
        }
Пример #14
0
 private void FormRequirementsNeeded_Load(object sender, System.EventArgs e)
 {
     //comboClass.Items.Add(Lan.g(this,"All"));
     //comboClass.SelectedIndex=0;
     for (int i = 0; i < SchoolClasses.List.Length; i++)
     {
         comboClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
     }
     if (comboClass.Items.Count > 0)
     {
         comboClass.SelectedIndex = 0;
     }
     for (int i = 0; i < SchoolCourses.List.Length; i++)
     {
         comboCourse.Items.Add(SchoolCourses.GetDescript(SchoolCourses.List[i]));
     }
     if (comboCourse.Items.Count > 0)
     {
         comboCourse.SelectedIndex = 0;
     }
     FillGrid();
 }
Пример #15
0
 private void FormReqAppt_Load(object sender, EventArgs e)
 {
     _listSchoolClasses = SchoolClasses.GetDeepCopy();
     _listSchoolCourses = SchoolCourses.GetDeepCopy();
     for (int i = 0; i < _listSchoolClasses.Count; i++)
     {
         comboClass.Items.Add(SchoolClasses.GetDescript(_listSchoolClasses[i]));
     }
     if (comboClass.Items.Count > 0)
     {
         comboClass.SelectedIndex = 0;
     }
     for (int i = 0; i < _listSchoolCourses.Count; i++)
     {
         comboCourse.Items.Add(SchoolCourses.GetDescript(_listSchoolCourses[i]));
     }
     if (comboCourse.Items.Count > 0)
     {
         comboCourse.SelectedIndex = 0;
     }
     comboInstructor.Items.Add(Lan.g(this, "None"));
     comboInstructor.SelectedIndex = 0;
     _listProviders = Providers.GetDeepCopy(true);
     for (int i = 0; i < _listProviders.Count; i++)
     {
         comboInstructor.Items.Add(_listProviders[i].GetLongDesc());
         //if(ProviderC.List[i].ProvNum==ReqCur.InstructorNum) {
         //	comboInstructor.SelectedIndex=i+1;
         //}
     }
     FillStudents();
     FillReqs();
     reqsAttached = ReqStudents.GetForAppt(AptNum);
     if (reqsAttached.Count > 0)
     {
         comboInstructor.SelectedIndex = Providers.GetIndex(reqsAttached[0].ProvNum) + 1;            //this will turn a -1 into a 0.
     }
     FillAttached();
 }
Пример #16
0
 private void FormReqStudentsMany_Load(object sender, EventArgs e)
 {
     _listSchoolClasses = SchoolClasses.GetDeepCopy();
     _listSchoolCourses = SchoolCourses.GetDeepCopy();
     for (int i = 0; i < _listSchoolClasses.Count; i++)
     {
         comboClass.Items.Add(SchoolClasses.GetDescript(_listSchoolClasses[i]));
     }
     if (comboClass.Items.Count > 0)
     {
         comboClass.SelectedIndex = 0;
     }
     for (int i = 0; i < _listSchoolCourses.Count; i++)
     {
         comboCourse.Items.Add(SchoolCourses.GetDescript(_listSchoolCourses[i]));
     }
     if (comboCourse.Items.Count > 0)
     {
         comboCourse.SelectedIndex = 0;
     }
     FillGrid();
 }
Пример #17
0
 private void FormSecurity_Load(object sender, System.EventArgs e)
 {
     comboUsers.Items.Add(Lan.g(this, "All Users"));
     comboUsers.Items.Add(Lan.g(this, "Providers"));
     comboUsers.Items.Add(Lan.g(this, "Employees"));
     comboUsers.Items.Add(Lan.g(this, "Other"));
     comboUsers.SelectedIndex = 0;
     if (PrefC.GetBool(PrefName.EasyHideDentalSchools))
     {
         comboSchoolClass.Visible = false;
         labelSchoolClass.Visible = false;
     }
     else
     {
         comboSchoolClass.Items.Add(Lan.g(this, "All"));
         comboSchoolClass.SelectedIndex = 0;
         for (int i = 0; i < SchoolClasses.List.Length; i++)
         {
             comboSchoolClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
         }
     }
     FillTreePermissionsInitial();
     FillUsers();
     FillTreePerm();
     textLogOffAfterMinutes.Text          = PrefC.GetInt(PrefName.SecurityLogOffAfterMinutes).ToString();
     checkPasswordsMustBeStrong.Checked   = PrefC.GetBool(PrefName.PasswordsMustBeStrong);
     checkTimecardSecurityEnabled.Checked = PrefC.GetBool(PrefName.TimecardSecurityEnabled);
     checkCannotEditOwn.Checked           = PrefC.GetBool(PrefName.TimecardUsersDontEditOwnCard);
     checkCannotEditOwn.Enabled           = checkTimecardSecurityEnabled.Checked;
     checkLogOffWindows.Checked           = PrefC.GetBool(PrefName.SecurityLogOffWithWindows);
     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();
     }
 }
Пример #18
0
 private void FormReqAppt_Load(object sender, EventArgs e)
 {
     for (int i = 0; i < SchoolClasses.List.Length; i++)
     {
         comboClass.Items.Add(SchoolClasses.GetDescript(SchoolClasses.List[i]));
     }
     if (comboClass.Items.Count > 0)
     {
         comboClass.SelectedIndex = 0;
     }
     for (int i = 0; i < SchoolCourses.List.Length; i++)
     {
         comboCourse.Items.Add(SchoolCourses.GetDescript(SchoolCourses.List[i]));
     }
     if (comboCourse.Items.Count > 0)
     {
         comboCourse.SelectedIndex = 0;
     }
     FillStudents();
     FillReqs();
     TableAttached = ReqStudents.GetForAppt(AptNum);
     FillAttached();
 }
 ///<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));
     }
 }
Пример #20
0
        private void FillGrid()
        {
            int selectedProvNum = 0;

            if (gridMain.GetSelectedIndex() != -1)
            {
                selectedProvNum = Providers.ListLong[gridMain.GetSelectedIndex()].ProvNum;
            }
            int scroll = gridMain.ScrollValue;

            Providers.Refresh();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col = new ODGridColumn(Lan.g("TableProviders", "Abbrev"), 65);

            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProviders", "Last Name"), 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProviders", "First Name"), 80);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g("TableProviders", "Hidden"), 55, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            if (!PrefB.GetBool("EasyHideDentalSchools"))
            {
                col = new ODGridColumn(Lan.g("TableProviders", "Class"), 90);
                gridMain.Columns.Add(col);
            }
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < Providers.ListLong.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(Providers.ListLong[i].Abbr);
                row.Cells.Add(Providers.ListLong[i].LName);
                row.Cells.Add(Providers.ListLong[i].FName);
                if (Providers.ListLong[i].IsHidden)
                {
                    row.Cells.Add("X");
                }
                else
                {
                    row.Cells.Add("");
                }
                if (!PrefB.GetBool("EasyHideDentalSchools"))
                {
                    row.Cells.Add(SchoolClasses.GetDescript(Providers.ListLong[i].SchoolClassNum));
                }
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
            for (int i = 0; i < Providers.ListLong.Length; i++)
            {
                if (Providers.ListLong[i].ProvNum == selectedProvNum)
                {
                    gridMain.SetSelected(i, true);
                    break;
                }
            }
            gridMain.ScrollValue = scroll;
        }
Пример #21
0
 private void FormSchoolClasses_Load(object sender, System.EventArgs e)
 {
     _listSchoolCasses = SchoolClasses.GetDeepCopy();
     FillList();
 }