public static bool CanOrderItemBeAddedToNotFoundList(CollectionDataDO collection, OrderItemDO orderItem) { if (CanOrderItemBeAddedToCollection(collection, orderItem) == false) return false; if (collection.NotFoundItemList.Select(x => x.ID).Contains(orderItem.ID)) { return false; } return true; }
public static bool CanUserDoActionOnLocation(int locationId, CollectionDataDO collectionData) { if (collectionData == null) { return true; } if (collectionData.Location.ID == 0 || locationId == 0) { return true; } if (collectionData.Location.ID == locationId) { return true; } return false; }
private static bool CanOrderItemBeAddedToCollection(CollectionDataDO collection, OrderItemDO orderItem) { if (collection == null) { return false; } if (orderItem == null) { return false; } if (orderItem.StatusCode != OrderItemStatus.CheckoutWaiting.ToString()) { return false; } return true; }
public static bool CanOrderItemBeRemovedFromCollection(CollectionDataDO collection, CollectionOrderItem collectionOrderItem) { if (collection == null) { return false; } if (collectionOrderItem == null) { return false; } if (collectionOrderItem.StatusCode != OrderItemStatus.Found.ToString() && collectionOrderItem.StatusCode != OrderItemStatus.NotFound.ToString()) { return false; } if (collection.NotFoundItemList.Select(x => x.ID).Contains(collectionOrderItem.OrderItemID) == false && collection.FoundItemList.Select(x => x.ID).Contains(collectionOrderItem.OrderItemID) == false) { return false; } return true; }
public CollectionViewModel() { CollectionData = new CollectionDataDO(); }
public static bool CanUserCompletePickup(CollectionDataDO collectionData, int userId) { if (collectionData == null) { return false; } if (collectionData.CreateUserID != userId) { return false; } if ((collectionData.NotFoundItemList.Count <= 0 && collectionData.FoundItemList.Count <= 0)) { return false; } return true; }
public static bool CanUserRemoveItemFromList(CollectionDataDO collectionData, int userId) { if (collectionData == null) { return false; } if (collectionData.IsCompleted) { return false; } if (collectionData.FoundItemList.Count == 0 && collectionData.NotFoundItemList.Count == 0) { return false; } if (collectionData.CreateUserID != userId) { return false; } return true; }