private void Submit() { var demoFlight = ContosoAir.Clients.Views.FeedbackView.name; var imageVal = Image; var feedbackDesc = Description.Value; var imageRating = Rating; FlightFeedbackData FeedbackValue = new FlightFeedbackData { flightId = demoFlight, ratingOnEmotion = imageRating, feedbackText = feedbackDesc }; if (feedbackDesc == null) { var dialog = new MessageDialog("Please give description"); } else { //URL of Logic App with FeedbackValue parameter _cameraService.PutAsync <FlightFeedbackData>("https://prod-42.westus.logic.azure.com:443/workflows/50e4276e308147979d02473f25dfed97/triggers/request/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Frequest%2Frun&sv=1.0&sig=Xvy65VFlwRCfum2hLRoZwSt3W5Q725Xkm-rHmTP7tJE", FeedbackValue); } //URL of Logic App with FeedbackValue parameter //_cameraService.PutAsync<FlightFeedbackData>("https://prod-42.westus.logic.azure.com:443/workflows/50e4276e308147979d02473f25dfed97/triggers/request/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Frequest%2Frun&sv=1.0&sig=Xvy65VFlwRCfum2hLRoZwSt3W5Q725Xkm-rHmTP7tJE", FeedbackValue); IsBusy = true; IsValid = true; bool isValid = Validate(); if (isValid) { NavigationService.NavigateToAsync <ThankViewModel>(); } else { IsValid = false; } IsBusy = false; }
private async void Submit() { //Access selected flightId var demoFlight = ContosoAir.Clients.Views.FeedbackView.name; //Image path where image is stored var imageVal = Image; //Feedback description text which is convered by Bing Speech API var feedbackDesc = Description.Value; //Image rating which given by Emotion API var imageRating = Rating; FlightFeedbackData FeedbackValue = new FlightFeedbackData { flightId = demoFlight, ratingOnEmotion = imageRating, feedbackText = feedbackDesc }; if (feedbackDesc == null) { // Give alert if feedback Description text is empty await DialogService.ShowAlertAsync("", "Please provide feedback description", "Try again"); } else { //URL of Logic App with FeedbackValue parameter var statusValue = await _cameraService.PutAsync <FlightFeedbackData>(Settings.LogicAppUrl, FeedbackValue); demoValue = statusValue; } IsBusy = true; IsValid = true; bool isValid = Validate(); if (isValid) { feedbackResponseValue = float.Parse(demoValue); /*Start Code for analyse ratingOnEmotinScore and Text aanalytics score for Rendaring message*/ if (imageRating != 0) { calculatedResult = (imageRating + feedbackResponseValue) / 2; feedbackResponseValue = calculatedResult; } /*End Code for analyse ratingOnEmotinScore and Text aanalytics score for Rendaring message*/ if (feedbackResponseValue >= 0.5) { //Thank you message will render to end user demoFeedback = "good"; } else { //Due to feedbackScore is bad, a free drink coupen message will render to the end user demoFeedback = "bad"; } await NavigationService.NavigateToAsync <ThankViewModel>(); } else { IsValid = false; } IsBusy = false; }