Beispiel #1
0
        public void Init()
        {
            _AREPEC = new Infra.EvaluationContext.ActivityRepository(new MSSQLDB(new DBConfiguration()));
            _AREPAC = new Infra.ActivityContext.ActivityRepository(new MSSQLDB(new DBConfiguration()));
            _DREP   = new DisciplineRepository(new MSSQLDB(new DBConfiguration()));
            _PREP   = new Infra.ProfessorContext.ProfessorRepository(new MSSQLDB(new DBConfiguration()));
            _SREP   = new StudentRepository(new MSSQLDB(new DBConfiguration()));
            var db = new SqlConnection(new DBConfiguration().StringConnection);

            // Create Course
            course = new Entities.StudentContext.Entities.Course(Guid.NewGuid());
            sql    = "INSERT INTO [Course] ([Id], [Name]) VALUES (@Id, 'LTP')";
            db.Execute(sql, param: new { Id = course.CourseId });

            // Create Professor
            professor = new Entities.ProfessorContext.Entities.Professor("Thelmaryo", "Vieira Lima", "034.034.034-00", "*****@*****.**", "123", EDegree.Master, "123", "123");
            _PREP.Create(professor);

            // Create Discipline
            disciplineCC = new Entities.CourseContext.Entities.Discipline("Psicologia", new Entities.CourseContext.Entities.Course(course.CourseId), new Entities.CourseContext.Entities.Professor(professor.Id), 20, 1, 0);
            _DREP.Create(disciplineCC);

            disciplineAC = new Entities.ActivityContext.Entities.Discipline(disciplineCC.Id, "Psicologia");

            // Create Student
            string CPF      = "117.400.002-34";
            string password = new Encryptor().Encrypt(CPF.Replace("-", "").Replace(".", ""), out string salt);

            student = new Entities.StudentContext.Entities.Student(course, DateTime.Now, "Abmael", "Araujo", CPF, "*****@*****.**", "1234-1234", "F", "França", "AraguainaSul", "Norte", password, salt);
            _SREP.Create(student);

            // Create Student
            string CPFEdit      = "344.245.132-97";
            string passwordEdit = new Encryptor().Encrypt(CPF.Replace("-", "").Replace(".", ""), out string saltEdit);

            studentEdit = new Entities.StudentContext.Entities.Student(course, DateTime.Now, "Abmael", "Araujo", CPFEdit, "*****@*****.**", "1234-1234", "F", "França", "AraguainaSul", "Norte", passwordEdit, saltEdit);
            _SREP.Create(studentEdit);

            // Create Activity
            activityAC = new Entities.ActivityContext.Entities.Activity(disciplineAC, "AtividadeTest", DateTime.Now, 10, 10, 15, Guid.NewGuid());
            _AREPAC.Create(activityAC);

            // Create Activity
            _student   = new Student(student.Id);
            activityEC = new Activity(activityAC.Id, _student, "AtividadeTest", DateTime.Now, 8, 10);
            _AREPEC.Create(activityEC);
        }
Beispiel #2
0
        public void Init()
        {
            _PREP = new Infra.ProfessorContext.ProfessorRepository(new MSSQLDB(new DBConfiguration()));
            _DREP = new DisciplineRepository(new MSSQLDB(new DBConfiguration()));
            var db = new SqlConnection(new DBConfiguration().StringConnection);


            string CPF      = "034.034.034-00";
            string password = new Encryptor().Encrypt(CPF.Replace("-", "").Replace(".", ""), out string salt);

            professor = new Entities.ProfessorContext.Entities.Professor("Thelmaryo", "Vieira Lima", CPF, "*****@*****.**", "123", EDegree.Master, password, salt);
            _PREP.Create(professor);

            course = new Course("Psicologia");
            sql    = "INSERT INTO [Course] ([Id], [Name]) VALUES (@Id, @Name)";
            db.Execute(sql, param: new { course.Id, course.Name });

            discipline = new Discipline("Psicologia", new Course(course.Id), new Entities.CourseContext.Entities.Professor(professor.Id), 20, 1, 0);
            _DREP.Create(discipline);
        }
Beispiel #3
0
        public void Init()
        {
            _SREP = new StudentRepository(new MSSQLDB(new DBConfiguration()));
            _EREP = new EnrollmentRepository(new MSSQLDB(new DBConfiguration()));
            _DREP = new Infra.CourseContext.DisciplineRepository(new MSSQLDB(new DBConfiguration()));
            _PREP = new Infra.ProfessorContext.ProfessorRepository(new MSSQLDB(new DBConfiguration()));
            var db = new SqlConnection(new DBConfiguration().StringConnection);

            // Create Course
            course = new Course(Guid.NewGuid());
            sql    = "INSERT INTO [Course] ([Id], [Name]) VALUES (@Id, 'LTP')";
            db.Execute(sql, param: new { Id = course.CourseId });

            // Create Student
            string CPF      = "117.400.002-34";
            string password = new Encryptor().Encrypt(CPF.Replace("-", "").Replace(".", ""), out string salt);

            student = new Entities.StudentContext.Entities.Student(course, DateTime.Now, "Abmael", "Araujo", CPF, "*****@*****.**", "1234-1234", "F", "França", "AraguainaSul", "Norte", password, salt);
            _SREP.Create(student);

            // Create Enrellment
            var _student = new Entities.EnrollmentContext.Entities.Student(student.Id);

            enrollment = new Enrollment(_student, Convert.ToDateTime("2000-08-01"), Convert.ToDateTime("2025-12-01"), EStatusEnrollment.Confirmed);
            _EREP.Create(enrollment);

            // Create Professor
            professor = new Professor("Thelmaryo", "Vieira Lima", "034.034.034-00", "*****@*****.**", "123", EDegree.Master, "123", "123");
            _PREP.Create(professor);

            // Create Discipline
            discipline = new Entities.CourseContext.Entities.Discipline("Psicologia", new Entities.CourseContext.Entities.Course(course.CourseId), new Entities.CourseContext.Entities.Professor(professor.Id), 20, 1, 0);
            _DREP.Create(discipline);

            // Create StudentDiscipline
            StudentDisciplineId = Guid.NewGuid();
            sql = "INSERT INTO [dbo].[StudentDiscipline] ([Id],[EnrollmentId],[DisciplineId],[Status]) VALUES(@Id, @EnrollmentId, @DisciplineId, @Status);";
            db.Execute(sql, param: new { Id = StudentDisciplineId, EnrollmentId = enrollment.Id, DisciplineId = discipline.Id, Status = 0 });
        }