Beispiel #1
0
        public void Get_staff_by_key_returns_null_when_it_does_not_exist()
        {
            using (var context = new FIFContext(ContextOptions))
            {
                var repository = new SectionRepository(context);
                var result     = repository.Get("999").Result;

                result.ShouldBeNull();
            }
        }
Beispiel #2
0
        public void Get_staff_by_key_returns_staff_when_it_exists()
        {
            using (var context = new FIFContext(ContextOptions))
            {
                var repository = new SectionRepository(context);
                var result     = repository.Get("1").Result;

                result.ShouldSatisfyAllConditions(
                    () => result.SectionKey.ShouldBe("1"),
                    () => result.SchoolKey.ShouldBe("1"),
                    () => result.LocalCourseCode.ShouldBe("ACER08"),
                    () => result.SessionName.ShouldBe("Traditional"),
                    () => result.SectionIdentifier.ShouldBe("21855"),
                    () => result.SchoolYear.ShouldBe <Int16>(2012));
            }
        }
Beispiel #3
0
        public HttpResponseMessage GetPersonalById(HttpRequestMessage request, int Id)
        {
            PersonalDivisionSection personal = (from per in personalRepo.GetWithoutTracking().Where(a => a.IsDeleted != true && a.PersonalID == Id)
                                                join div in divisionRepo.GetWithoutTracking()
                                                on per.DivisionID equals div.DivisionID
                                                join sec in sectionRepo.GetWithoutTracking()
                                                on per.SectionID equals sec.SectionID
                                                select new PersonalDivisionSection
            {
                persoanl = per,
                division = div,
                section = sec,
            }).FirstOrDefault();
            List <Division> division     = divisionRepo.Get().ToList();
            List <Section>  section      = sectionRepo.Get().ToList();
            PersonalData    personaldata = new PersonalData();

            personaldata.personalDivisionSection = personal;
            personaldata.divisionData            = division;
            personaldata.sectionData             = section;


            return(Request.CreateResponse(HttpStatusCode.OK, personaldata));
        }
Beispiel #4
0
        public HttpResponseMessage GetSection(HttpRequestMessage request)
        {
            List <Section> result = sectionRepo.Get().ToList();

            return(request.CreateResponse(HttpStatusCode.OK, result));
        }
Beispiel #5
0
        public List <routineMaker> GenerateRoutine()
        {
            SlotList      slotList = new SlotList();
            FacultyAssign sc       = new FacultyAssign();
            FacultyAssign sc1      = new FacultyAssign();

            listOfSlot  = slotList.generateSlotList();
            listOfSlot1 = slotList.generateSlotList1();


            int count = 0;

            foreach (FacultyAssign a in sc.GetFacultyAssignList())
            {
                routineMaker rt = new routineMaker(listOfSlot[count].getDay1() + " ", listOfSlot[count].getRoom() + " ", listOfSlot[count].getSlot() + " ", fr.Get(a.FacultyId).Name, sr.Get(a.CourseId).SectionName, cr.Get(a.CourseId).CourseName);
                listOfRoutine1.Add(rt);
                MakeRoutine mr = new MakeRoutine(listOfSlot1[count].getDay1() + " ", listOfSlot1[count].getRoom() + " ", listOfSlot1[count].getSlot() + " ", sr.Get(a.CourseId).SectionName, fr.Get(a.FacultyId).Name, cr.Get(a.CourseId).CourseName);
                mk.Insert(mr);
                count++;
            }
            int count1 = 0;

            foreach (FacultyAssign b in sc1.GetFacultyAssignList())
            {
                routineMaker rt1 = new routineMaker(listOfSlot1[count1].getDay2() + " ", listOfSlot1[count1].getRoom() + " ", listOfSlot1[count1].getSlot() + " ", fr.Get(b.FacultyId).Name, sr.Get(b.CourseId).SectionName, cr.Get(b.CourseId).CourseName);
                listOfRoutine2.Add(rt1);
                MakeRoutine mr = new MakeRoutine(listOfSlot1[count1].getDay2() + " ", listOfSlot1[count1].getRoom() + " ", listOfSlot1[count1].getSlot() + " ", sr.Get(b.CourseId).SectionName, fr.Get(b.FacultyId).Name, cr.Get(b.CourseId).CourseName);
                mk.Insert(mr);
                count1++;
            }

            listOfRoutine1.AddRange(listOfRoutine2);
            return(listOfRoutine1);
        }