Example #1
0
 static void Main(string[] args)
 {
     StudentRepository = new StudentRepository();
     SubjectRepository = new SubjectRepository();
     ExamRepository    = new ExamRepository();
     Presentacion();
 }
Example #2
0
 public ExamsController(MyContext myContext, IConfiguration config, UserRepository repo, ExamRepository repoExam)
 {
     _context       = myContext;
     _configuration = config;
     _repo          = repo;
     _repoExam      = repoExam;
 }
        public UnitOfWork(ApplicationDbContext context)
        {
            _context = context;

            Attempts       = new AttemptRepository(_context);
            Exams          = new ExamRepository(_context);
            Images         = new ImageRepository(_context);
            NoteParameters = new NoteParameterRepository(_context);
            Notifications  = new NotificationRepository(_context);
            Notes          = new NoteRepository(_context);
            Opinions       = new OpinionRepository(_context);
            Options        = new OptionRepository(_context);
            Passages       = new PassageRepository(_context);
            Questions      = new QuestionRepository(_context);
            Requirements   = new RequirementRepository(_context);
            Roles          = new RoleRepository(_context);
            RoleClaims     = new RoleClaimRepository(_context);
            Standards      = new StandardRepository(_context);
            Sittings       = new SittingRepository(_context);
            Topics         = new TopicRepository(_context);
            Users          = new UserRepository(_context);
            UserClaims     = new UserClaimRepository(_context);
            UserLogins     = new UserLoginRepository(_context);
            UserRoles      = new UserRoleRepository(_context);
            UserTokens     = new UserTokenRepository(_context);
        }
Example #4
0
 public void GetCategories()
 {
     using (var examRepo = new ExamRepository())
     {
         var categories = examRepo.GetCategories(Enumerable.Empty <Guid>().ToList());
     }
 }
Example #5
0
 public Answer AddAnswer(Answer answer)
 {
     using (var examRepo = new ExamRepository())
     {
         var questions = examRepo.AddAnswer(Mapper.Map <Hire.Domain.Models.Answer>(answer));
     }
     return(answer);
 }
Example #6
0
 public bool HasOpenExams(Guid candidateGuid)
 {
     using (var examRepo = new ExamRepository())
     {
         var openExam = examRepo.GetLatestOpenExam(candidateGuid, false, false);
         return(openExam != null);
     }
 }
Example #7
0
 /// <summary>
 /// TODO > check that the exam has questions!! otherwise don't generate it
 /// </summary>
 /// <param name="categoryIds"></param>
 /// <param name="candidateGuid"></param>
 /// <param name="examiner"></param>
 /// <returns></returns>
 public Exam GenerateExam(List <Guid> categoryIds, Guid candidateGuid, string examiner)
 {
     using (var examRepo = new ExamRepository())
     {
         var exam = examRepo.GenerateExam(categoryIds, candidateGuid, examiner);
         return(Mapper.Map <Exam>(exam));
     }
 }
Example #8
0
 public List <Question> GetQuestions(List <Guid> questionIds)
 {
     using (var examRepo = new ExamRepository())
     {
         var exams = examRepo.GetQuestions(questionIds);
         return(Mapper.Map <List <Question> >(exams));
     }
 }
Example #9
0
 public UnitOfWork(ExamContext context)
 {
     _context    = context;
     Courses     = new CourseRepository(_context);
     Questions   = new QuestionRepository(_context);
     Exams       = new ExamRepository(_context);
     Students    = new StudentRepository(_context);
     Instructors = new InstructorRepository(_context);
 }
Example #10
0
        public ActionResult Index()
        {
            //Accès à la base de données
            ExamRepository repoExam = new ExamRepository(new SqlConnection(@"Data Source = (LocalDb)\MSSQLLocalDB;  Integrated Security=SSPI;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False; AttachDbFilename=" +
                                                                           Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
                                                                           @"\GeneCESI_BDD.mdf;"));
            List <Exam> exams = repoExam.GetAll().ToList();

            return(View(exams));
        }
