public void SetDetails(CityRestaurant city) { CityRestaurantID = city.CityRestaurantID; CityRestaurantName = city.CityRestaurantName; CityRestaurantAddress = city.CityRestaurantAddress; CityRestaurantSubtext = city.CityRestaurantSubtext; CityRestaurantDescription = city.CityRestaurantDescription; CityRestaurantWebSite = city.CityRestaurantWebSite; CityRestaurantAddress = city.CityRestaurantAddress; CityRestaurantTelephone = city.CityRestaurantTelephone; CityRestaurantOpeningHours = city.CityRestaurantOpeningHours; NeighbourhoodID = city.NeighbourhoodID; CuisineID = city.CuisineID; BudgetID = city.BudgetID; TransportID = city.TransportID; DisabilityAccess = city.DisabilityAccess; ChildFriendly = city.ChildFriendly; CityRestaurantImageURL = city.CityRestaurantImageURL; DisabilityDetail = city.DisabilityDetail; ChildDetail = city.ChildDetail; DietaryDetail = city.DietaryDetail; GlutenFree = city.GlutenFree; DairyFree = city.DairyFree; Halal = city.Halal; Kosher = city.Kosher; Vegan = city.Vegan; Vegetarian = city.Vegetarian; CityRestaurantMapCoordinates = city.CityRestaurantMapCoordinates; CityRestaurantFavourite = city.CityRestaurantFavourite; TransportID = city.TransportID; }
public void AddToFavourites(int id, bool isAdd) { CityRestaurant myRestaurant = ctx.CityRestaurants.Where(a => a.CityRestaurantID == id).FirstOrDefault(); if (isAdd == false) { myRestaurant.CityRestaurantFavourite = false; } else { myRestaurant.CityRestaurantFavourite = true; } ctx.SaveChanges(); }
public void addSites() { CityRestaurant CityRestaurant = new CityRestaurant() { CityRestaurantID = 1, CityRestaurantAddress = "Test Address 1", CuisineID = 1, BudgetID = 1, CityRestaurantDescription = "Test Description", CityRestaurantFavourite = true, CityRestaurantImageURL = "http://testurl/url1.jpg", CityRestaurantMapCoordinates = "100,100", CityRestaurantName = "test site one", ChildDetail = "test child detail", CityRestaurantSubtext = "test subtext", CityRestaurantTelephone = "123456789", CityRestaurantWebSite = "testURL", DisabilityDetail = "disability detail test", CityRestaurantOpeningHours = "10am-12am, Mon-Sun", TransportID = 2, NeighbourhoodID = 1 }; allSites.Add(CityRestaurant); CityRestaurant CityRestaurant2 = new CityRestaurant() { CityRestaurantID = 2, DisabilityAccess = true }; allSites.Add(CityRestaurant2); CityRestaurant CityRestaurant3 = new CityRestaurant() { CityRestaurantID = 3, ChildFriendly = true }; allSites.Add(CityRestaurant3); CityRestaurant CityRestaurant4 = new CityRestaurant() { CityRestaurantID = 4, GlutenFree = true }; allSites.Add(CityRestaurant4); CityRestaurant CityRestaurant5 = new CityRestaurant() { CityRestaurantID = 5, Kosher = true }; allSites.Add(CityRestaurant5); CityRestaurant CityRestaurant6 = new CityRestaurant() { CityRestaurantID = 6, Halal = true }; allSites.Add(CityRestaurant6); CityRestaurant CityRestaurant7 = new CityRestaurant() { CityRestaurantID = 7, Vegetarian = true }; allSites.Add(CityRestaurant7); CityRestaurant CityRestaurant8 = new CityRestaurant() { CityRestaurantID = 8, DairyFree = true }; allSites.Add(CityRestaurant8); CityRestaurant CityRestaurant9 = new CityRestaurant() { CityRestaurantID = 9, Vegan = true }; allSites.Add(CityRestaurant9); }