123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace TestApp
- {
- /// <summary>
- /// Логика взаимодействия для ProductList.xaml
- /// </summary>
- public partial class ProductList : Page
- {
- Trade DB = new Trade();
- public List<Product> Products = new List<Product>();
- public ProductList()
- {
- InitializeComponent();
- Products = DB.Product.ToList();
- Vivod.ItemsSource = Products;
- }
- private void AddToCart(object sender, RoutedEventArgs e)
- {
- Button bt = (Button)sender;
- string Article = bt.Uid.ToString();
- Product pr = new Product();
- pr = DB.Product.FirstOrDefault(x => x.ProductArticleNumber == Article);
- Basket.Products.Add(pr);
- }
- private void ToCart(object sender, RoutedEventArgs e)
- {
- Basket bk = new Basket();
- bk.ShowDialog();
- }
- }
- }
|