private void Cart_Click(object sender, EventArgs e) { Form2 f2 = new Form2(); f2.Show(); CartRepository cartRepository = new CartRepository(); f2.dataGridView1.DataSource = cartRepository.GetAll(); this.Hide(); }
private void Remove_Click(object sender, EventArgs e) { var item = dataGridView1.SelectedRows[0].Cells; var id = item[0].Value.ToString(); CartRepository cartRepository = new CartRepository(); cartRepository.Remove(id); dataGridView1.Update(); UpdateGrid(); ResetSelect(); }
private void Order_Click(object sender, EventArgs e) { Form3 f3 = new Form3(); f3.Show(); CartRepository cartRepository = new CartRepository(); List <Cart> cart = cartRepository.GetAll(); cart.Clear(); this.Hide(); }