private void LogOut_Click(object sender, RoutedEventArgs e) { // Clean rest results in Model. MyRestaurants.Clear(); // Logout button - Go back to Manager window. Manager manager = new Manager(); manager.Show(); this.Close(); }
// GET: Restaurants/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var restaurant = await _context.Restaurants .SingleOrDefaultAsync(m => m.Id == id); TripDTO _tfDto = new TripDTO(); MyRestaurants _restaurant = new MyRestaurants(); DatabaseManager.FlightId = 0; DatabaseManager.LodgingId = 0; DatabaseManager.OtherTransportationId = 0; DatabaseManager.RestaurantId = (int)id; DatabaseManager.CarRentalId = 0; DatabaseManager.ActivityTaskId = 0; _restaurant.Id = DatabaseManager.RestaurantId; _restaurant.RestaurantName = restaurant.RestaurantName; _restaurant.Address = restaurant.Address; _restaurant.Suburb = restaurant.Suburb; _restaurant.City = restaurant.City; _restaurant.Region = restaurant.Region; _restaurant.Postcode = restaurant.Postcode; _restaurant.Country = restaurant.Country; _restaurant.Description = restaurant.Description; _restaurant.Date = restaurant.Date; _restaurant.Time = restaurant.Time; _restaurant.Cuisine = restaurant.Cuisine; _restaurant.NumberInParty = restaurant.NumberInParty; _restaurant.ConfirmationNumber = restaurant.ConfirmationNumber; _restaurant.HoursOfOperation = restaurant.HoursOfOperation; _restaurant.DressCode = restaurant.DressCode; _restaurant.PriceRange = restaurant.PriceRange; _restaurant.TripId = restaurant.TripId; _tfDto.AllHumans = _context.Humans.ToList(); if (restaurant == null) { return(NotFound()); } _tfDto.MyRestaurant = _restaurant; return(View(_tfDto)); }
public void RefreshList() { if (string.IsNullOrEmpty(this.Filter)) { var myListRestaurantsItemViewModel = MyRestaurants.Select(r => new RestaurantsItemViewModel { IdRestaurant = r.IdRestaurant, Name = r.Name, Type = r.Type, Remarks = r.Remarks, Phone = "Tel: " + r.Phone, Address = r.Address, ImagePathMenu = r.ImagePathMenu, ImageArray = r.ImageArray, }); this.Restaurants = new ObservableCollection <RestaurantsItemViewModel>( myListRestaurantsItemViewModel.OrderBy(r => r.Name)); } else { var myListRestaurantsItemViewModel = MyRestaurants.Select(r => new RestaurantsItemViewModel { IdRestaurant = r.IdRestaurant, Name = r.Name, Type = r.Type, Remarks = r.Remarks, Phone = r.Phone, Address = r.Address, ImagePathMenu = r.ImagePathMenu, ImageArray = r.ImageArray, }).Where(r => r.Name.ToLower().Contains(this.Filter.ToLower())).ToList();; this.Restaurants = new ObservableCollection <RestaurantsItemViewModel>( myListRestaurantsItemViewModel.OrderBy(r => r.Name)); } }