コード例 #1
0
ファイル: WorkLabel.cs プロジェクト: mpetrencak/AP8PO_Final
 public WorkLabel(WorkLabel workLabel, Employee employee)
 {
     Name             = workLabel.Name;
     Employee         = employee;
     Subject          = workLabel.Subject;
     LabelTypes       = workLabel.LabelTypes;
     NumberOfStudents = workLabel.NumberOfStudents;
     NumberOfHours    = workLabel.NumberOfHours;
     NumberOfWeeks    = workLabel.NumberOfWeeks;
     Language         = workLabel.Language;
 }
コード例 #2
0
ファイル: WorkLabel.cs プロジェクト: mpetrencak/AP8PO_Final
        /// <summary>
        /// Generate all possible worklabels
        /// </summary>
        /// <param name="Subjects">List of subjects</param>
        /// <returns>List of worklabels</returns>
        public static ObservableCollection <WorkLabel> GenerateWorkLabels(ObservableCollection <Subject> Subjects)
        {
            ObservableCollection <WorkLabel> _workLabels = new ObservableCollection <WorkLabel>();
            WorkLabel wrklbl;

            foreach (Subject sub in Subjects)
            {
                int id = 1;

                //Lecture worklabels
                if (sub.LectureHours > 0)
                {
                    wrklbl = new WorkLabel(sub, LabelType.Lecture, null);
                    _workLabels.Add(wrklbl);

                    if (sub.CourseCompletionType == CourseCompletionType.Exam)
                    {
                        wrklbl = new WorkLabel(sub, LabelType.Exam, null);
                        _workLabels.Add(wrklbl);
                    }
                }


                //Exercise worklabels
                if (sub.ExerciseHours > 0)
                {
                    int numberofExercises = sub.GetNumberOfExesices();
                    for (int i = 0; i < numberofExercises; i++)
                    {
                        wrklbl = new WorkLabel(sub, LabelType.Exercise, id++);
                        _workLabels.Add(wrklbl);
                    }
                }


                //Semminar worklabels
                if (sub.SemminarHours > 0)
                {
                    wrklbl = new WorkLabel(sub, LabelType.Seminar, id++);
                    _workLabels.Add(wrklbl);
                }


                ////classified credit worklabels
                //if (sub.CourseCompletionType == CourseCompletionType.ClassifiedCredit)
                //{
                //    wrklbl = new WorkLabel(sub, LabelType.ClassifiedCredit, id++);
                //    _workLabels.Add(wrklbl);
                //}
                //else    //exam worklabels + credit
                //{
                //    wrklbl = new WorkLabel(sub, LabelType.Credit, id++);
                //    _workLabels.Add(wrklbl);
                //    wrklbl = new WorkLabel(sub, LabelType.Exam, id++);
                //    _workLabels.Add(wrklbl);
                //}
            }


            return(_workLabels);
        }