Esempio n. 1
0
        public static bool IsMatch(this IMappedToOrderItem mapped, IPurchaseOrder order, IOrderItem orderItem)
        {
            int?erpId;

            if (orderItem.KitParent != null)
            {
                erpId = orderItem.KitParent.PurchaseOrder.ErpId;
            }
            else if (order != null)
            {
                erpId = order.ErpId;
            }
            else
            {
                throw new InvalidOperationException("Cannot obtain ErpId");
            }

            return(mapped.IsMatch(erpId, orderItem.ErpProductId, orderItem.PlacedName));
        }
Esempio n. 2
0
        public static bool IsMatch(this IMappedToOrderItem mapped, int?erpId, string erpProductId, string placedName)
        {
            if ((mapped.ErpId != null) && (mapped.ErpId != erpId))
            {
                return(false);
            }

            if ((!string.IsNullOrWhiteSpace(mapped.ErpProductId)) && (mapped.ErpProductId != erpProductId))
            {
                return(false);
            }

            if (!string.IsNullOrWhiteSpace(mapped.ItemName) && (mapped.ItemName != placedName))
            {
                return(false);
            }

            return(true);
        }