Пример #1
0
        public void AssignOrderToMaster(Order order, User master)
        {

            if (!IsAllowedToAssign(order))
            {
                throw new UserFriendlyException(L("NotAllowedToAssignOrder", order.OrderStatus));

            }

            if (order.AssignedMasterId == master.Id)
            {
                return;
            }

            if (order.OrderStatus == OrderStatus.New)
            {
                order.OrderStatus = OrderStatus.InProcess;
            }

            order.AssignedMasterId = master.Id;
        }
Пример #2
0
 public bool IsAllowedToAssign(Order order)
 {
     return order.OrderStatus == OrderStatus.New ||
         order.OrderStatus == OrderStatus.AwaitingForParts ||
         order.OrderStatus == OrderStatus.InProcess;  
 }