예제 #1
0
 public Review(Restaurant restaurant, User user, string reviewText, int rating, DateTime date)
 {
     // reviewID would be incremented in the database
     this.restaurant = restaurant;
     this.user = user;
     this.reviewText = reviewText;
     this.rating = rating;
     this.date = date;
     this.disposed = false;
 }
예제 #2
0
 // Post a review for a restaurant
 public void PostReview(Restaurant restaurant, User user, string reviewText, int rating)
 {
     Review review = new Review(restaurant, user, reviewText, rating, DateTime.Now);
     reviews.Add(review);
 }
예제 #3
0
 // Post a Restaurant not in the database
 public string PostRestaurant(string name, string address, string city, string zipCode)
 {
     string response = "";
     if (!restaurantExists(name, address))
     {
         Restaurant rest = new Restaurant(name, address, city, state, zipCode);
         restaurants.Add(rest);
         response = "Restauraunt added successfully.";
     }
     else
     {
         response = "A restaurant with that name and address already exists in our database.";
     }
     return response;
 }