private static void UpdateItemsStatus(List<int> idList, OrderItemStatus status, int? collectionDataId, int userId) { CheckoutDataContextProvider dcp = CheckoutDataContextProvider.Instance; var itemList = GetAllOrderItemsAsQueryable(dcp).Where(x => idList.Contains(x.ID)).ToList(); DateTime utcNow = DateTime.UtcNow; itemList.ForEach(x => { x.StatusCode = status.ToString(); x.StatusCodeUpdateTime = utcNow; x.CollectionDataID = collectionDataId; }); dcp.CommitChanges(userId); }
private static List<OrderItemDO> GetItemListOfCollection(int collectionId, OrderItemStatus status) { var collectionItemList = GetCollectionOrderItemAsQueryable().Where(x => x.CollectionDataID == collectionId && x.StatusCode == status.ToString()); var orderItemList = CheckoutBL.GetOrderItemListByIdList(collectionItemList.Select(x => x.OrderItemID).ToList()); orderItemList.ForEach(x => { CollectionOrderItem collectionItem = collectionItemList.Single(c => c.OrderItemID == x.ID); x.IsTransferred = collectionItem.IsTransferred; x.IsTransferStatusUncertain = (collectionItem.IsTransferred == false) && (string.IsNullOrEmpty(collectionItem.IdempotencyKey) == false); x.PickupStatus = status.ToString(); x.NotFoundReasonText = collectionItem.NotFoundReasonID.HasValue ? ReasonBL.GetReasonByID(collectionItem.NotFoundReasonID.Value).ReasonText : null; x.WaybillNumber = collectionItem.WaybillNumber; }); return orderItemList; }