private void GetAttendanceViewModelList(List <AttendanceDetail> attendanceList, CourseViewModel SelectedCourse, List <Reportee> participantList, Attendance attendanceData)
        {
            ObservableCollection <AttendanceListItemViewModel> attendanceListItem = new ObservableCollection <AttendanceListItemViewModel> ();

            foreach (var attendance in attendanceList)
            {
                AttendanceListItemViewModel attendanceViewModel = new AttendanceListItemViewModel(attendance);
                attendanceViewModel.ParticipantList = participantList;
                attendanceViewModel.StartDate       = SelectedCourse.StartDate;
                attendanceViewModel.CourseId        = SelectedCourse.CourseId;
                attendanceViewModel.CanEdit         = attendanceData.CanEdit;
                if (attendanceViewModel.CanEdit == true)
                {
                    attendanceList.Last();
                    attendanceViewModel.MarkItNowCmd = new RelayCommand(() => {
                        MarkAttendanceNow();
                    });
                }
                else
                {
                    attendanceViewModel.CanEdit = false;
                }

                attendanceListItem.Add(attendanceViewModel);
            }
            AttendanceList = attendanceListItem;
        }
Example #2
0
 public PartnerAttendanceLookupViewModel(CourseViewModel selectedCourse, AttendanceListItemViewModel selectedItem)
 {
     this._SelectedCourse   = selectedCourse;
     this._SelectedItem     = selectedItem;
     this._AttendanceDetail = selectedItem._AttendanceDetail;
     GetReporteeAttendanceItemList(selectedItem.ParticipantList);
 }
        public void OnAttendanceListItemSelected()

        {
            if (CrossConnectivity.Current.IsConnected)
            {
                IsBusy = true;
                ReportHandler.GetReporteeList(App.UserName, SelectedItem.CourseId,
                                              (responseReporteeList) => {
                    Debug.WriteLine("Success" + responseReporteeList.Data);
                    ManagerAttendanceLookupPage _ManagerAttendanceLookupPage = new ManagerAttendanceLookupPage();

                    _ManagerAttendanceLookupPage.BindingContext = new ManagerAttendanceLookupViewModel(SelectedItem, responseReporteeList.Data.ReportList);
                    NavigationHandler.GlobalNavigator.Navigation.PushAsync(_ManagerAttendanceLookupPage);
                    SelectedItem = null;

                    IsBusy = false;
                },
                                              (errorResponseReporteeList) => {
                    NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT);

                    SelectedItem = null;

                    IsBusy = false;
                });
            }
            else
            {
                NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT);
            }
        }
        private async void GetAttendanceViewModelList(List <AttendanceDetail> attendanceList, CourseViewModel selectedcourse, List <Reportee> participantList)
        {
            ObservableCollection <AttendanceListItemViewModel> attendanceListItem = new ObservableCollection <AttendanceListItemViewModel> ();

            foreach (var attendance in attendanceList)
            {
                AttendanceListItemViewModel attendanceViewModel = new AttendanceListItemViewModel(attendance);
                attendanceViewModel.ParticipantList = participantList;
                attendanceViewModel.CourseId        = selectedcourse.CourseId;
                attendanceViewModel.StartDate       = selectedcourse.StartDate;
                attendanceListItem.Add(attendanceViewModel);
            }
            AttendanceList = attendanceListItem;
        }
 public ManagerAttendanceLookupViewModel(AttendanceListItemViewModel selectedItem, List <Reportee> reportee)
 {
     this._SelectedItem = selectedItem;
     GetReporteeAttendanceItemList(reportee);
 }
Example #6
0
 public ClientAttendanceLookupViewModel(AttendanceListItemViewModel selectedAttendance)
 {
     this._SelectedItem = selectedAttendance;
     GetReporteeAttendanceItemList(selectedAttendance.ParticipantList);
 }