示例#1
0
        public String Save(ClassRoom room)
        {
            if (room.StartTime > room.Endtime)
            {
                return("To time must be greater than From time )");
            }
            bool isTimeScheduleValid = IsTimeScheduleValid(room.RoomId, room.DayId, room.StartTime, room.Endtime);

            if (isTimeScheduleValid)
            {
                if (classRoomGateway.InsertClassRoom(room) > 0)
                {
                    return("Saved Successfully");
                }
                return("Failed to save");
            }
            return("Both full and partial overlapping must be avoided");
        }