private void butGradingScale_Click(object sender, EventArgs e)
        {
            FormGradingScales FormGS = new FormGradingScales();

            FormGS.IsSelectionMode = true;
            FormGS.ShowDialog();
            if (FormGS.DialogResult == DialogResult.OK)
            {
                textGradeScaleName.Text     = FormGS.SelectedGradingScale.Description;
                _evalDefCur.GradingScaleNum = FormGS.SelectedGradingScale.GradingScaleNum;
                //If they added a new grading scale, add the scale to the dictionary.
                if (!_gradingScales.ContainsKey(FormGS.SelectedGradingScale.GradingScaleNum))
                {
                    _gradingScales.Add(FormGS.SelectedGradingScale.GradingScaleNum, GradingScales.GetOne(FormGS.SelectedGradingScale.GradingScaleNum));
                }
                if (_gradingScales[_evalDefCur.GradingScaleNum].ScaleType == EnumScaleType.Weighted)
                {
                    labelTotalPoint.Visible = true;
                    textTotalPoints.Visible = true;
                }
                else
                {
                    labelTotalPoint.Visible = false;
                    textTotalPoints.Visible = false;
                }
                FillGrid();                //If they changed the grading scale type from weighted, this will remove the extra column.
            }
        }
        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 FormEvaluationCriterionEdit_Load(object sender, EventArgs e)
 {
     //There is always going to be an EvaluationCriterion when coming into this window.
     _gradingScale = GradingScales.GetOne(_evalCritCur.GradingScaleNum);
     textCriterionDescript.Text = _evalCritCur.CriterionDescript;
     textGradingScale.Text      = _gradingScale.Description;
     textNote.Text   = _evalCritCur.Notes;
     _listGradeItems = GradingScaleItems.Refresh(_evalCritCur.GradingScaleNum);
     //if(!_gradingScale.IsPercentage) {
     //	textGradeNumber.ReadOnly=true;
     //	textGradeShowingPercent.Visible=false;
     //	for(int i=0;i<_listGradeItems.Count;i++) {
     //		comboGradeShowing.Items.Add(_listGradeItems[i].GradeShowing);
     //		if(_listGradeItems[i].GradeShowing==_evalCritCur.GradeShowing) {
     //			comboGradeShowing.SelectedIndex=i;
     //			textGradeNumber.Text=_evalCritCur.GradeNumber.ToString();
     //		}
     //	}
     //}
     //else {
     //	comboGradeShowing.Visible=false;
     //	textGradeNumber.Text=_evalCritCur.GradeNumber.ToString();
     //	textGradeShowingPercent.Text=_evalCritCur.GradeShowing;
     //}
 }
 private void FormEvaluationCriterionDefEdit_Load(object sender, EventArgs e)
 {
     textDescript.Text           = _evalCritDef.CriterionDescript;
     _gradeScale                 = GradingScales.GetOne(_evalCritDef.GradingScaleNum);
     textGradeScaleName.Text     = _gradeScale.Description;
     checkIsCategoryName.Checked = _evalCritDef.IsCategoryName;
     if (_gradeScale.ScaleType == EnumScaleType.Weighted)
     {
         textPoints.Visible  = true;
         labelPoints.Visible = true;
         textPoints.Text     = _evalCritDef.MaxPointsPoss.ToString();
     }
 }
Example #5
0
 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 = "";
     }
 }