Exemplo n.º 1
0
        /// <summary>
        /// Move a dining group from one table to another.
        /// </summary>
        /// <param name="managerId">Manager ID</param>
        /// <param name="serviceId">Target service ID</param>
        /// <param name="tableId">Target table ID</param>
        /// <param name="checkInId">Target check-in ID</param>
        /// <param name="newTableNumber">New table number</param>
        public async Task <string> MoveDiningGroup(string managerId, string serviceId, string tableId, string checkInId, string newTableNumber)
        {
            // Ensure the manager has access to the given service.
            await _EnsureManagerCanAccessService(managerId, serviceId);

            // Lookup service information.
            var service = await _database.GetDiningServiceById(serviceId);

            // Throw an exception if the service isn't active.
            if (!service.IsActive)
            {
                throw new ServiceIsNotActiveException();
            }

            // Move the dining group.
            return(await _database.MoveDiningGroup(serviceId, tableId, checkInId, newTableNumber));
        }