Пример #1
0
        public async void OnActivitySelected()
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                IsBusy = true;

                await ReportHandler.GetParticipantList(App.UserName, SelectedActivity.CourseId,
                                                       (responseParticipantList) => {
                    if (SelectedActivity != null)
                    {
                        Debug.WriteLine("Success" + responseParticipantList.Data);

                        MarkAttendancePage _MarkAttendancePage = new MarkAttendancePage();
                        _MarkAttendancePage.BindingContext     = new MarkAttendanceItemViewModel(SelectedActivity, responseParticipantList.Data.ReportList);
                        NavigationHandler.GlobalNavigator.Navigation.PushAsync(_MarkAttendancePage);
                        SelectedActivity = null;
                        IsBusy           = false;
                    }
                },
                                                       (errorResponseParticipantList) => {
                    NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT);
                    SelectedActivity = null;
                    IsBusy           = false;
                });
            }
            else
            {
                NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT);
            }
        }
Пример #2
0
 private async void OnCourseSelected()
 {
     if (CrossConnectivity.Current.IsConnected)
     {
         IsBusy = true;
         await ReportHandler.GetParticipantList(App.UserName, SelectedCourse.CourseId,
                                                (responseParticipantList) => {
             //Success callback
             Debug.WriteLine("Success" + responseParticipantList.ResponseCode);
             AttendanceHandler.GetAttendance(SelectedCourse.CourseId,
                                             (responseAttendance) => {
                 Debug.WriteLine("Success" + responseAttendance.AttendanceData);
                 PartnerCourseDetailPage _PartnerCourseDetailPage = new PartnerCourseDetailPage();
                 _PartnerCourseDetailPage.BindingContext          = new PartnerCourseDetailViewModel(SelectedCourse, responseParticipantList.Data.ReportList, responseAttendance.AttendanceData.AttendanceList, responseAttendance.AttendanceData);
                 NavigationHandler.GlobalNavigator.Navigation.PushAsync(_PartnerCourseDetailPage);
                 SelectedCourse = null;
                 IsBusy         = false;
             },
                                             (errorAttendance) => {
                 NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT);
                 IsBusy = false;
             });
         },
                                                (errorResponseParticipantList) => {
             //Error callback
             NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT);
             SelectedCourse = null;
             IsBusy         = false;
         });
     }
     else
     {
         NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT);
     }
 }