private void ViewSelectedItem(CommodityDeliveryListItem selectedItem)
 {
     const string uri = "/views/CommodityReception/DocumentDetails.xaml";
     string messagesource = "/views/CommodityReception/AwaitingReception.xaml";
     Messenger.Default.Send<DocumentDetailMessage>(new DocumentDetailMessage { Id = selectedItem.DocumentId, DocumentType = DocumentType.CommodityDelivery, MessageSourceUrl = messagesource });
     NavigateCommand.Execute(uri);
 }
        private void WeighandReceive(CommodityDeliveryListItem item)
        {
            using (var c = NestedContainer)
            {
                Using<IWeighAndReceivePopUp>(c).ShowWeighAndReceive(item.DocumentId);
                LoadItem();
            }

        }
 private void AddItemToList(CommodityDeliveryNote sourcingDocument)
 {
     var item = new CommodityDeliveryListItem();
     item.DocumentId = sourcingDocument.Id;
     item.DocumentReference = sourcingDocument.DocumentReference;
     item.Description = sourcingDocument.Description;
     item.DateIssued = sourcingDocument.DocumentDateIssued;
     item.ClerkName = sourcingDocument.DocumentIssuerUser.Username;
     item.NoOfContainers = sourcingDocument.LineItems.GroupBy(s => s.ContainerNo).Count();
     item.Status = sourcingDocument.Status;
     item.DriverName = sourcingDocument.DriverName;
     item.VehicleRegNo = sourcingDocument.VehiclRegNo;
     item.NetWeight = TruncateDecimal(sourcingDocument.LineItems.Sum(s => s.Weight), 1);
     item.TareWeight = TruncateDecimal(sourcingDocument.LineItems.Sum(k => k.ContainerType.TareWeight), 1);
     item.GrossWeight = item.NetWeight + item.TareWeight;
     LineItem.Add(item);
 }