Exemplo n.º 1
0
        public Customer(int id, string name, string address, string telephone, int numNights, Room room, string idRoom)
        {
            this.id = id;
            this.name = name;
            this.address = address;
            this.telephone = telephone;
            this.numNights = numNights;

            bookRoom(id, room, idRoom);

            writeToFile();
        }
Exemplo n.º 2
0
        public Customer(int id, string name, string address, string telephone, int numNights)
        {
            this.id = id;
            this.name = name;
            this.address = address;
            this.telephone = telephone;
            this.numNights = numNights;

            this.room = null;
            this.idRoom = convertStringFormat(this.idRoom, 5);

            writeToFile();
        }
Exemplo n.º 3
0
 public void addRoom(int id, Room room)
 {
     if (id == this.id)
         rooms.Add(room);
 }
Exemplo n.º 4
0
        public void setUpBookingInformation(int id, ArrayList rooms, string idRoom)
        {
            if (id == this.id)
            {

                for (int i = 0; i < rooms.Count; i++)
                {
                    if (((Room)rooms[i]).checkRoom(idRoom))
                    {
                        this.room = (Room)rooms[i];

                        break;
                    }
                }
            }
        }
Exemplo n.º 5
0
        public void checkOut(int id, string idRoom)
        {
            if (id == this.id)
            {
                this.room.setRoomAvailable(idRoom);

                this.room = null;
                this.idRoom = convertStringFormat("", 5);
                this.checkInStatus = false;

                changeInFile(id, 7);
                changeInFile(id, 6);
            }
        }
Exemplo n.º 6
0
        public void checkOut(int id, Hotel hotel, int idHotel, string idRoom)
        {
            if (id == this.id)
            {
                this.checkInStatus = false;

                this.room = hotel.changeRoomStatus(idHotel, convertStringFormat(idRoom, 5), checkInStatus);

                this.idRoom = convertStringFormat("", 5);

                changeInFile(id, 7);
                changeInFile(id, 6);
            }
        }
Exemplo n.º 7
0
        public void bookRoom(int id, Room room, string idRoom)
        {
            if (id == this.id && room != null)
            {
                string idRoom2 = convertStringFormat(idRoom, 5);

                room.setRoomNotAvailable(idRoom2);

                this.room = room;
                this.idRoom = idRoom2;

                if (!this.checkInStatus)
                {
                    changeInFile(id, 7);
                    changeInFile(id, 6);
                }

                this.checkInStatus = true;
            }
        }
Exemplo n.º 8
0
        public void bookRoom(int id, ArrayList rooms, string idRoom)
        {
            if (id == this.id)
            {
                string idRoom2 = convertStringFormat(idRoom, 5);

                for (int i = 0; i < rooms.Count; i++)
                {
                    if (((Room)rooms[i]).checkRoom(idRoom2))
                    {
                        this.room = (Room)rooms[i];
                        this.idRoom = idRoom2;

                        if (this.checkInStatus != true)
                            this.room.setRoomNotAvailable(idRoom2);

                        this.checkInStatus = true;
                        changeInFile(id, 7);
                        changeInFile(id, 6);

                        break;
                    }
                }
            }
        }
Exemplo n.º 9
0
        public void bookRoom(int id, Hotel hotel, int idHotel, string idRoom)
        {
            if (id == this.id)
            {
                string idRoom2 = convertStringFormat(idRoom, 5);
                this.checkInStatus = true;

                this.room = hotel.changeRoomStatus(idHotel, idRoom2, checkInStatus);

                if (this.room != null)
                {
                    this.idRoom = idRoom2;
                }
                else this.checkInStatus = false;

                changeInFile(id, 7);
                changeInFile(id, 6);
            }
        }