private void btnAdd_Click(object sender, EventArgs e) { ProductViewModel productViewModell = (ProductViewModel)cbProducts.SelectedItem; carItem = productViewModell.ConvertToCarItemPurchase(); carItem.Quantity = int.Parse(txtQuantity.Text); shoppingcar.AddPurchase(carItem, int.Parse(productViewModell.Stock)); RefreshData(); }