Exemplo n.º 1
0
        public void Init()
        {
            conection  = new MSSQLDB(new DBConfiguration());
            _SREP      = new StudentRepository(conection);
            _encryptor = new Encryptor();
            handler    = new StudentQueryHandler(_SREP);

            var db = conection.GetCon();

            // Create Course
            course = new Course(Guid.NewGuid(), "LTP5");
            var sql = "INSERT INTO [Course] ([Id], [Name]) VALUES (@Id, @Name)";

            db.Execute(sql, param: new { Id = course.CourseId, Name = course.Name });

            var    cpf      = "964.377.278-02";
            string password = cpf.Replace("-", "").Replace(".", "");

            password = _encryptor.Encrypt(password, out string salt);

            student = new Student(course, DateTime.Now, "Abmael", "Araujo", cpf, "*****@*****.**", "(86) 2802-4826", "M", "Brasil", "Araguaina", "Centro", password, salt);
            _SREP.Create(student);

            commandGetById = new StudentInputGetById()
            {
                StudentId = student.Id
            };

            commandList = new StudentInputList();

            commandGetByCPF = new StudentInputGetByCPF()
            {
                StudentCPF = student.CPF.Number
            };
        }
Exemplo n.º 2
0
 public ExamController(ActivityQueryHandler activityQuery, StudentQueryHandler studentQuery, ActivityCommandHandler activityCommand, Evaluation.Queries.ActivityQueryHandler activityEvaluationQuery,
                       Evaluation.Handlers.ActivityCommandHandler activityEvaluationCommand, UserQueryHandler userQuery) : base(userQuery)
 {
     _activityQuery             = activityQuery;
     _activityCommand           = activityCommand;
     _studentQuery              = studentQuery;
     _activityEvaluationQuery   = activityEvaluationQuery;
     _activityEvaluationCommand = activityEvaluationCommand;
 }
Exemplo n.º 3
0
 public EnrollmentController(EnrollmentQueryHandler enrollmentQuery, EnrollmentCommandHandler enrollmentCommand, CourseQueryHandler courseQuery,
                             StudentQueryHandler studentQuery, EnrollmentDisciplineQueryHandler disciplineQuery, UserQueryHandler userQuery) : base(userQuery)
 {
     _enrollmentQuery   = enrollmentQuery;
     _enrollmentCommand = enrollmentCommand;
     _courseQuery       = courseQuery;
     _studentQuery      = studentQuery;
     _disciplineQuery   = disciplineQuery;
 }
Exemplo n.º 4
0
 public ActivityController(ActivityCommandHandler activityCommand, ActivityQueryHandler activityQuery, DisciplineQueryHandler disciplineQuery,
                           StudentQueryHandler studentQuery, UseCases.EvaluationContext.Queries.ActivityQueryHandler activityEvaluationQuery,
                           UseCases.EvaluationContext.Handlers.ActivityCommandHandler activityEvaluationCommad, UserQueryHandler userQuery) : base(userQuery)
 {
     _activityCommand          = activityCommand;
     _activityQuery            = activityQuery;
     _disciplineQuery          = disciplineQuery;
     _studentQuery             = studentQuery;
     _activityEvaluationQuery  = activityEvaluationQuery;
     _activityEvaluationCommad = activityEvaluationCommad;
 }
Exemplo n.º 5
0
 public StudentController(StudentQueryHandler studentQuery, StudentCommandHandler studentCommand, CourseQueryHandler courseQuery, UserQueryHandler userQuery) : base(userQuery)
 {
     _studentQuery   = studentQuery;
     _studentCommand = studentCommand;
     _courseQuery    = courseQuery;
 }