Beispiel #1
0
        public int AllocateTableWaiter(List <Table> tables, int tableId, int waitingNumber, int noOfPeople, string waiterName)
        {
            Table table = new TableManager().GetByTableId(tableId);

            if (table != null && table.TableStatus == TableStatus.Active)
            {
                table.TableStatus = TableStatus.Ordering;
                table.CustomerId  = waitingNumber;
                table.WaiterName  = waiterName;
                table.OrderId     = -noOfPeople;//not good. (save number of people in orderId before create order)

                for (int i = 0; i < tables.Count; i++)
                {
                    if (tables[i].TableId == table.TableId)
                    {
                        tables[i] = table;
                    }
                }

                return(new TableManager().Update(table));
            }
            return(0);
        }
Beispiel #2
0
        public int Update(Table table)
        {
            TableManager tableManager = new TableManager();

            return(tableManager.Update(table));
        }
Beispiel #3
0
        public int Delete(Table table)
        {
            TableManager tableManager = new TableManager();

            return(tableManager.DeleteByTableId(table.TableId));
        }
Beispiel #4
0
        public int Add(Table table)
        {
            TableManager tableManager = new TableManager();

            return(tableManager.AddNew(table));
        }