Beispiel #1
0
 //销售规则Check
 public static bool CheckSaleRule(SOInfo soEntity, SOInfo newSO)
 {
     // 有问题 覆盖其他Promotion
     soEntity.SOPromotions = ExternalDomainBroker.CalculateSOPromotion(soEntity);
     if (soEntity != null && soEntity.SOPromotions != null && soEntity.SOPromotions.Count > 0)
     {
         foreach (SOPromotionInfo soPromotion in soEntity.SOPromotions)
         {
             if (soPromotion == null || soPromotion.SOPromotionDetails == null)
             {
                 continue;
             }
             //if (销售规则有效?)
             //{
             //比较
             int count = 0;//用于比较的计数
             foreach (SOItemInfo item in newSO.Items)
             {
                 if (soPromotion.SOPromotionDetails.Exists(x => x.MasterProductSysNo == item.ProductSysNo))
                 {
                     count++;
                 }
             }
             if (count > 0 && count < soPromotion.SOPromotionDetails.Count)
             {
                 return(false);
             }
             //}
         }
     }
     return(true);
 }