예제 #1
0
        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);
           
        }
예제 #2
0
        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);
 }       
예제 #5
0
 public void DeleteCoffee(Coffee coffee)
 {
     repository.DeleteCoffee(coffee);
 }
예제 #6
0
 public void UpdateCoffee(Coffee coffee)
 {
     repository.UpdateCoffee(coffee);
 }
예제 #7
0
 public void UpdateCoffee(Coffee coffee)
 {
     throw new NotImplementedException();
 }