public async void saveInitialFeedback() { FeedBack fb = new FeedBack() { EventName = newEvent.EventName, City = newEvent.Location, SupportTo = "", EventDate = newEvent.EndDate, SupportGiven = "", ActivationLocation = "", LeaderName = "", VolunteerNumber = 0, HoursSpent = 0, PatronNumber = 0, PatronInteractionNum = 0, PancakesProvided = false, NumberPancakes = 0, WaterProvided = false, AmountWater = 0, AnyGiveaways = false, GivenAway = "", AnyPraiseReports = false, PraiseReport = "", AnyIncidents = false, IncidentDescription = "", FollowUpNeeded = false, FollowUpName = "", EventID = newEvent.Id }; await azureService.AddFeedback(fb); }
async Task ExecuteSaveFeedbackCommand() { if (IsBusy) return; if (string.IsNullOrWhiteSpace(Text)) { await _page.DisplayAlert("Enter Feedback", "Please enter some feedback for our team.", "OK"); return; } Message = "Submitting feedback..."; IsBusy = true; saveFeedbackCommand.ChangeCanExecute(); try { await azureService.AddFeedback(new Feedback { Text = this.Text, FeedbackDate = DateTime.UtcNow, VisitDate = Date, Rating = Rating, ServiceType = ServiceType, LocationName = LocationName, Name = Name, PhoneNumber = PhoneNumber, RequiresCall = RequiresCall, }); //Gen App center test crash //Crashes.GenerateTestCrash(); } catch (Exception ex) { Crashes.TrackError(ex); _page.DisplayAlert("Uh Oh :(", "Unable to save feedback, please try again.", "OK"); Analytics.TrackEvent("Exception", new Dictionary<string, string> { { "Message", ex.Message }, { "StackTrace", ex.ToString() } }); } finally { IsBusy = false; saveFeedbackCommand.ChangeCanExecute(); } await _page.Navigation.PopAsync(); }
public async void ClosedEventClicked(object sender, EventArgs e) { feedBack.EventName = ev.EventName; feedBack.EventDate = eventDate.Date; feedBack.ActivationLocation = locationFld.Text; feedBack.LeaderName = TeamLeaderNameFld.Text; feedBack.VolunteerNumber = HelperClass.HasValue(VolNumber.Text); feedBack.HoursSpent = HelperClass.HasValue(HoursSpent.Text); feedBack.PatronNumber = HelperClass.HasValue(PatronsFld.Text); feedBack.PatronInteractionNum = HelperClass.HasValue(InteractionsFld.Text); feedBack.PancakesProvided = pancakesSwitch.IsToggled; feedBack.NumberPancakes = HelperClass.HasValue(numpancakes.Text); feedBack.WaterProvided = waterSwitch.IsToggled; feedBack.AmountWater = HelperClass.HasValue(numWater.Text); feedBack.AnyGiveaways = giveAwaySwitch.IsToggled; feedBack.GivenAway = giveAway.Text; feedBack.AnyPraiseReports = praiseSwitch.IsToggled; feedBack.PraiseReport = praise.Text; feedBack.AnyIncidents = incidentSwitch.IsToggled; feedBack.IncidentDescription = incident.Text; feedBack.FollowUpNeeded = followUpSwitch.IsToggled; feedBack.FollowUpName = followUp.Text; feedBack.EventID = ev.Id; // close event ev.IsClosed = true; await azureService.AddFeedback(feedBack); await azureService.UpdateEvent(ev); SendEmail(); await Navigation.PopAsync(); }