コード例 #1
0
        //Update
        public bool UpdateOuting(string originalOuting, Outings newOuting)
        {
            Outings oldOuting = GetOutingByName(originalOuting);

            if (oldOuting != null)
            {
                oldOuting.OutingName     = newOuting.OutingName;
                oldOuting.TypeOfOuting   = newOuting.TypeOfOuting;
                oldOuting.NumberOfPeople = newOuting.NumberOfPeople;
                oldOuting.Date           = newOuting.Date;
                oldOuting.CostPerPerson  = newOuting.CostPerPerson;

                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        //Delete
        public bool RemoveOuting(string name)
        {
            Outings outing = GetOutingByName(name);

            if (outing == null)
            {
                return(false);
            }

            int initialCount = _listOfOutings.Count;

            _listOfOutings.Remove(outing);

            if (initialCount > _listOfOutings.Count)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
 //Create Outing
 public void AddOuting(Outings outing)
 {
     _listOfOutings.Add(outing);
 }