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); }
public int Update(Table table) { TableManager tableManager = new TableManager(); return(tableManager.Update(table)); }
public int Delete(Table table) { TableManager tableManager = new TableManager(); return(tableManager.DeleteByTableId(table.TableId)); }
public int Add(Table table) { TableManager tableManager = new TableManager(); return(tableManager.AddNew(table)); }