Esempio n. 1
0
 public ArrayList AllocateClass(ClassRoomCourse classRoomCourse)
 {
     if (IsGivenTimeValid(classRoomCourse))
     {
         if (IsTimeAvailable(classRoomCourse))
         {
             int affectedRow = _classRoomGateway.AllocateClass(classRoomCourse);
             if (affectedRow > 0)
             {
                 return new ArrayList {
                            true, "alert-success", "Success!", "Classroom allocated."
                 }
             }
             ;
             return(new ArrayList {
                 false, "alert-danger", "Error!", "Classsroom not allocated."
             });
         }
         return(new ArrayList {
             false, "alert-danger", "Error!", "Given time overlaps with the existing class schedule."
         });
     }
     return(new ArrayList {
         false, "alert-danger", "Error!", "Inavid! Class starting time must be less than ending time."
     });
 }