Exemplo n.º 1
0
        static void CreateOrder(OrderLog orderlog, Data data)
        {
            int tableId = ValidTableID();

            if (File.Exists($@"{path}\{orderLog}"))
            {
                for (int i = 0; i < orderlog.log.Count; i++)
                {
                    if (orderlog.log[i].tablel.tableID == tableId && orderlog.log[i].tablel.status == false)
                    {
                        Drinks newDrink = ChooseDrink(data);
                        orderlog.log[i].drinksList.Add(newDrink);
                        SaveLog(orderlog);
                        break;
                    }
                    if (i == orderlog.log.Count - 1)
                    {
                        Drinks newDrink = ChooseDrink(data);
                        Order  newOrder = new Order(tableId, newDrink);
                        orderlog.log.Add(newOrder);
                        SaveLog(orderlog);
                        break;
                    }
                }
            }
            else
            {
                Drinks       newDrink = ChooseDrink(data);
                Order        newOrder = new Order(tableId, newDrink);
                List <Order> temp     = new List <Order>();
                temp.Add(newOrder);
                orderlog.log = temp;
                SaveLog(orderlog);
            }
        }
Exemplo n.º 2
0
 public Order(int tableID, Drinks drinks)
 {
     tablel         = new Table();
     drinksList     = new List <Drinks>();
     tablel.tableID = tableID;
     tablel.status  = false;
     drinksList.Add(drinks);
     startTime = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss");
 }
Exemplo n.º 3
0
 public Order(Drinks drinks)
 {
     drinksList = new List <Drinks>();
     drinksList.Add(drinks);
     startTime = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss");
 }