Пример #1
0
 private TripItem AddItem(string type, string name, string owner, decimal cost, int number)
 {
     if (TripItemsContain(type, name))
     {
         return(GetTripItem(type, name));
     }
     else
     {
         TripItem item = new TripItem(type, name, owner, cost, number);
         Children.Add(item);
         return(item);
     }
 }
        public TripItem AddTripItem(TripItem tripItem)
        {
            if (!DaySet())
            {
                return(null);
            }

            if (CurrentDayContainsChild(tripItem.Type, tripItem.Name))
            {
                return(GetCurrentDayChild(tripItem.Type, tripItem.Name));
            }
            else
            {
                List <TripItem> currentDay = Vacation[_currentDate];
                currentDay.Add(tripItem);
                return(tripItem);
            }
        }
Пример #3
0
        public override TripItem AddItemChild(TripItem tripItem)
        {
            Children.Add(tripItem);

            return(tripItem);
        }
Пример #4
0
 public virtual TripItem AddItemChild(TripItem tripItem)
 {
     return(new TripItem("", "", "", 0, 0));
 }
Пример #5
0
        public override TripItem AddTickets(string name)
        {
            TripItem item = new TripItem(TICKETS, name, "", 0, 0);

            return(_vacationPlanner.AddTripItem(item));
        }
Пример #6
0
        public override TripItem AddSpecialEvent(string name)
        {
            TripItem item = new TripItem(SPECIAL_EVENT, name, "", 0, 0);

            return(_vacationPlanner.AddTripItem(item));
        }
Пример #7
0
        public override TripItem AddReservation(string reservationHolder, decimal cost, int number)
        {
            TripItem item = new TripItem(RESERVATION, "", reservationHolder, cost, number);

            return(_vacationPlanner.AddTripItem(item));
        }
Пример #8
0
        public override TripItem AddHotel(string name)
        {
            TripItem item = new TripItem(HOTEL, name, "", 0, 0);

            return(_vacationPlanner.AddTripItem(item));
        }