private void BtnAddOrder_Click(object sender, EventArgs e) { CurrentCustomer = Customers[CurrentIndex]; AddOrderForm addOrderForm = new AddOrderForm(CurrentCustomer); addOrderForm.ShowDialog(this); Customers.Insert(CurrentIndex, addOrderForm.Customer); Customers.Remove(CurrentCustomer); dataOrderList.Rows.Clear(); foreach (CoffeeShopLib.MenuItem item in addOrderForm.Items) { dataOrderList.Rows.Add(item.Description, item.Cost); } }
private void AddOrderToolStripMenuItem_Click(object sender, EventArgs e) { CurrentCustomer = Customers[CurrentIndex]; AddOrderForm addOrderForm = new AddOrderForm(CurrentCustomer); addOrderForm.ShowDialog(this); if (addOrderForm.submitted == true) { // display and add order //addOrderForm.Items. } foreach (CoffeeShopLib.MenuItem item in addOrderForm.Items) { dataOrderList.Rows.Add(item.Description, item.Cost); } }