public string ToString() { StringBuilder builder = new StringBuilder(); if (myServiceID != null) { builder.Append("Service ID: " + myServiceID + "\n"); } builder.Append("This Service is to " + myServiceType.ToString() + " " + myDonationRequest.ToString() + "\n"); if (myServiceDescription != null) { builder.Append("User Submitted Description: " + myServiceDescription + "\n"); } builder.Append("Service is Selected: " + isTrue(mySelected) + "\n"); builder.Append("Service is Completed: " + isTrue(myCompleted) + "\n"); if (myTimeStart != null) { builder.Append(myTimeStart + " to " + myTimeStop + "\n"); } if (myReview != null) { builder.Append("Review of Service:\n" + myReview.ToString() + "\n"); } builder.Append("______________________________________________________\n"); return(builder.ToString()); }
private void nextPage_Click(object sender, RoutedEventArgs e) { checkWhichButtonChecked(); MainWindow mainWindow = Application.Current.MainWindow as MainWindow; User user = mainWindow.getUser(); Service service = new Service(user.getName(), user.getEmail()); service.setServiceType(mainWindow.getServiceType()); service.setDonationRequest(myDonationType); if (myDonationType != DonationTypes.Other) { service.setDescription(myDonationType.ToString()); } else { service.setDescription(myDescription); } user.addService(service); ServiceDatabase serviceDatabase = mainWindow.GetServiceDatabase(); serviceDatabase.createService(mainWindow.getServiceType(), myDonationType, user, service); IInputElement target = NavigationHelper.FindFrame("ListPage1", this); NavigationCommands.GoToPage.Execute("/ThankYou.xaml", target); }