예제 #1
0
        /// <summary>
        /// Create a list of all visits preceding the supplied visit
        /// </summary>
        /// <param name="visit">The visit for which the history of visits is requested</param>
        /// <returns></returns>
        public ICollection <Visit> GetPastVisits(Visit visit)
        {
            if (visit == null)
            {
                return(null);
            }
            var pastVisits = new ObservableCollection <Visit>();

            var list = Visits.OrderBy(v => v.PlannedStart);

            foreach (var pastVisit in list)
            {
                if (pastVisit.Id == visit.Id)
                {
                    break;
                }
                pastVisits.Add(pastVisit);
            }
            return(pastVisits);
        }