private void Button_AddToCart_Click(object sender, RoutedEventArgs e)
        {
            if (!amountToBuy.Text.Equals(""))
            {
                WorkWithDatabase work = new WorkWithDatabase();
                SQLiteDataReader dbDataReader = work.selectProducts();
                ArrayList allProducts = new ArrayList();
                while (dbDataReader.Read())
                {
                    allProducts.Add(new Product(dbDataReader["PRODUCT_NAME"].ToString(), Convert.ToDouble(dbDataReader["PRODUCT_PRICE"]), false));
                }

                string selectedProduct = productsCombo.Text;

                foreach (Product item in allProducts)
                {
                    int amount = 0;
                    if (selectedProduct.Equals(item.Name))
                    {
                        amount = Convert.ToInt32(amountToBuy.Text);
                        for (int i = 0; i < amount; i++)
                        {

                            purchasedProducts.Add(new Product(item.Name, item.Price, false));

                        }
                        totalPrice += item.Price * amount;

                        purchazedProductsCobmoBox.Items.Clear();
                        foreach (Product prod in purchasedProducts)
                        {
                            ComboboxItem comboItem = new ComboboxItem();
                            comboItem.Text = prod.Name;
                            if (prod.HasDiscount == false)
                            {
                                purchazedProductsCobmoBox.Items.Add(comboItem);
                            }
                        }
                    }

                }
                productInfo.Text = "Total price " + totalPrice.ToString();
                amountInTheCart += Convert.ToInt32(amountToBuy.Text);
                productsInTheCart.Text = "Products in the cart: " + amountInTheCart.ToString();
            }
            else
            {
                MessageBox.Show("Enter Amount");
            }
        }
 public BuyWindow()
 {
     InitializeComponent();
     WorkWithDatabase work = new WorkWithDatabase();
     var dbDataReader = work.selectProducts();
     ArrayList allProducts = new ArrayList();
     while (dbDataReader.Read())
     {
         ComboboxItem item = new ComboboxItem();
         item.Text = dbDataReader["PRODUCT_NAME"].ToString();
         productsCombo.Items.Add(item);
     }
     dbDataReader.Close();
 }