示例#1
0
        private static void ListStudents(TestRepository repo)
        {
            foreach (var st in repo.StudentsCourseEvaluation)
            {
                Console.WriteLine(st.ToString());
            }

            Console.WriteLine("===================");
        }
示例#2
0
        static void Main(string[] args)
        {
            var repo = new TestRepository();

            Console.WriteLine("Number of students: " + repo.StudentsCourseEvaluation.Count);
            ListStudents(repo);

            CourseEvaluation student0 = repo.StudentsCourseEvaluation[0].Evaluation;
            CourseEvaluation student1 = repo.StudentsCourseEvaluation[1].Evaluation;

            EvaluationValue val0 = student0.Evaluations[0].Value;
            val0.Points = 5.5m; val0.Reason = "Bad design";

            EvaluationValue val1 = student0.Evaluations[1].Value;
            val1.Points = 4m; val1.Reason = "Bad implementation";

            student0.Evaluations[3].Value.Points = 3m;

            student1.Evaluations[0].Value.Points = 15m;

            ListStudents(repo);

            //zmena definice hodnoceni
            repo.StudentsCourseEvaluation[2].Evaluation.EvaluationDefinitions.RemoveAt(2);
            repo.StudentsCourseEvaluation[2].Evaluation.EvaluationDefinitions.Move(0, 1);
            repo.StudentsCourseEvaluation[2].Evaluation.EvaluationDefinitions.Add(
                new EvaluationDefinition() {  Name = "Other", MinPoints=0m, MaxPoints=5m});

            ListStudents(repo);

            repo.StudentsCourseEvaluation[2].Evaluation.EvaluationDefinitions[2].MinPoints = 3.5m;
            student1.Evaluations[3].Value.Points = 4m;

            ListStudents(repo);

            repo.StudentsCourseEvaluation[2].Evaluation.EvaluationDefinitions[3] = null;
            ListStudents(repo);

            Console.ReadLine();
        }