Example #11
0
 public UnitOfWork(DatabaseContext databaseContext)
 {
     _databaseContext = databaseContext;
     Courses          = new CourseRepository(_databaseContext);
     Exams            = new ExamRepository(_databaseContext);
     Grades           = new GradeRepository(_databaseContext);
     Questions        = new QuestionRepository(_databaseContext);
     Students         = new StudentRepository(_databaseContext);
     Teachers         = new TeacherRepository(_databaseContext);
     Answers          = new AnswerRepository(_databaseContext);
 }
 public UnitOfWork(ApplicationDbContext context)
 {
     _context        = context;
     Students        = new StudentRepository(context);
     Exams           = new ExamRepository(context);
     Attandences     = new AttendanceRepository(context);
     Departments     = new DepartmentRepository(context);
     Teachers        = new TeacherRepository(context);
     Specializations = new SpecializationRepository(context);
     Users           = new ApplicationUserRepository(context);
 }
Example #13
0
        public IList <Question> GetRelatedQuestions(Guid questionOptionGuid)
        {
            var list = Enumerable.Empty <Question>().ToList();

            using (var examRepo = new ExamRepository())
            {
                var questions = examRepo.GetSubQuestions(questionOptionGuid, true);
                list = Mapper.Map <List <Question> >(questions);
            }

            return(list);
        }
Example #14
0
        public List <Category> GetCategories(List <Guid> categoryIds)
        {
            var list = Enumerable.Empty <Category>().ToList();

            using (var examRepo = new ExamRepository())
            {
                var categories = examRepo.GetCategories(categoryIds);
                list = Mapper.Map <List <Category> >(categories);
            }

            return(list);
        }
Example #15
0
 public AddModel(
     ExamRepository exams,
     TeacherRepository teachers,
     SchoolClassRepository schoolClasses,
     SubjectRepository subjects,
     IMapper mapper)
 {
     _exams         = exams;
     _teachers      = teachers;
     _schoolClasses = schoolClasses;
     _subjects      = subjects;
     _mapper        = mapper;
 }
Example #16
0
        public List <Question> GetSubQuestions(Guid questionOptionId)
        {
            using (var examRepo = new ExamRepository())
            {
                var questions = examRepo.GetSubQuestions(questionOptionId, true);

                var quesiontList = Mapper.Map <List <Question> >(questions);

                quesiontList.ForEach(x => x.IsChildQuestion = true);

                return(quesiontList);
            }
        }
Example #17
0
        public void GetExams()
        {
            using (var examRepo = new ExamRepository())
                using (var candidateRepo = new CandidateRepository())
                {
                    var candidate = candidateRepo.GetCandidate("*****@*****.**");

                    Assert.IsNotNull(candidate);

                    var openExam = examRepo.GetLatestOpenExam(candidate.Id, true, true);

                    Assert.IsNotNull(openExam);
                }
        }
Example #18
0
        private void DeleteClicked(object sender, EventArgs e)
        {
            ExamRepository eRepo = new ExamRepository();

            string[] acc2 = this.comboBoxCourseId.Text.Split(' ');
            if (eRepo.Delete2(acc2[0]) != 0)
            {
                MessageBox.Show("One Exam Deleted", "Successful");
                this.dataGridViewExam.DataSource = eRepo.GetAllExams2();
            }
            else
            {
                MessageBox.Show("Exam For This Course ID Doesn't Exists", "Failed");
            }
        }
Example #19
0
        public bool Update(Exam exam)
        {
            bool Error = false;

            if (string.IsNullOrEmpty(exam.Name))
            {
                Validator.AddError("Name", "O nome é obrigatório");
                Error = true;
            }

            if (Error)
            {
                return(false);
            }

            ExamRepository.Update(exam);
            return(true);
        }
