Ejemplo n.º 1
0
        internal Guest(string name, bool isChild, bool isNewlyweds, bool orderedBreakfest, decimal basePrice, ReservationRoom reservationRoom)
        {
            GuestValidators.ValidIfNameExist(name);
            GuestValidators.ValidPrice(basePrice);

            Name             = name;
            IsChild          = isChild;
            IsNewlyweds      = isNewlyweds;
            OrderedBreakfest = orderedBreakfest;
            BasePrice        = basePrice;
            ReservationRoom  = reservationRoom;
        }
Ejemplo n.º 2
0
        public void Update(Guest updatedGuest)
        {
            GuestValidators.ValidIfNameExist(updatedGuest.Name);
            GuestValidators.ValidPrice(updatedGuest.BasePrice);

            if (updatedGuest.Id != Id)
            {
                throw new HotelException("Nie można przypisać gościa do innego pokoju");
            }

            if (updatedGuest.IsChild && updatedGuest.IsNewlyweds)
            {
                throw new HotelException("Nie można dodać osoby - dziecko nie może być nowożeńcem");
            }

            Name             = updatedGuest.Name;
            IsChild          = updatedGuest.IsChild;
            IsNewlyweds      = updatedGuest.IsNewlyweds;
            OrderedBreakfest = updatedGuest.OrderedBreakfest;
            BasePrice        = updatedGuest.BasePrice;
        }
Ejemplo n.º 3
0
        internal void SetPriceForStay(decimal priceForStay)
        {
            GuestValidators.ValidPrice(priceForStay);

            PriceForStay = priceForStay;
        }