Esempio n. 1
0
        private void addBurritoBtn_Click(object sender, EventArgs e)
        {
            try
            {
                bDialog.clearState(curInventory);
                if (bDialog.ShowDialog() == DialogResult.OK && oManager.addBurritoToOrder(newOrder, bDialog.getNewBurrito()))
                {
                    int n = dataGridView1.Rows.Add();
                    dataGridView1.Rows[n].Cells[0].Value = n;
                    dataGridView1.Rows[n].Cells[1].Value = bDialog.getBurritoType();
                    dataGridView1.Rows[n].Cells[2].Value = bDialog.getNewBurrito().Price;

                    //remove ingredients from Inventory
                    iManager.removeFromInventory(curInventory, bDialog.getNewBurrito());
                    iManager.updateInventory(curInventory);

                    //update cost
                    updateTotalCost();
                }
            }
            catch (Exception err)
            {
                dLog.Error("Exception in addBurritoBtn_Click: " + err.Message);
            }
        }