public override void AddWithoutCheck(Group_TeacherSubject newGroup_TeacherSubject)
        {
            HRDBContext.Group_TeacherSubjects.Add(newGroup_TeacherSubject);
            HRDBContext.SaveChanges();
            var students = from t in MainProgram.students.Get()
                           where t.@group == newGroup_TeacherSubject.@group
                           select t;

            foreach (var student in students)
            {
                MainProgram.marks.Add(new Marks(student, newGroup_TeacherSubject));
            }
        }
Example #2
0
        public override void AddWithoutCheck(Student newStudent)
        {
            newStudent.person.personRole = PersonRole.STUDENT;
            HRDBContext.Students.Add(newStudent);
            HRDBContext.SaveChanges();
            var groups = from t in MainProgram.group_teacherSubjects.Get()
                         where t.@group == newStudent.@group
                         select t;

            foreach (var group in groups)
            {
                MainProgram.marks.Add(new Marks(newStudent, group));
            }
        }
        public static void CheckDBConnecting()
        {
            HRDBContext hr = new HRDBContext();

            Console.WriteLine("DEPARTMENT");
            foreach (var item in hr.DEPTs)
            {
                Console.WriteLine($"ID={item.DEPTNO}\tNAME={item.DNAME}\tLOCATION={item.LOC}");
            }
            Console.WriteLine("EMPLOYEE");
            foreach (var item in hr.EMPs)
            {
                Console.WriteLine($"{item.DEPTNO}\t{item.ENAME}\t{item.JOB}\t{item.SAL}" +
                                  $"{item.MGR}\t{item.DEPTNO}\t{item.HIREDATE}\t{item.COMM}");
            }
            Console.WriteLine(new string('=', 50));
        }
Example #4
0
 public override void AddWithoutCheck(Person item)
 {
     HRDBContext.Persons.Add(item);
     HRDBContext.SaveChanges();
 }
Example #5
0
 public HrRepository()
 {
     _hrdbcontext = new HRDBContext();
 }