public RoomStatus CheckInClient(String reservationID, IRooms roomsCollection) { int i = 0; for (i = 0; i < allReservations.Count; i++) { if (allReservations[i].ReservationID.Equals(reservationID)) { roomsCollection[allReservations[i].RoomNumber].Status = RoomStatus.Occupied; break; } } return(roomsCollection[allReservations[i].RoomNumber].Status); }
public RoomsController(IRooms rooms) { this._rooms = rooms; }
public ChatService(IUsers users, IRooms rooms, IChatter chatter) { _users = users; _rooms = rooms; _chatter = chatter; }
public int[] FindFreeRoom(DateTime startDate, DateTime endDate, int capacity, IRooms roomsCollection) { if (allReservations.Count == 0) { return(new int[0]); } else { int index = 0; Room[] rooms = roomsCollection.ToArray(); List <int> availableRooms = new List <int>(roomsCollection.ToRoomNumberArray()); //int[] availableRooms = roomsCollection.ToRoomNumberArray(); while (index < allReservations.Count) { int roomNumber = allReservations[index].RoomNumber; int i = 0; for (i = 0; i < rooms.Length; i++) { if (rooms[i].RoomNumber == roomNumber) { break; } } bool capacityIF = capacity == rooms[i].Capacity; bool firstDateIF = (startDate < allReservations[index].StartDate) && (endDate <= allReservations[index].StartDate); bool secondDateIF = (startDate >= allReservations[index].EndDate) && (endDate > allReservations[index].EndDate); if (!(capacityIF && (firstDateIF || secondDateIF))) { availableRooms.Remove(roomNumber); } index++; } for (int j = 0; j < rooms.Length; j++) { for (int i = 0; i < availableRooms.Count; i++) { if (availableRooms[i] == rooms[j].RoomNumber) { if (rooms[j].Capacity != capacity) { availableRooms.Remove(availableRooms[i]); } break; } } } return(availableRooms.ToArray <int>()); } }
public void CheckOutClient(int roomNumber, IRooms roomsCollection) { roomsCollection.CheckOutClient(roomNumber); }
public RoomsController(IRooms rooms) { _rooms = rooms; }
public List <Room> GetAllRooms() { IRooms r = (IRooms)ShowRooms; return(r.AvailableRooms()); }
public void InitializeRooms(IEnumerable <Room> rooms) { this._rooms = new InMemoryRooms(rooms); Startup.Factory = () => this._rooms; this._testServer = TestServer.Create <Startup>(); }
public Sessions(ISlots slots, IRooms rooms, ISpeakers speakers) { _slots = slots; _rooms = rooms; _speakers = speakers; }
public RoomHandler(IPacketSendStrategy sender, IRooms rooms) { this.sender = sender; this.rooms = rooms; }
static Startup() { _rooms = new InMemoryRooms(Enumerable.Range(0, 10).Select(a => new Room(new Name($"room{a}")))); }
public void CheckInClient(String reservationID, IRooms roomsCollection) { throw new NotImplementedException(); }