Esempio n. 1
0
File: Form1.cs Progetto: KJanos/Shop
        public void button_AddtoCart_Click(object sender, EventArgs e)
        {
            string     name     = combo_Goods.SelectedItem.ToString();
            string     size     = combo_size.SelectedItem.ToString();
            int        quantity = Convert.ToInt32(numericUpDown1.Value);
            int        price    = Convert.ToInt32(text_price.Text);
            GoodsModel item     = new GoodsModel(name, size, quantity, price);

            manager.AddtoCart(item);
            MessageBox.Show("Added to Cart");
            rownumbers += 1;
        }
Esempio n. 2
0
 public void RemoveItem(GoodsModel item)
 {
     _cart.Remove(item);
 }
Esempio n. 3
0
 public void AddtoCart(GoodsModel item)
 {
     _cart.Add(item);
 }