Ejemplo n.º 1
0
        private void btn_send_order_Click(object sender, EventArgs e)
        {
            log_box.Items.Add("Order sent by: " + cmb_waiter.Text + " " + DateTime.Now.ToString("HH:mm:ss"));

            Variables._order_nr++;
            foreach (DataGridViewRow _dgvr_food in dgv_food.Rows)
            {
                try
                {
                    Food food = new Food(_dgvr_food.Cells[0].Value.ToString(),
                                         _dgvr_food.Cells[1].Value.ToString(), Variables._order_nr);
                    MyLists._my_food_list.Add(food);
                }
                catch (Exception) {  }
            }

            foreach (DataGridViewRow _dgvr_drinks in dgv_drinks.Rows)
            {
                try
                {
                    Drinks drinks = new Drinks(_dgvr_drinks.Cells[0].Value.ToString(),
                                               _dgvr_drinks.Cells[1].Value.ToString(), Variables._order_nr);
                    MyLists._my_drinks_list.Add(drinks);
                }
                catch (Exception) { }
            }

            Order order = new Order(cmb_waiter.Text, cmb_table.Text, Variables._order_nr);

            MyLists._my_orders_list.Add(order);
            Restaurant restaurant = null;

            restaurant = this;
            Functions functions = new Functions(restaurant, 1);
        }
Ejemplo n.º 2
0
        public void Set_Drinks(string drink, string amount, int order_nr)
        {
            Drinks new_drink = new Drinks(drink, amount, order_nr);

            Assert.AreEqual("Wine", drink);
            Assert.AreNotEqual("3", amount);
            Assert.AreEqual(1, order_nr);
        }