public CFSISApiController(
            CFSISContext ctx,
            IServiceProvider svcProvider,
            ArtistRepository artistRepo,
            AlbumRepository albumRepo,
            CollegeRepository collegeRepo,
            CourseRepository courseRepo,
            DistrictRepository districtRepo,
            EnrollmentRepository enrollmentRepo,
            StudentRepository studentRepo,
            IConfiguration config,
            ILogger <CFSISApiController> logger,
            IHostingEnvironment env)
        {
            context         = ctx;
            serviceProvider = svcProvider;
            Configuration   = config;

            AlbumRepo      = albumRepo;
            ArtistRepo     = artistRepo;
            CollegeRepo    = collegeRepo;
            CourseRepo     = courseRepo;
            DistrictRepo   = districtRepo;
            EnrollmentRepo = enrollmentRepo;
            StudentRepo    = studentRepo;
            Logger         = logger;

            HostingEnv = env;
        }
Beispiel #2
0
        public void UpdateListCollegeTest()
        {
            List <College> colleges = new List <College>();
            College        college  = new College();
            College        college2 = new College();

            college.Name = "İstanbul Üniversitesi";
            college.City = "İstanbul";

            college2.Name = "Ege Üniversitesi";
            college2.City = "İstanbul";

            colleges.Add(college);
            colleges.Add(college2);

            CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase());

            collegeRepository.Insert(colleges);



            foreach (var item in colleges)
            {
                item.City = "İzmir";
            }

            Assert.IsTrue(collegeRepository.Update(colleges));
        }
        public IActionResult College()
        {
            CollegeRepository collegeRepository             = new CollegeRepository(_context);
            IEnumerable <CollegeViewModel> collegeViewModel = collegeRepository.GetAllColleges();

            return(View(collegeViewModel));
        }
Beispiel #4
0
        public void FilterEmployeeTest()
        {
            EmployeeRepository employeeRepository = new EmployeeRepository(new VitalityDatabase());
            CollegeRepository  collegeRepository  = new CollegeRepository(new VitalityDatabase());
            Employee           employee           = new Employee();
            College            college            = new College();
            FieldRepository    fieldRepository    = new FieldRepository(new VitalityDatabase());
            Field field = new Field();

            field.Name = "Yazılım";

            fieldRepository.Insert(field);


            college.Name       = "9 Eylül";
            employee.FirstName = "Aybars";
            employee.LastName  = "Agacabuga";

            collegeRepository.Insert(college);
            employee.CollegeId = college.Id;
            employee.FieldId   = field.Id;


            employeeRepository.Insert(employee);

            var fieldList = employeeRepository.GetListByFilter(x => x.College.Name == "9 Eylül").ToList();

            // var name = fieldList[0].College.Name;
            //   Assert.IsTrue(name == "9 Eylül");
        }
Beispiel #5
0
        public void InsertEmployeeTest()

        {
            CollegeRepository  collegeRepository  = new CollegeRepository(new VitalityDatabase());
            FieldRepository    fieldRepository    = new FieldRepository(new VitalityDatabase());
            EmployeeRepository employeeRepository = new EmployeeRepository(new Data.Entities.VitalityDatabase());


            Employee employee = new Employee();
            Field    field    = new Field();
            College  college  = new College();

            field.Name   = "Yazılım";
            college.Name = "İstanbul Üniversitesi";

            employee.FirstName = "Aybars";
            employee.LastName  = "Agcabuga";

            fieldRepository.Insert(field);
            collegeRepository.Insert(college);

            employee.FieldId   = field.Id;
            employee.CollegeId = college.Id;



            Assert.IsTrue(employeeRepository.Insert(employee));
        }
Beispiel #6
0
        public void InsertCollegeTest()
        {
            CollegeRepository collegeRepository = new CollegeRepository(new Data.Entities.VitalityDatabase());
            College           college1          = new College();

            college1.City = "İstanbul";
            Assert.IsTrue(collegeRepository.Update(college1));
        }
Beispiel #7
0
        public void DeleteCollegeTest()
        {
            CollegeRepository collegeRepository = new CollegeRepository(new Data.Entities.VitalityDatabase());

            var     collegeList = collegeRepository.GetAll();
            College college     = collegeList.First();

            Assert.IsTrue(collegeRepository.Delete(college));
        }
Beispiel #8
0
        public void UpdateCollegeTest()
        {
            CollegeRepository collegeRepository = new CollegeRepository(new Data.Entities.VitalityDatabase());
            var collegeList = collegeRepository.GetAll();

            if (collegeList.Count > 0)
            {
                College college = collegeList.First();
                college.Name = "DokuzEylül";
                Assert.IsTrue(collegeRepository.Update(college));
            }
        }
