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(); } }
public DBMarks(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Marks) { }
public DBSubjects(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Subjects) { }
public DBStudents(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Students) { }
public DBTeachers(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Teachers) { }
public DBPersons(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Persons) { }
protected SetDB(HumanResourcesDBContext HRDBContext, DbSet <T> EntitySet) { this.HRDBContext = HRDBContext; this.EntitySet = EntitySet; }
public DBGroups(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Groups) { Console.WriteLine("groups established"); }
public DBGroup_TeacherSubjects(HumanResourcesDBContext HRDBContext) : base(HRDBContext, HRDBContext.Group_TeacherSubjects) { }