Sample code to show how to list Shipments for a selected location
Shipment ship;
ship = Shipment.NewShipment(ShipmentStatusType.NewDirectShip);
ship.FromLocationType = SourceType.BranchOffice;
ship.FromStockingLocationID = <FromStockingLocationID>;
ship.ToLocationType = SourceType.JobSite;
ship.ToStockingLocationID = <ToStockingLocationID>;
ship.ShipmentProducts["A013010", Guid.Empty].SentQuantity = 100;
ship.ShipmentProducts["B013010", Guid.Empty].SentQuantity = 100;
ship.PlannedShipDate = new DateTime(2015, 9, 19).ToShortDateString();
ship.Save();
ship = Shipment.NewShipment(ShipmentStatusType.NewDirectShip);
ship.FromLocationType = SourceType.BranchOffice;
ship.FromStockingLocationID = <FromStockingLocationID>;
ship.ToLocationType = SourceType.JobSite;
ship.ToStockingLocationID = <ToStockingLocationID>;
ship.ShipmentProducts["A013010", Guid.Empty].SentQuantity = 100;
ship.ShipmentProducts["B013010", Guid.Empty].SentQuantity = 100;
ship.PlannedShipDate = new DateTime(2015, 12, 11).ToShortDateString();
ship.Save();
ship = Shipment.NewShipment(ShipmentStatusType.NewDirectShip);
ship.FromLocationType = SourceType.BranchOffice;
ship.FromStockingLocationID = <FromStockingLocationID>;
ship.ToLocationType = SourceType.JobSite;
ship.ToStockingLocationID = <ToStockingLocationID>;
ship.ShipmentProducts["A013010", Guid.Empty].SentQuantity = 100;
ship.ShipmentProducts["B013010", Guid.Empty].SentQuantity = 100;
ship.PlannedShipDate = new DateTime(2016, 2, 11).ToShortDateString();
ship.Save();
ship = Shipment.NewShipment(ShipmentStatusType.NewDirectShip);
ship.FromLocationType = SourceType.BranchOffice;
ship.FromStockingLocationID = <FromStockingLocationID>;
ship.ToLocationType = SourceType.JobSite;
ship.ToStockingLocationID = <ToStockingLocationID>;
ship.ShipmentProducts["A013010", Guid.Empty].SentQuantity = 100;
ship.ShipmentProducts["B013010", Guid.Empty].SentQuantity = 100;
ship.PlannedShipDate = new DateTime(2016, 8, 19).ToShortDateString();
ship.Save();
List<Guid> stockingLocationIDs = new List<Guid>();
stockingLocationIDs.Add(<SelectedStockingLocationID>); //Add all location IDs for which the shipments are to be included
ShipmentList shipments = ShipmentList.GetShipmentListForGrid(<SelectedStockingLocationID>, //Selected location ID, to fetch shipments visible under it
stockingLocationIDs, //List of StockingLocationIDs for which the shipments are to be fetched
true, //Flag to include/exclude by active status of locations
ShipmentStatusType.ShowAll, //Flag to include/exclude by shipment status
false, //Flag to include/exclude voided shipments
6, //No of months from current to fetch the shipments for, 0 for all
true, //Flag to include/exclude by inactive status of scaffold tags
PartnerTypes.BranchOffice); //Selected location type
List<ShipmentListItem> shipmentsByDate = shipments.Where(s => s.PlannedShipDate.Date == new DateTime(2016, 8, 18)).ToList();
return DataPortal.Fetch<AvontusPermissionView>(new SingleCriteria<AvontusPermissionView, Guid>(Guid.Empty));