Beispiel #9
0
        public void DeleteListCollegeTest()
        {
            CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase());

            /*College college = new College();
             * College college2 = new College();
             * colleges.Add(college);
             * colleges.Add(college2);*/

            List <College> colleges = new List <College>();

            colleges = collegeRepository.GetAll();


            if (colleges.Count > 0)
            {
                Assert.IsTrue(collegeRepository.Delete(colleges));
            }
        }
Beispiel #10
0
        public void InsertListCollegeTest()
        {
            List <College> colleges = new List <College>();
            College        college  = new College();

            college.City = "İstanbul";
            college.Name = "İstanbul Üniversitesi";
            colleges.Add(college);

            College college2 = new College();

            college2.City = "İzmir";
            college2.Name = "Ege Üniversitesi";
            colleges.Add(college2);

            VitalityDatabase  vitalityDatabase  = new VitalityDatabase();
            CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase());


            Assert.IsTrue(collegeRepository.Insert(colleges));
        }
 public UnitOfWork(SchedulingDbContext context)
 {
     this.context           = context;
     ScheduleConfigurations = new ScheduleConfigurationRepository(context);
     Types             = new TypeRepository(context);
     Rooms             = new RoomRepository(context);
     Courses           = new CourseRepository(context);
     Sections          = new SectionRepository(context);
     AcademicSemesters = new AcademicSemesterRepository(context);
     WeekDays          = new WeekDayRepository(context);
     Instructors       = new InstructorRepository(context);
     Curriculums       = new CurriculumRepository(context);
     CourseOfferings   = new CourseOfferingRepository(context);
     CourseOfferingInstructorAssignments = new InstructorAssignmentRepository(context);
     Departments     = new DepartmentRepository(context);
     Colleges        = new CollegeRepository(context);
     Buildings       = new BuildingRepository(context);
     LabTypes        = new LabTypeRepository(context);
     ScheduleEntries = new ScheduleEntryRepository(context);
     Schedules       = new ScheduleRepository(context);
 }
Beispiel #12
0
        public void InsertListEmployeeTest()
        {
            List <Employee> employees = new List <Employee>();
            Employee        employee  = new Employee();
            Field           field     = new Field();

            field.Name = "Computer Science";
            College college = new College();

            college.Name = "İstanbul Üniversitesi";


            FieldRepository fieldRepository = new FieldRepository(new VitalityDatabase());

            fieldRepository.Insert(field);

            CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase());

            collegeRepository.Insert(college);


            employee.FirstName = "Deniz";
            employee.LastName  = "Doğan";
            employee.FieldId   = field.Id;
            employee.CollegeId = college.Id;
            employees.Add(employee);
            Employee employee2 = new Employee();

            employee2.CollegeId = college.Id;
            employee2.FieldId   = field.Id;
            employee2.FirstName = "Deniz2";
            employee2.LastName  = "Doğan2";
            employees.Add(employee2);

            VitalityDatabase vitalityDatabase = new VitalityDatabase();

            EmployeeRepository employeeRepository = new EmployeeRepository(vitalityDatabase);

            Assert.IsTrue(employeeRepository.Insert(employees));
        }
Beispiel #13
0
        public void UpdateListEmployeeTest()
        {
            EmployeeRepository employeeRepository = new EmployeeRepository(new VitalityDatabase());
            Employee           employee           = new Employee();
            Employee           employee2          = new Employee();
            List <Employee>    employees          = new List <Employee>();

            CollegeRepository collegeRepository = new CollegeRepository(new VitalityDatabase());

            College         college         = new College();
            College         college2        = new College();
            FieldRepository fieldRepository = new FieldRepository(new VitalityDatabase());
            Field           field           = new Field();
            Field           field2          = new Field();



            employee.FieldId   = field.Id;
            employee.CollegeId = college.Id;
            employee.FirstName = "Aybars";
            employee.LastName  = "Agcabuga";
            employees.Add(employee);

            employee2.FieldId   = field2.Id;
            employee2.CollegeId = college2.Id;
            employee2.FirstName = "Kaan";
            employee2.LastName  = "Agcabuga";
            employees.Add(employee2);


            foreach (var item in employees)
            {
                item.LastName = "Ağcabuğa";
            }

            Assert.IsTrue(employeeRepository.Update(employees));
        }
Beispiel #14
0
 public ChairmanController()
 {
     package = new CollegeRepository();
 }
Beispiel #15
0
        public int Remove(College college)
        {
            var rep = new CollegeRepository(new DatabaseFactory());

            return(rep.Remove(college));
        }
Beispiel #16
0
        public int AddOrUpdate(College college)
        {
            var rep = new CollegeRepository(new DatabaseFactory());

            return(rep.AddOrUpdate(college));
        }