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); }
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); }
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()); } }
public static bool IsCompletable(this RmaRequest item, OrderClient client) { return(client.CanChangeStatus(item, RmaRequestStatus.Complete.ToString())); }