コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the AverageSpecialtyReport class.
 /// </summary>
 /// <param name="factory"></param>
 public AverageSpecialtyReport(DaoFactory factory)
 {
     examDao      = factory.GetExamDao();
     resultDao    = factory.GetResultDao();
     groupDao     = factory.GetGroupDao();
     specialtyDao = factory.GetSpecialtyDao();
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the SessionResult class.
 /// </summary>
 /// <param name="factory"></param>
 public SessionResult(DaoFactory factory)
 {
     groupDao   = factory.GetGroupDao();
     subjectDao = factory.GetSubjectDao();
     studentDao = factory.GetStudentDao();
     examDao    = factory.GetExamDao();
     resultDao  = factory.GetResultDao();
 }
コード例 #3
0
 /// <summary>
 /// Gets the DAO result.
 /// </summary>
 /// <returns></returns>
 public override ResultDao GetResultDao()
 {
     if (resultDao == null)
     {
         resultDao = new ResultDao(connString);
     }
     return(resultDao);
 }
コード例 #4
0
        public void TestDelete()
        {
            ResultDao resultDao = factory.GetResultDao();
            var       results   = resultDao.ReadAll();
            int       exCount   = results.Count();

            resultDao.DeleteById(3);
            int count = resultDao.ReadAll().Count();

            Assert.AreEqual(exCount - 1, count);
        }
コード例 #5
0
        private static void InitializeResults()
        {
            ResultDao resultDao   = factory.GetResultDao();
            int       studentId   = 1;
            int       groupsCount = groupNames.Length * countOfCourses * countOfSubgroups;

            for (int groupId = 1; groupId <= groupsCount; groupId++)
            {
                for (int student = 0; student < countOfStudents; student++)
                {
                    for (int examId = groupId * countOfExams - (countOfExams - 1); examId <= countOfExams * groupsCount * countOfSessions; examId += countOfExams * groupsCount)
                    {
                        for (int exNum = 0; exNum < countOfExams; exNum++)
                        {
                            int    mark   = rand.Next(1, 11);
                            Result result = new Result(studentId, examId + exNum, mark);
                            resultDao.Create(result);
                        }
                    }
                    studentId++;
                }
            }
        }
コード例 #6
0
 /// <summary>
 /// Initializes a new instance of the AverageExaminatorReport class.
 /// </summary>
 /// <param name="factory"></param>
 public AverageExaminatorReport(DaoFactory factory)
 {
     examDao       = factory.GetExamDao();
     resultDao     = factory.GetResultDao();
     examinatorDao = factory.GetExaminatorDao();
 }
コード例 #7
0
 public ImageTask()
 {
     dao = new ResultDao();
 }
コード例 #8
0
 /// <summary>
 /// Initializes a new instance of the AverageSubjectReport class.
 /// </summary>
 /// <param name="factory"></param>
 public AverageSubjectReport(DaoFactory factory)
 {
     examDao    = factory.GetExamDao();
     resultDao  = factory.GetResultDao();
     subjectDao = factory.GetSubjectDao();
 }