MakeClassSchedule.Algorithm.Schedule.GetClasses C# (CSharp) Method

GetClasses() public method

public GetClasses ( ) : int>.Dictionary
return int>.Dictionary
        public Dictionary<CourseClass, int> GetClasses()
        {
            return _classes;
        }

Usage Example

        private void Save(Schedule schedule)
        {
            int numberOfRooms = Configuration.GetInstance.GetNumberOfRooms();
            int daySize = schedule.day_Hours * numberOfRooms;
            var db = new LINQDataContext();
            db.Classroom_TimeDeleteAll();
            foreach (KeyValuePair<CourseClass, int> it in schedule.GetClasses().ToList())
            {
                // coordinate of time-space slot
                int pos = it.Value; // int pos of _slot array
                int day = pos / daySize;
                int time = pos % daySize; // this is not time now!
                int room = time / schedule.day_Hours;
                time = time % schedule.day_Hours;  // this is a time now!
                int dur = it.Key.GetDuration;

                CourseClass cc = it.Key;
                Algorithm.Room r = Configuration.GetInstance.GetRoomById(room);
                //
                // Save Classroom_Time
                //

                db.Classroom_TimeSave(r.Origin_ID_inDB, cc.Class_ID, cc.GetProfessor.GetId, time, dur, day);
                //
                // Save New_GroupsPerClassroom
                //
                foreach (var gs in cc.GetGroups)
                {
                    db.New_GroupsPerClassSave(r.Origin_ID_inDB, cc.Class_ID, time, day, gs.GetId);
                }
            }
        }
All Usage Examples Of MakeClassSchedule.Algorithm.Schedule::GetClasses