コード例 #1
0
        public Guest VerifyGuest(string roomID, string PIN)
        {
            // check if the guest entered a proper room number and PIN
            Guest guest = null;


            try
            {
                if (1 == RoomAccessor.VerifyRoomAndPIN(roomID, UserManager.HashSHA256(PIN)))
                {
                    // the login was successfull
                    PIN = null;

                    guest = GuestAccessor.RetrieveGuestByRoomID(roomID);

                    if (null == guest)
                    {
                        throw new ApplicationException("Could not find guest associated with that room!");
                    }
                }
                else
                {
                    throw new ApplicationException("Incorrect Login, please try again.");
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(guest);
        }
コード例 #2
0
        public Guest GetGuestByRoomID(string roomID)
        {
            // Get a specific guest by the room
            Guest guest = null;

            try
            {
                guest = GuestAccessor.RetrieveGuestByRoomID(roomID);
            }
            catch (Exception)
            {
                throw;
            }

            return(guest);
        }
コード例 #3
0
        public List <Guest> GetGuests()
        {
            // Generate a list of guests in the hotel for the clerk
            List <Guest> guests;

            try
            {
                guests = GuestAccessor.RetriveAllGuests();
            }
            catch (Exception)
            {
                throw;
            }

            return(guests);
        }
コード例 #4
0
 public LuggageManager(MockLuggageAccessor mockLuggage, GuestAccessor mockGuest)
 {
     luggageAccessor = mockLuggage;
     guestAccessor   = mockGuest;
 }