private async Task FetchUserReportParticitant(string courseId) { if (CrossConnectivity.Current.IsConnected) { await ReportHandler.GetUserReport(App.UserName, courseId, (response) => { this._ParticipantReportSummary = response.ParticipantReportData; RaisePropertyChanged(); }, (errorRespnose) => { //Error callback NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT); RaisePropertyChanged(); IsBusy = false; }); } else { NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT); } }
public async Task Init() { if (CrossConnectivity.Current.IsConnected) { await ReportHandler.GetProgramList(App.UserName, (response) => { //Success callBack Debug.WriteLine("success:" + response.ProgramReportReponseData.ProgramList); this.GetProgramViewModelList(response.ProgramReportReponseData.ProgramList); IsBusy = false; }, (errorRespnose) => { //Error callback NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT); IsBusy = false; }); } else { NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT); } }
public async void OnSelectedMarkAttendanceItem() { if (CrossConnectivity.Current.IsConnected) { IsBusy = true; ReportHandler.GetParticipantRatingQuestion( (response) => { Debug.WriteLine("Success" + response.QuestionInfo.QuestionData); // App.RatingQuesion = response.QuestionInfo.QuestionData; RateParticipantPage _RateParticipantPage = new RateParticipantPage(); _RateParticipantPage.BindingContext = new RateParticipantViewModel(SelectedMarkAttendanceItem, response.QuestionInfo.QuestionData); //App.RatingQuesion); NavigationHandler.GlobalNavigator.Navigation.PushAsync(_RateParticipantPage); SelectedMarkAttendanceItem = null; IsBusy = false; }, (errorResponse) => { NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT); SelectedMarkAttendanceItem = null; IsBusy = false; }); } }
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; } ); } }
private async Task FetchProgramReport(string programId) { if (CrossConnectivity.Current.IsConnected) { await ReportHandler.GetProgramReportList(App.UserName, programId, (response) => { //Success callback this.GetProgramReportViewModelList(response.ResponseData.ProgramReportList); RaisePropertiesChanged(); }, (errorRespnose) => { //Error callback NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT); // Debug.WriteLine ("Error:: /nCode: " + errorRespnose.ResponseCode + "/nMessage: " + errorRespnose.Status); // RaisePropertiesChanged(); IsBusy = false; }); } else { NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT); } }