public EditShipment CreateEditShipment(AShipment_Shipment aShipment, IList <AShipment_ShippingVendor> aShippingVendors)
        {
            var model = new EditShipment()
            {
                ShipmentId       = aShipment.MShipment.ShipmentId,
                ShipmentNumber   = aShipment.MShipment.ShipmentNumber,
                ShipmentStatus   = aShipment.MShipment.ShipmentStatus.ToString(),
                TrackingNumber   = aShipment.MShipment.TrackingCode,
                ShipmentDate     = Locale.GetLocalTimeFromUtc(aShipment.MShipment.ShipmentDateTimeUtc),
                ShippingVendorId = aShipment.MShipment.ShippingVendorId,
                ShippingVendors  = GetShippingVendorSelectList(aShippingVendors)
            };

            var shipmentItems = new List <EditShipment.ShipmentItem>();

            foreach (var mShipmentItem in aShipment.MShipment.ShipmentItems)
            {
                var shipmentItem = new EditShipment.ShipmentItem()
                {
                    ShipmentItemId           = mShipmentItem.ShipmentItemId,
                    FulfillableItemId        = mShipmentItem.FulfillableItemId,
                    FulfillableItemReference = mShipmentItem.FulfillableItemReference,
                    Quantity = mShipmentItem.Quantity
                };
                shipmentItems.Add(shipmentItem);
            }
            model.ShipmentItems = shipmentItems;

            return(model);
        }
        public EditShipment CreateEditShipment(AShipment_ShipmentRequest aShipmentRequest, IList <AShipment_ShippingVendor> aShippingVendors)
        {
            var model = new EditShipment()
            {
                ShipmentId       = null,
                ShipmentNumber   = null,
                ShipmentStatus   = "Open",
                TrackingNumber   = null,
                ShipmentDate     = Locale.GetLocalNow().Date,
                ShippingVendorId = null,
                ShippingVendors  = GetShippingVendorSelectList(aShippingVendors)
            };

            var shipmentItems = new List <EditShipment.ShipmentItem>();

            foreach (var mShipmentRequestItem in aShipmentRequest.MShipmentRequest.ShipmentRequestItems)
            {
                var shipmentItem = new EditShipment.ShipmentItem()
                {
                    ShipmentItemId           = null,
                    ShipmentRequestItemId    = mShipmentRequestItem.ShipmentRequestItemId,
                    FulfillableItemId        = mShipmentRequestItem.FulfillableItemId,
                    FulfillableItemReference = mShipmentRequestItem.FulfillableItemReference,
                    Quantity = mShipmentRequestItem.Quantity
                };
                shipmentItems.Add(shipmentItem);
            }
            model.ShipmentItems = shipmentItems;

            return(model);
        }