Example #1
0
        public List <Appointment> getAppointments(Person login)
        {
            List <Attendance> attendences;

            if (Attendances != null && login != null)
            {
                attendences = Attendances.Where(at => at.PersonID.Equals(login.PersonID)).ToList();
            }
            else
            {
                attendences = new List <Attendance>();
            }
            var ids   = attendences.Select(a => a.AppointmentID).ToList();
            var query = Appointments.Where(r => ids.Any(a => a.Equals(r.AppointmentID))).ToList();

            return(query);
        }
Example #2
0
 public bool AlreadyRegistered(int memberId)
 {
     return(!(Attendances.Where(b => b.MemberId == memberId).SingleOrDefault() == null));
 }