Esempio n. 1
0
        //Thêm bàn
        public void Add(Table table)
        {
            listtable.ListTable.Add(table);
            string fullpath = $@"{path}\{filename}";

            ReadorWriteFile <Listtable> .WriteData(fullpath, listtable);
        }
Esempio n. 2
0
        // in bill
        public void PrintBill(Table table)
        {
            string billname = $"{DateTime.Now.ToString("ddMMyyyyhhmm")}_table_{table.TableId}";

            ReadorWriteFile <Table> .WriteData($@"{path}\{billname}", table);

            string fulllink = $@"{path}\{filename}";

            ReadorWriteFile <Listtable> .WriteData(fulllink, listtable);
        }
Esempio n. 3
0
 // Thêm đồ uống
 private static void UpdateTable()
 {
     try
     {
         Console.WriteLine("Enter id of table you want to add: ");
         int id = int.Parse(Console.ReadLine());
         Table _table = admin.Check(id);
         if (_table != null)
         {
             if (_table.Status == 1)
             {
                 do
                 {
                     _table.drinks.Add(Newdrink());
                     int ind = admin.listtable.ListTable.IndexOf(_table);
                     admin.listtable.ListTable[ind].drinks = _table.drinks;
                     string fulllink = $@"{path}\{filename}";
                     ReadorWriteFile<Listtable>.WriteData(fulllink, admin.listtable);
                     Console.Clear();
                     Console.WriteLine(_table.ToString());
                     Console.WriteLine("Successfully");
                     Console.Write("Do you want to add more? y/n:  ");
                 } while (Console.ReadLine().ToLower() == "y");
             }
             else
             {
                 Console.WriteLine(_table.ToString());
                 Console.WriteLine("This table has already been paid or cancel!");
             }
         }
         else
         {
             Console.WriteLine("Not found!");
         }
     }
      catch (Exception e)
     {
         Console.WriteLine($"{e.GetType()}, {e.Message}");
         UpdateTable();
     }
 }