public List <RequestsWtihLinkedData> GetRequests()
        {
            round liveRound = (new SemRouController()).GetLiveRound();

            IEnumerable <request> requests =
                from req in _db.requests.Include("roomsAlloc").Include("roomsPref").Include("facilities").Include("module")
                where (req.status == null || req.status == 0)
                &&
                req.module.department.code == nsd.code
                &&
                req.module.active == true
                &&
                req.roundID == liveRound.id
                select req;

            List <RequestsWtihLinkedData> rwldList = new List <RequestsWtihLinkedData>();

            foreach (request req in requests)
            {
                RequestsWtihLinkedData rwld = new RequestsWtihLinkedData(req);

                rwldList.Add(rwld);
            }

            return(rwldList);
        }
        public semester GetAdHocSemester()
        {
            round adHocRound = GetAdHocRound();

            semester adHocSemester = null;

            if (adHocRound != null)
            {
                adHocSemester =
                    (from sem in _db.semesters
                     where sem.id == adHocRound.semesterID
                     select sem).FirstOrDefault();
            }

            return(adHocSemester);
        }
        public semester GetLiveSemester()
        {
            round liveRound = GetLiveRound();

            semester liveSemester = null;

            if (liveRound != null)
            {
                liveSemester =
                    (from sem  in _db.semesters
                     where sem.id == liveRound.semesterID
                     select sem).FirstOrDefault();
            }

            return(liveSemester);
        }
        public round GetAdHocRound()
        {
            round adHocRound = _db.rounds.FirstOrDefault(r => r.live == true && r.adhoc == true);

            return(adHocRound);
        }
        public round GetLiveRound()
        {
            round liveRound = _db.rounds.FirstOrDefault(r => r.live == true && r.adhoc == false);

            return(liveRound);
        }