/// <summary> /// Robert Forbes /// Created: 2017/04/30 /// </summary> /// <param name="pickupId"></param> /// <returns></returns> public List <PickupLine> RetrievePickupLinesByPickupId(int?pickupId) { List <PickupLine> result = new List <PickupLine>(); try { result = PickupLineAccessor.RetrievePickupLinesForPickup(pickupId); } catch { throw; } return(result); }
/// <summary> /// Robert Forbes /// 2017/04/13 /// </summary> /// <param name="driverId"></param> /// <returns></returns> public List <Pickup> RetrievePickupsForDriver(int?driverId) { List <Pickup> pickups = new List <Pickup>(); try { pickups = PickupAccessor.RetrievePickupsForDriver(driverId); foreach (Pickup p in pickups) { p.PickupLineList = PickupLineAccessor.RetrievePickupLinesForPickup(p.PickupId); foreach (PickupLine line in p.PickupLineList) { line.productName = ProductAccessor.RetrieveProduct((int)line.ProductId).Name; } p.address = SupplierAccessor.RetrieveUserAddressBySupplier(p.SupplierId); } } catch { throw; } return(pickups); }