Exemple #1
0
        public void InitializeShippingOptions(IEnumerable <ShippingOption> shippingOptions)
        {
            if (shippingOptions == null)
            {
                return;
            }

            var shippingOptionList = new List <ShippingOptionApiModel>();

            foreach (var shippingOption in shippingOptions)
            {
                var jsonResult = new ShippingOptionApiModel();

                jsonResult.Initialize(shippingOption);
                shippingOptionList.Add(jsonResult);
            }

            OrderShippingOptions = shippingOptionList;
        }
        public void Initialize(LineShippingOption lineShippingOption)
        {
            if (lineShippingOption == null)
            {
                return;
            }

            LineId = lineShippingOption.LineId;

            var shippingOptionList = new List <ShippingOptionApiModel>();

            if (lineShippingOption.ShippingOptions != null)
            {
                foreach (var shippingOption in lineShippingOption.ShippingOptions)
                {
                    var jsonResult = new ShippingOptionApiModel();

                    jsonResult.Initialize(shippingOption);
                    shippingOptionList.Add(jsonResult);
                }
            }

            ShippingOptions = shippingOptionList;
        }