Example #20
0
        public UnitOfWork(PlutoContext context)
        {
            _ILog = Log.GetInstance;

            _context                  = context;
            AppUsers                  = new UserRepository(context);
            Students                  = new StudentRepository(context);
            PaymentHistories          = new PaymentHistoryRepository(context);
            Payments                  = new PaymentRepository(context);
            studentclasses            = new StudentClassRepository(context);
            departments               = new DepartmentRepository(context);
            regions                   = new RegionRepository(context);
            studentstatuses           = new StudentStatusRepository(context);
            employees                 = new EmployeeRepository(context);
            employeedocuments         = new EmployeeDocumentRepository(context);
            payrollamounts            = new PayrollAmountRepository(context);
            employeecategories        = new EmployeeCategoryRepository(context);
            employeelevelsofeducation = new EmployeeLevelOfEducationRepository(context);
            payrollrates              = new PayrollRateRepository(context);
            taxrates                  = new TaxRateRepository(context);
            ssnitrates                = new SSNITRateRepository(context);
            studentsubjects           = new StudentSubjectRepository(context);
            payrollallowances         = new PayrollAllowancesRepository(context);
            employeetypes             = new EmployeeTypeRepository(context);
            employeeloanhistories     = new EmployeeLoanHistoryRepository(context);
            employeeloans             = new EmployeeLoanRepository(context);
            exams          = new ExamRepository(context);
            marks          = new MarkRepository(context);
            externalhelper = new ExternalHelperRepository(context);

            hostels           = new HostelRepository(context);
            libraries         = new LibraryRepository(context);
            transports        = new TransportRepository(context);
            expenses          = new ExpenseRepository(context);
            expensecategories = new ExpenseCategoryRepository(context);
            incomes           = new IncomeRepository(context);
            incomecategories  = new IncomeCategoryRepository(context);
            books             = new BookRepository(context);
            booktypes         = new BookTypeRepository(context);
            rooms             = new RoomRepository(context);
            payrolldates      = new PayrollDateRepository(context);
            allowances        = new AllowanceRepository(context);
        }
Example #21
0
        public Exam GetLatestOpenExamWithQuestionOptions(Guid candidateGuid)
        {
            Exam examToReturn;

            using (var examRepo = new ExamRepository())
            {
                var openExam = examRepo.GetLatestOpenExam(candidateGuid, true, true);

                examToReturn = Mapper.Map <Exam>(openExam);
            }

            if (examToReturn != null)
            {
                var i    = 1;
                var list = examToReturn.Questions.ToList().OrderBy(x => x.Sequence);
                list.ToList().ForEach(x => { x.Sequence = i++; });
            }

            return(examToReturn);
        }
Example #22
0
 public UnitOfWork(AppDbContext context)
 {
     _context           = context;
     Faculties          = new FacultyRepository(_context);
     Departments        = new DepartmentRepository(_context);
     Courses            = new CourseRepository(_context);
     UserStudents       = new UserStudentRepository(_context);
     Booklets           = new BookletRepository(_context);
     Secretaries        = new SecretaryRepository(_context);
     Teachers           = new TeacherRepository(_context);
     ExamSessions       = new ExamSessionRepository(_context);
     Exams              = new ExamRepository(_context);
     CourseExamSessions = new CourseExamSessionRepository(_context);
     ExamEnrollments    = new ExamEnrollmentRepository(_context);
     Dollies            = new DollyRepository(_context);
     Profiles           = new ProfileRepository(_context);
     UniversityFees     = new UniversityFeesRepository(_context);
     StudentFees        = new StudentFeeRepository(_context);
     DollyVideos        = new DollyVideoRepository(_context);
 }
Example #23
0
        public ExamInfo()
        {
            InitializeComponent();

            SemesterRepository sRepo = new SemesterRepository();

            this.comboBoxSemesterName.DataSource = sRepo.GetAllSemesterNames2();

            CourseRepository cRepo = new CourseRepository();

            this.comboBoxCourseId.DataSource = cRepo.GetCourseIdNameSectionsBySemester2(this.comboBoxSemesterName.Text);

            AccountRepository aRepo = new AccountRepository();

            this.comboBoxFacultyId.DataSource = aRepo.GetAccountIdAndNames2("Faculty");

            ExamRepository eRepo = new ExamRepository();

            this.dataGridViewExam.DataSource = eRepo.GetAllExams2();
        }
Example #24
0
 public ExamController()
 {
     userFactory = new UserRepository();
     examFactory = new ExamRepository();
 }
Example #25
0
        public bool AddExamQuestion(int examId, int questionId)
        {
            ExamRepository.AddExamQuestion(examId, questionId);

            return(true);
        }
Example #26
0
        public override Repository <T> GetRepo <T>()
        {
            var output = new ExamRepository();

            return(output as Repository <T>);
        }
Example #27
0
        public IEnumerable <Exam> GetExamByRecruitment(int id)
        {
            var exam = ExamRepository.GetExamByRecruitment(id);

            return(exam);
        }
Example #28
0
        public IEnumerable <Exam> GetAll()
        {
            var exams = ExamRepository.GetAll();

            return(exams);
        }
Example #29
0
        public Exam Get(int id)
        {
            var exam = ExamRepository.Get(id);

            return(exam);
        }
Example #30
0
 public bool Delete(int id)
 {
     ExamRepository.Delete(id);
     return(true);
 }