Exemplo n.º 1
0
        public bool AcceptOrder(int orderId, int addedUserId)
        {
            var order = _ordersRepository.GetOrderById(orderId);

            if (order == null || order.AddingUser.UserId != addedUserId || order.IsDone == false || order.ExecutingUser == null || order.IsPaid == true)
            {
                return(false);
            }
            return(_ordersRepository.AcceptOrder(order));
        }