Ejemplo n.º 1
0
        internal Cart(ref User incomingUser)
        {
            InitializeComponent();

            _currentUser = incomingUser;
            stockBike    = Representative.GetBikesInStock();
        }
Ejemplo n.º 2
0
        public void LoadBikeStock()
        {
            dataGridView3.Rows.Clear();
            var stockBike = Representative.GetBikesInStock();
            App newApp    = new App();

            newApp.SetBikeModelList();
            int i = 0;

            foreach (var elem in newApp.bikeModels)//for each item in cart
            {
                var stock    = stockBike.FindAll(x => x.type == elem.type && x.color == elem.color && x.size == elem.size);
                int quantity = stock.Count();
                dataGridView3.Rows.Add();
                dataGridView3.Rows[i].Cells[0].Value = elem.type;
                dataGridView3.Rows[i].Cells[1].Value = elem.color;
                dataGridView3.Rows[i].Cells[2].Value = elem.size;
                dataGridView3.Rows[i].Cells[3].Value = quantity;
                i++;
            }
        }