private IList <FoodDelivery> GetFoodDeliveries(int pIntDocEntry) { IList <FoodDelivery> lLstObjFoodDeliveries = new List <FoodDelivery>(); foreach (DeliveryFoodDTO lObjDelivery in SapDeliveryFoodService.GetDeliveriesFood(pIntDocEntry)) { lLstObjFoodDeliveries.Add(new FoodDelivery() { DocType = lObjDelivery.DocType, DocNum = lObjDelivery.DocNum, DocEntry = lObjDelivery.DocEntry, CardCode = lObjDelivery.CardCode, LineNum = lObjDelivery.LineNum, WhsCode = lObjDelivery.WhsCode, TaxCode = lObjDelivery.TaxCode, BatchNumber = lObjDelivery.BatchNumber, ItemCode = lObjDelivery.ItemCode, Quantity = lObjDelivery.Quantity, Price = lObjDelivery.Price, CreationDate = lObjDelivery.CreateDate, ModificationDate = lObjDelivery.UpdateDate, Opened = lObjDelivery.Opened }); } return(lLstObjFoodDeliveries); }
public void ImportFoodDeliveries(string pStrWhsCode) { IList <int> lLstIntLocalDocEntries = LocalDeliveryFoodService.GetList().Select(x => x.DocEntry).ToList(); foreach (int lIntDocEntry in SapDeliveryFoodService.GetDeliveriesFoodList(pStrWhsCode).Where(x => !lLstIntLocalDocEntries.Contains(x))) { ImportFoodDelivery(lIntDocEntry); } }
public void UpdateFoodDeliveries(string pStrWhsCode) { foreach (DeliveryFoodDTO lObjDeliveryFood in SapDeliveryFoodService.GetUpdatedDeliveriesFoodList(pStrWhsCode)) { if (FoodDeliveryHasChanges(lObjDeliveryFood)) { UpdateFoodDelivery(lObjDeliveryFood.DocEntry); } } }