public virtual ActionResult SetCustomShipping(long orderId,
                                                      IList <CustomShippingItemViewModel> items)
        {
            LogI("SetCustomShipping, orderId=" + orderId + ", items=" + String.Join(", ", items.Select(i => i.ToString()).ToList()));

            var rateProviders = ServiceFactory.GetShipmentProviders(LogService,
                                                                    Time,
                                                                    DbFactory,
                                                                    WeightService,
                                                                    AccessManager.Company.ShipmentProviderInfoList,
                                                                    null,
                                                                    null,
                                                                    null,
                                                                    null);

            var result = CustomShippingItemViewModel.Apply(Db,
                                                           LogService,
                                                           Time,
                                                           WeightService,
                                                           orderId,
                                                           rateProviders,
                                                           CompanyAddress.GetReturnAddress(MarketIdentifier.Empty()),
                                                           CompanyAddress.GetPickupAddress(MarketIdentifier.Empty()),
                                                           items,
                                                           AccessManager.IsFulfilment);

            if (result.IsSuccess)
            {
                return(JsonGet(ValueResult <IList <SelectListShippingOption> > .Success("", result.Data)));
            }
            return(JsonGet(ValueResult <IList <SelectListShippingOption> > .Error(result.Message)));
        }
Beispiel #2
0
        public virtual ActionResult Index(string orderId)
        {
            LogI("Index, orderId=" + orderId);

            var company = AccessManager.Company;


            var model = new MailPageViewModel()
            {
                OrderId       = orderId,
                ReturnAddress = MailViewModel.GetFromAddress(CompanyAddress.GetReturnAddress(MarketIdentifier.Empty()), MarketplaceType.Amazon),
                PickupAddress = MailViewModel.GetFromAddress(CompanyAddress.GetPickupAddress(MarketIdentifier.Empty()), MarketplaceType.Amazon)
            };

            return(View(model));
        }