Beispiel #1
0
        public Course CreateCourse(string title, string name, string lastname, string firstname, string login, string password)
        {
            EntityGenerator generator = new EntityGenerator();
            Course          course    = new Course()
            {
                Title      = title,
                Department = generator.CreateDepartment(name, lastname, firstname, login, password),
            };

            DBUtils.db.Courses.Add(course);
            DBUtils.db.SaveChanges();

            return(course);
        }
Beispiel #2
0
        public Department CreateDepartment(string name, string lastname, string firstname, string login, string password)
        {
            EntityGenerator generator  = new EntityGenerator();
            Department      department = new Department()
            {
                Name          = name,
                Budget        = 1000,
                StartDate     = DateTime.Now,
                Administrator = generator.CreateInstructor(lastname, firstname, login, password)
            };

            DBUtils.db.Departments.Add(department);
            DBUtils.db.SaveChanges();

            return(department);
        }