private static bool getCustomerCondition(CustomerCondition rejCondition, ZV04IProperty zv, RejectionsDataProperty rd) { switch (rejCondition) { case CustomerCondition.All: return(rd.soldTo == 0); case CustomerCondition.SoldTo: return(rd.soldTo == zv.soldTo && rd.shipTo == 0); case CustomerCondition.ShipTo: return(rd.soldTo == zv.soldTo && rd.shipTo == zv.shipTo); default: throw new NotImplementedException("Cound not find implementation for customer condition"); } }
private List <RejectionsProperty> getInitialRejPropertyList(string id, IDataCollectorServiceRejections dcsr, CustomerCondition customerCondition) { return(( from zv in dcsr.zvList join cd in dcsr.cdList on new { key0 = zv.soldTo, key1 = zv.shipTo } equals new { key0 = cd.soldTo, key1 = cd.shipTo } join rd in dcsr.rdjList on new { key0 = zv.material, key1 = cd.country.ToLower() } equals new { key0 = rd.sku, key1 = rd.country.ToLower() } where getStockConditon(rd: rd, zv: zv) && getCustomerCondition(rejCondition: customerCondition, zv: zv, rd: rd) select getRejectionsPropertyObjs(zv: zv, rd: rd, cd: cd, id: id) ).ToList()); }