private void FormEvaluationDefEdit_Load(object sender, EventArgs e) { if (!_evalDefCur.IsNew) { textTitle.Text = _evalDefCur.EvalTitle; textCourse.Text = SchoolCourses.GetDescript(_evalDefCur.SchoolCourseNum); textGradeScaleName.Text = GradingScales.GetOne(_evalDefCur.GradingScaleNum).Description; } _criterionDefsForEval = EvaluationCriterionDefs.GetAllForEvaluationDef(_evalDefCur.EvaluationDefNum); _itemOrder = new List <long>(); for (int j = 0; j < _criterionDefsForEval.Count; j++) { _itemOrder.Add(_criterionDefsForEval[j].EvaluationCriterionDefNum); } List <GradingScale> gradingScales = GradingScales.RefreshList(); _gradingScales = new Dictionary <long, GradingScale>(); for (int i = 0; i < gradingScales.Count; i++) { _gradingScales.Add(gradingScales[i].GradingScaleNum, gradingScales[i]); } if (_gradingScales.Count != 0 && !_evalDefCur.IsNew && _gradingScales[_evalDefCur.GradingScaleNum].ScaleType != EnumScaleType.Weighted) { labelTotalPoint.Visible = false; textTotalPoints.Visible = false; } FillGrid(); }
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(); }
private void FormEvaluationEdit_Load(object sender, EventArgs e) { //This window fills all necessary data on load. This eliminates the need for multiple calls to the database. textDate.Text = _evalCur.DateEval.ToShortDateString(); textTitle.Text = _evalCur.EvalTitle; _evalGradeScale = GradingScales.GetOne(_evalCur.GradingScaleNum); _listEvalGradeItems = GradingScaleItems.Refresh(_evalCur.GradingScaleNum); textGradeScaleName.Text = _evalGradeScale.Description; _provInstructor = Providers.GetProv(_evalCur.InstructNum); textInstructor.Text = _provInstructor.GetLongDesc(); _provStudent = Providers.GetProv(_evalCur.StudentNum); if (_provStudent != null) { textStudent.Text = _provStudent.GetLongDesc(); } textCourse.Text = SchoolCourses.GetDescript(_evalCur.SchoolCourseNum); textGradeNumberOverride.Text = _evalCur.OverallGradeNumber.ToString(); textGradeShowingOverride.Text = _evalCur.OverallGradeShowing; _listEvalCrits = EvaluationCriterions.Refresh(_evalCur.EvaluationNum); for (int i = 0; i < _listEvalCrits.Count; i++) { GradingScale critGradeScale = GradingScales.GetOne(_listEvalCrits[i].GradingScaleNum); if (!_dictCritGradeScales.ContainsKey(critGradeScale.GradingScaleNum)) { _dictCritGradeScales.Add(critGradeScale.GradingScaleNum, critGradeScale); } if (!_dictCritGradeItems.ContainsKey(critGradeScale.GradingScaleNum)) { _dictCritGradeItems.Add(critGradeScale.GradingScaleNum, GradingScaleItems.Refresh(critGradeScale.GradingScaleNum)); } } FillGridCriterion(); RecalculateGrades(); //Since there is no override column in the database, we check for equality of the calculated grade and the grade on the evaluation. //If they are different then the grade was overwritten at some point. if (textGradeNumber.Text == textGradeNumberOverride.Text) { textGradeNumberOverride.Text = ""; } if (textGradeShowing.Text == textGradeShowingOverride.Text) { textGradeShowingOverride.Text = ""; } }
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(); }
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(); }
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(); }
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(); }
private void FormReqStudentEdit_Load(object sender, System.EventArgs e) { //There should only be two types of users who are allowed to get this far: //Students editing their own req, and users with setup perm. But we will double check. Provider provUser = Providers.GetProv(Security.CurUser.ProvNum); if (provUser != null && provUser.SchoolClassNum != 0) //A student is logged in //the student only has permission to view/attach/detach their own requirements { if (provUser.ProvNum != ReqCur.ProvNum) { //but this should never happen MsgBox.Show(this, "Students may only edit their own requirements."); butDelete.Enabled = false; butOK.Enabled = false; } else //the student matches { butDelete.Enabled = false; textDateCompleted.Enabled = false; butNow.Enabled = false; comboInstructor.Enabled = false; //a student is only allowed to change the patient and appointment. } } else //A student is not logged in { if (!Security.IsAuthorized(Permissions.Setup, DateTime.MinValue, true)) //suppress message { butDelete.Enabled = false; butOK.Enabled = false; } } textStudent.Text = Providers.GetLongDesc(ReqCur.ProvNum); textCourse.Text = SchoolCourses.GetDescript(ReqCur.SchoolCourseNum); textDescription.Text = ReqCur.Descript; if (ReqCur.DateCompleted.Year > 1880) { textDateCompleted.Text = ReqCur.DateCompleted.ToShortDateString(); } //if an apt is attached, then the same pat must be attached. Patient pat = Patients.GetPat(ReqCur.PatNum); if (pat != null) { textPatient.Text = pat.GetNameFL(); } Appointment apt = Appointments.GetOneApt(ReqCur.AptNum); if (apt != null) { if (apt.AptStatus == ApptStatus.UnschedList) { textAppointment.Text = Lan.g(this, "Unscheduled"); } else { textAppointment.Text = apt.AptDateTime.ToShortDateString() + " " + apt.AptDateTime.ToShortTimeString(); } textAppointment.Text += ", " + apt.ProcDescript; } comboInstructor.Items.Add(Lan.g(this, "None")); comboInstructor.SelectedIndex = 0; for (int i = 0; i < ProviderC.ListShort.Count; i++) { comboInstructor.Items.Add(ProviderC.ListShort[i].GetLongDesc()); if (ProviderC.ListShort[i].ProvNum == ReqCur.InstructorNum) { comboInstructor.SelectedIndex = i + 1; } } }