Exemple #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);
            }
        }
Exemple #3
0
        public override TripItem AddItemChild(TripItem tripItem)
        {
            Children.Add(tripItem);

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

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

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

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

            return(_vacationPlanner.AddTripItem(item));
        }