Beispiel #1
0
        public MainProgram()
        {
            DirectoryCreator();

            File.AppendAllText($"{homeDirectory}\\log.txt", "\n\n\nNew start of application!\n");
            File.AppendAllText($"{homeDirectory}\\log.txt", $"{Directory.GetCurrentDirectory()}\n");
            File.AppendAllText($"{homeDirectory}\\log.txt", $"{Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)}\\HumanResourcesDB.db\n");

            var options = new DbContextOptionsBuilder <HumanResourcesDBContext>()
                          .UseSqlite($"Data Source={homeDirectory}\\HumanResourcesDB.db;")
                          .Options;

            DB = new HumanResourcesDBContext(options);
            DB.Groups.Load();
            DB.Students.Load();
            DB.Persons.Load();
            DB.Teacher_Subjects.Load();
            DB.Teachers.Load();
            DB.Subjects.Load();
            DB.Group_TeacherSubjects.Load();
            DB.Marks.Load();

            persons  = new DBPersons(DB);
            groups   = new DBGroups(DB);
            students = new DBStudents(DB);
            teachers = new DBTeachers(DB);
            marks    = new DBMarks(DB);
            subjects = new DBSubjects(DB);
            group_teacherSubjects = new DBGroup_TeacherSubjects(DB);
            teacher_subjects      = new DBTeacher_Subjects(DB);
            if (DB.Groups.Count() == 0)
            {
                StarterPack();
            }
        }
Beispiel #2
0
 public DBMarks(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Marks)
 {
 }
Beispiel #3
0
 public DBSubjects(HumanResourcesDBContext HRDBContext)
     : base(HRDBContext, HRDBContext.Subjects)
 {
 }
Beispiel #4
0
 public DBStudents(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Students)
 {
 }
Beispiel #5
0
 public DBTeachers(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Teachers)
 {
 }
Beispiel #6
0
 public DBPersons(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Persons)
 {
 }
Beispiel #7
0
 protected SetDB(HumanResourcesDBContext HRDBContext, DbSet <T> EntitySet)
 {
     this.HRDBContext = HRDBContext;
     this.EntitySet   = EntitySet;
 }
Beispiel #8
0
 public DBGroups(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Groups)
 {
     Console.WriteLine("groups established");
 }
 public DBGroup_TeacherSubjects(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Group_TeacherSubjects)
 {
 }