Exemplo n.º 1
0
        private _GradingPeriod stringToGradingPeriod(string input)
        {
            var output = new _GradingPeriod();

            //if (SelectedSubject != null && SelectedSubject.GradingSystem?.GradingPeriods != null)
            //{
            //    foreach (var v in SelectedSubject.GradingSystem.GradingPeriods)
            //    {
            //        if (v.Name == input)
            //        {
            //            output.Name = v.Name;
            //            output.Percentage = v.Percentage;
            //        }
            //    }
            //}
            if (SelectedSubject?.GradingSystem?.GradingPeriods == null)
            {
                return(output);
            }
            foreach (var v in SelectedSubject.GradingSystem.GradingPeriods)
            {
                if (v.Name != input)
                {
                    continue;
                }
                output.Name       = v.Name;
                output.Percentage = v.Percentage;
            }

            return(output);
        }
Exemplo n.º 2
0
 public GradingSystem()
 {
     GradingPeriodModel = new _GradingPeriod();
     TestTypeModel      = new TestType();
     GradingPeriods     = new ObservableCollection <_GradingPeriod>();
     TestTypes          = new ObservableCollection <TestType>();
     isSet = false;
 }
Exemplo n.º 3
0
 private void AddNewGradingPeriodProc()
 {
     if (GradingPeriods.Any(c => c.Name == GradingPeriodModel.Name))
     {
         return;                                                             //if <any> element in the collection satisfies the given condition
     }
     GradingPeriods.Add(GradingPeriodModel);
     GradingPeriodModel = new _GradingPeriod();
 }
Exemplo n.º 4
0
        private void ClearFieldsProc()
        {
            if (TestTypeModel == null)
            {
                return;
            }
            TestTypeModel = new TestType();

            if (GradingPeriodModel == null)
            {
                return;
            }
            GradingPeriodModel = new _GradingPeriod();
        }