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); } }