示例#1
0
 public void RemoveFromTimeTable(int id) //p betű felül
 {
     try
     {
         using (var context = new Classmaister5000Entities())
         {
             var course = context.Courses.Find(id);
             TimetableActions.RemoveFromTimetableByCourseId(id);
             GetCoursesFromLoggedInUsers();
             WhichCourseChanged(course);
             MessageBox.Show("The course has been successfully removed from the timetable!");
         }
     }
     catch (Exception e)
     {
         ExceptionLogger.LogException(e);
         MessageBox.Show(e.Message);
     }
 }
示例#2
0
 public void AddTimeTable(int id) //p betű felül
 {
     try
     {
         using (var context = new Classmaister5000Entities())
         {
             context.Configuration.LazyLoadingEnabled = false;
             var course = context.Courses.Find(id);
             TimetableActions.AddToTimetable(id);
             GetCoursesFromLoggedInUsers();
             WhichCourseChanged(course);
             MessageBox.Show("The course has been successfully added to the timetable!");
         }
     }
     catch (Exception e)
     {
         ExceptionLogger.LogException(e);
         MessageBox.Show(e.Message);
     }
 }