private void Button_Click(object sender, RoutedEventArgs e) { WpfDrinkzy.UserServiceRef.User u = (WpfDrinkzy.UserServiceRef.User)UserList.SelectedItem; WpfDrinkzy.DrinkServiceRef.Drink d = (WpfDrinkzy.DrinkServiceRef.Drink)DrinkList.SelectedItem; FavoriteClient.addDrink(u.ID, d.ID); }
public void AddDrinkToMenu() { WpfDrinkzy.CustomerServiceRef.Customer c = (WpfDrinkzy.CustomerServiceRef.Customer)CustomerList.SelectedItem; if (MenuCardClient.GetMenuByCustomerID(c.ID) == null) { MenuCardClient.createMenuCard(c.ID); } WpfDrinkzy.DrinkServiceRef.Drink d = (WpfDrinkzy.DrinkServiceRef.Drink)DrinkList.SelectedItem; MenuCardClient.addDrink(MenuCardClient.GetMenuByCustomerID(c.ID), d.ID); MenuList.ItemsSource = MenuCardClient.GetMenuByCustomerID(c.ID).Drinks; }