private void AddFakeCoffeeButton_Click(object sender, RoutedEventArgs e) { Coffee coffee = new Coffee () { CoffeeId = 123, CoffeeName = "Test coffee", Description = "Simply the best coffee", ImageId = 1, AmountInStock=1000, InStock = true, FirstAddedToStockDate = new DateTime(2014,1,3), OriginCountry = Country.Ethiopia, Price = 12 }; Coffees.Add(coffee); }
private void CoffeeListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { selectedCoffee = e.AddedItems[0] as Coffee; if (e != null) { CoffeeIdLabel.Content = selectedCoffee.CoffeeId; CoffeeNameLabel.Content = selectedCoffee.CoffeeName; DescriptionLabel.Content = selectedCoffee.Description; PriceLabel.Content = selectedCoffee.Price; StockAmountLabel.Content = selectedCoffee.AmountInStock.ToString(); FirstTimeAddedLabel.Content = selectedCoffee.FirstAddedToStockDate.ToShortDateString(); BitmapImage img = new BitmapImage(); img.BeginInit(); img.UriSource = new Uri("/JoeCoffeeStore.StockManagement.App;component/Images/coffee" + selectedCoffee.CoffeeId + ".jpg", UriKind.Relative); img.EndInit(); CoffeeImage.Source = img; } }
public void UpdateCoffee(Coffee coffee) { Coffee coffeeToUpdate = _coffees.Where(c => c.CoffeeId == coffee.CoffeeId).FirstOrDefault(); coffeeToUpdate = coffee; }
public void DeleteCoffee(Coffee coffee) { _coffees.Remove(coffee); }
public void DeleteCoffee(Coffee coffee) { repository.DeleteCoffee(coffee); }
public void UpdateCoffee(Coffee coffee) { repository.UpdateCoffee(coffee); }
public void UpdateCoffee(Coffee coffee) { throw new NotImplementedException(); }