public void UpdateRateParticipant() { if (CrossConnectivity.Current.IsConnected) { IsBusy = true; _ParticipantRating = new ParticipantRating(); _ParticipantRating.CourseId = _SelectedReportee.CourseID; _ParticipantRating.Rating = new List <RatingAnswer> (); _ParticipantRating.UserName = App.UserName; foreach (QuestionListViewModel vm in RatingQuestionList) { _ParticipantRating.Rating.Add(new RatingAnswer() { AnswerText = vm.Answer, QuestionID = vm.QuestionID }); } ReportHandler.GetRateParticipant(_ParticipantRating, (responseParticipantRate) => { Debug.WriteLine("Success" + responseParticipantRate.ResponseCode); NavigationHandler.GlobalNavigator.Navigation.PopAsync(); IsBusy = false; }, (errorResponseParticipantRate) => { NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT); IsBusy = false; }); } }
public static async Task GetRateParticipant(ParticipantRating participantRating, Action <RateParticipantReponse> successCallback, Action <ResponseBase> errorCallback) { RestRequest request = new RestRequest("/lms/api/rateparticipant", Method.PUT); request.AddBody(new RateParticipantRequest() { UniqueAppId = App.UniqueAppId, ParticipantRatingData = participantRating }); RateParticipantReponse response = await APIServiceProvider.ServiceProvider.Execute <RateParticipantReponse> (request); if ((response != null) && (response.ResponseCode == "1000")) { successCallback?.Invoke(response); } else { errorCallback?.Invoke((ResponseBase)response); } }