private async void OnActivitySelected() { if (CrossConnectivity.Current.IsConnected) { IsBusy = true; await ReportHandler.GetReporteeList(App.UserName, SelectedActivity.CourseId, (responseReporteeList) => { Debug.WriteLine("Success" + responseReporteeList.Data); ManagerCourseDetailActivityPage _ManagerCourseDetailActivityPage = new ManagerCourseDetailActivityPage(); _ManagerCourseDetailActivityPage.BindingContext = new ManagerCourseDetailActivityViewModel(SelectedActivity, responseReporteeList.Data.ReportList); NavigationHandler.GlobalNavigator.Navigation.PushAsync(_ManagerCourseDetailActivityPage); SelectedActivity = null; IsBusy = false; }, (errorResponseReporteeList) => { 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); } }
private async void OnManagerCourseSelected() { if (CrossConnectivity.Current.IsConnected) { IsBusy = true; await ReportHandler.GetReporteeList(App.UserName, SelectedCourse.CourseId, async (responseReporteeList) => { Debug.WriteLine("Success" + responseReporteeList.Data); foreach (Reportee reportee in responseReporteeList.Data.ReportList) { ReporteeList.Add(reportee.UserName); } await CourseHandler.GetActivityCompletedReport(App.UserName, SelectedCourse.CourseId, ReporteeList, (responseActivityCompleted) => { Debug.WriteLine("Success" + responseActivityCompleted.ParticipantInfo); if (SelectedCourse != null) { ManagerCourseDetailPage _managerCourseDetail = new ManagerCourseDetailPage(); _managerCourseDetail.BindingContext = new ManagerCourseDetailViewModel(SelectedCourse, responseReporteeList.Data.ReportList, responseActivityCompleted.ParticipantInfo.ActivityData [0].ActivityList); NavigationHandler.GlobalNavigator.Navigation.PushAsync(_managerCourseDetail); } SelectedCourse = null; IsBusy = false; }, (errorActivityCompleted) => { NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT); SelectedCourse = null; IsBusy = false; }); }, (errorResponseReporteeList) => { NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT); IsBusy = false; } ); } }