public ActionResult AddToShipmentPopup()
        {
            var model = new AddToShipmentPopupViewModel();

            model.ShipmentList = ShipmentService.FindShipmentsListItemModel(CurrentCompany, true);
            return(View("AddToShipmentPopup", model));
        }
        public ActionResult DoAddToShipment(AddToShipmentPopupViewModel model, string command)
        {
            if (command.ToLower() == "add")
            {
                // Find the shipment or create a new one
                var shipmentModel = ShipmentService.FindShipmentModel(model.ShipmentId, CurrentCompany, false);
                if (shipmentModel == null)
                {
                    // Create a new Shipment
                    shipmentModel = ShipmentService.CreateShipment(CurrentCompany, CurrentUser);
                }

                // Add the PO's to the shipment
                ShipmentService.AddPurchaseOrders(CurrentCompany, CurrentUser, shipmentModel, model.SelectedPOs);

                return(RedirectToAction("Edit", "Shipments", new { area = "Shipments", id = shipmentModel.Id }));
            }
            else
            {
                return(Purchases());
            }
        }