Example #1
0
        public static bool IsCompletable(this Shipment item, coreModel.Order ParentOrder, OrderClient client)
        {
            var retVal = ParentOrder.GetCurrentStatus() != (int)OrderStatus.AwaitingExchange &&
                         client.CanChangeStatus(item, ShipmentStatus.Shipped.ToString());

            return(retVal);
        }
Example #2
0
        public static bool IsReleaseable(this Shipment item, coreModel.Order ParentOrder, OrderClient client)
        {
            var retVal = !string.IsNullOrEmpty(item.ShippingAddressId) &&
                         !Guid.Empty.Equals(item.ShippingMethodId) &&
                         ParentOrder.GetCurrentStatus() != (int)OrderStatus.Pending &&
                         ParentOrder.GetCurrentStatus() != (int)OrderStatus.AwaitingExchange &&
                         client.CanChangeStatus(item, ShipmentStatus.Released.ToString());

            return(retVal);
        }
Example #3
0
        public static void SetCurrentStatus(this Shipment item, int value, OrderClient client)
        {
            var newStatus = (ShipmentStatus)value;

            if (client.CanChangeStatus(item, newStatus.ToString()))
            {
                item.Status = newStatus.ToString();
            }
            else
            {
                throw new OperationCanceledException("[Shipment] Unable to transition: " + item.Status + " -> " + newStatus.ToString());
            }
        }
Example #4
0
 public static bool IsCompletable(this RmaRequest item, OrderClient client)
 {
     return(client.CanChangeStatus(item, RmaRequestStatus.Complete.ToString()));
 }