Exemplo n.º 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);
            }
        }
        public async void MarkAttendanceNow()
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                IsBusy = true;

                MarkAttendancePage _MarkAttendancePage = new MarkAttendancePage();
                _MarkAttendancePage.BindingContext = new MarkAttendanceItemViewModel(_SelectedCourse, SelectedItem.ParticipantList);
                NavigationHandler.GlobalNavigator.Navigation.PushAsync(_MarkAttendancePage);
                IsBusy = false;
            }
            else
            {
                NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT);
            }
        }