Example #1
0
        public List <string> CourseSchedule(string depCode)
        {
            var            CourseList     = courseGetway.GetCoursedepCode(depCode);
            var            Allocatioons   = roomGetway.GetAllAssigneRoom();
            CourseSchedule courseSchedule = new Models.CourseSchedule();
            List <string>  CourseSchedule = new List <string>();
            List <string>  Code           = new List <string>();
            List <string>  Name           = new List <string>();

            foreach (var course in CourseList)
            {
                string Schedule = "";
                foreach (var allocate in Allocatioons)
                {
                    if (course.courseId == allocate.CourseID)
                    {
                        Room       room = db.Rooms.SingleOrDefault(x => x.roomID == allocate.roomID);
                        AllotedDay day  = db.AllotedDays.SingleOrDefault(x => x.dayID == allocate.dayID);
                        allocate.Room       = room;
                        allocate.AllotedDay = day;
                        Schedule           += "R-No: " + room.roomName + " , " + day.daysName + " , " + allocate.fromTime + " - " + allocate.toTime + ";   ";
                    }
                }
                if (Schedule == "")
                {
                    Schedule += "not yet scheduled";
                }

                CourseSchedule.Add(Schedule);
            }
            return(CourseSchedule);
        }
Example #2
0
 public List <Course> GetCoursedepCode(string depCode)
 {
     return(_Getway.GetCoursedepCode(depCode));
 }