private void GetPersonAttendanceOnDateFromService(Guid personId, DateTime?attendanceDate)
        {
            try
            {
                List <CACCCheckInDb.AttendanceWithDetail> records = null;

                using (CACCCheckInServiceProxy proxy =
                           new CACCCheckInServiceProxy())
                {
                    proxy.Open();

                    if (attendanceDate.HasValue)
                    {
                        logger.Debug("Retrieving GetAttendanceByPersonIdAndDate from CACCCheckInServiceProxy");

                        records = proxy.GetAttendanceByPersonIdAndDate(personId,
                                                                       attendanceDate.Value);
                    }
                    else
                    {
                        logger.Debug("Retrieving GetAttendanceByPersonId from CACCCheckInServiceProxy");

                        records = proxy.GetAttendanceByPersonId(personId);
                    }
                }

                Debug.Assert(View != null);
                View.ViewDispatcher.BeginInvoke(DispatcherPriority.DataBind,
                                                new DispatcherOperationCallback(
                                                    delegate(object arg)
                {
                    View.ReportDataContext = records;
                    return(null);
                }), null);
            }
            catch (Exception ex)
            {
                Debug.Assert(View != null);
                View.ViewDispatcher.BeginInvoke(DispatcherPriority.DataBind,
                                                new DispatcherOperationCallback(
                                                    delegate(object arg)
                {
                    View.DisplayExceptionDetail(ex);
                    return(null);
                }), null);
            }
        }
        /// <summary>
        /// Call to see if child is already checked in today to specific class
        /// </summary>
        /// <param name="person"></param>
        /// <returns></returns>
        public bool IsChildAlreadyCheckedInToday(CACCCheckInDb.PeopleWithDepartmentAndClassView person,
                                                 Guid classId)
        {
            bool isCheckedIntoClassToday = false;

            try
            {
                logger.Debug("Retrieving attendance records for person for today.");

                using (CACCCheckInServiceProxy proxy =
                           new CACCCheckInServiceProxy())
                {
                    proxy.Open();

                    logger.Debug("Calling GetAttendanceByPersonIdAndDate on CACCCheckInService.");

                    // First, we get attendance records for person for Today
                    List <CACCCheckInDb.AttendanceWithDetail> records =
                        proxy.GetAttendanceByPersonIdAndDate(person.PersonId, DateTime.Today);

                    // Then, we see if the attendance was in the specified class
                    isCheckedIntoClassToday = records.Any(r => r.ClassId.Equals(classId));
                }
            }
            catch (Exception ex)
            {
                Debug.Assert(View != null);
                View.ViewDispatcher.BeginInvoke(DispatcherPriority.DataBind,
                                                new DispatcherOperationCallback(
                                                    delegate(object arg)
                {
                    View.DisplayExceptionDetail(ex);
                    return(null);
                }), null);
            }

            return(isCheckedIntoClassToday);
        }