public static webModel.Shipment ToWebModel(this coreModel.Shipment shipment)
		{
			var retVal = new webModel.Shipment();
			retVal.InjectFrom(shipment);


			if (shipment.DeliveryAddress != null)
				retVal.DeliveryAddress = shipment.DeliveryAddress.ToWebModel();

			if (shipment.InPayments != null)
				retVal.InPayments = shipment.InPayments.Select(x => x.ToWebModel()).ToList();

			if(shipment.Items != null)
				retVal.Items = shipment.Items.Select(x => x.ToWebModel()).ToList();

			if (shipment.Packages != null)
				retVal.Packages = shipment.Packages.Select(x => x.ToWebModel()).ToList();

			if (shipment.Discount != null)
			{
				retVal.Discount = shipment.Discount.ToWebModel();
				retVal.DiscountAmount = shipment.Discount.DiscountAmount;
			}

			retVal.ChildrenOperations = shipment.ChildrenOperations.Select(x => x.ToWebModel()).ToList();
			retVal.TaxDetails = shipment.TaxDetails;

			if (shipment.DynamicProperties != null)
				retVal.DynamicProperties = shipment.DynamicProperties;

			return retVal;
		}
예제 #2
0
        public static webModel.Shipment ToWebModel(this coreModel.Shipment shipment)
        {
            var retVal = new webModel.Shipment();

            retVal.InjectFrom(shipment);


            if (shipment.DeliveryAddress != null)
            {
                retVal.DeliveryAddress = shipment.DeliveryAddress.ToWebModel();
            }

            if (shipment.InPayments != null)
            {
                retVal.InPayments = shipment.InPayments.Select(x => x.ToWebModel()).ToList();
            }

            if (shipment.Items != null)
            {
                retVal.Items = shipment.Items.Select(x => x.ToWebModel()).ToList();
            }

            if (shipment.Packages != null)
            {
                retVal.Packages = shipment.Packages.Select(x => x.ToWebModel()).ToList();
            }

            if (shipment.Discount != null)
            {
                retVal.Discount       = shipment.Discount.ToWebModel();
                retVal.DiscountAmount = shipment.Discount.DiscountAmount;
            }

            //Populate shipment method for shipment
            retVal.ShippingMethod                   = new webModel.ShippingMethod();
            retVal.ShippingMethod.Code              = shipment.ShipmentMethodCode;
            retVal.ShippingMethod.Description       = shipment.ShipmentMethodCode;
            retVal.ShippingMethod.OptionDescription = shipment.ShipmentMethodOption;
            retVal.ShippingMethod.OptionName        = shipment.ShipmentMethodOption;

            if (shipment.ShippingMethod != null)
            {
                retVal.ShippingMethod = shipment.ShippingMethod.ToWebModel();
            }

            retVal.ChildrenOperations = shipment.GetFlatObjectsListWithInterface <coreModel.IOperation>().Except(new[] { shipment }).Select(x => x.ToWebModel()).ToList();

            retVal.TaxDetails = shipment.TaxDetails;

            if (shipment.DynamicProperties != null)
            {
                retVal.DynamicProperties = shipment.DynamicProperties;
            }

            return(retVal);
        }
예제 #3
0
		public static webModel.Shipment ToWebModel(this coreModel.Shipment shipment)
		{
			var retVal = new webModel.Shipment();
			retVal.InjectFrom(shipment);


			if (shipment.DeliveryAddress != null)
				retVal.DeliveryAddress = shipment.DeliveryAddress.ToWebModel();

			if (shipment.InPayments != null)
				retVal.InPayments = shipment.InPayments.Select(x => x.ToWebModel()).ToList();

			if(shipment.Items != null)
				retVal.Items = shipment.Items.Select(x => x.ToWebModel()).ToList();

			if (shipment.Packages != null)
				retVal.Packages = shipment.Packages.Select(x => x.ToWebModel()).ToList();

			if (shipment.Discount != null)
			{
				retVal.Discount = shipment.Discount.ToWebModel();
				retVal.DiscountAmount = shipment.Discount.DiscountAmount;
			}

            //Populate shipment method for shipment
            retVal.ShippingMethod = new webModel.ShippingMethod();
            retVal.ShippingMethod.Code = shipment.ShipmentMethodCode;
            retVal.ShippingMethod.Description = shipment.ShipmentMethodCode;
            retVal.ShippingMethod.OptionDescription = shipment.ShipmentMethodOption;
            retVal.ShippingMethod.OptionName = shipment.ShipmentMethodOption;

            if (shipment.ShippingMethod != null)
            {
                retVal.ShippingMethod = shipment.ShippingMethod.ToWebModel();
            }

            retVal.ChildrenOperations = shipment.GetFlatObjectsListWithInterface<coreModel.IOperation>().Except(new[] { shipment }).Select(x => x.ToWebModel()).ToList();

			retVal.TaxDetails = shipment.TaxDetails;

			if (shipment.DynamicProperties != null)
				retVal.DynamicProperties = shipment.DynamicProperties;

			return retVal;
		}
예제 #4
0
        public static webModel.Shipment ToWebModel(this coreModel.Shipment shipment)
        {
            var retVal = new webModel.Shipment();

            retVal.InjectFrom(shipment);


            if (shipment.DeliveryAddress != null)
            {
                retVal.DeliveryAddress = shipment.DeliveryAddress.ToWebModel();
            }

            if (shipment.InPayments != null)
            {
                retVal.InPayments = shipment.InPayments.Select(x => x.ToWebModel()).ToList();
            }

            if (shipment.Items != null)
            {
                retVal.Items = shipment.Items.Select(x => x.ToWebModel()).ToList();
            }

            if (shipment.Packages != null)
            {
                retVal.Packages = shipment.Packages.Select(x => x.ToWebModel()).ToList();
            }

            if (shipment.Discount != null)
            {
                retVal.Discount       = shipment.Discount.ToWebModel();
                retVal.DiscountAmount = shipment.Discount.DiscountAmount;
            }

            retVal.ChildrenOperations = shipment.GetFlatObjectsListWithInterface <coreModel.IOperation>().Except(new[] { shipment }).Select(x => x.ToWebModel()).ToList();

            retVal.TaxDetails = shipment.TaxDetails;

            if (shipment.DynamicProperties != null)
            {
                retVal.DynamicProperties = shipment.DynamicProperties;
            }

            return(retVal);
        }
예제 #5
0
        public static webModel.Shipment ToWebModel(this coreModel.Shipment shipment)
        {
            var retVal = new webModel.Shipment();

            retVal.InjectFrom(shipment);

            retVal.Organization      = retVal.OrganizationId;
            retVal.FulfillmentCenter = retVal.FulfillmentCenterId;
            retVal.Employee          = retVal.EmployeeId;



            if (shipment.Properties != null)
            {
                retVal.Properties = shipment.Properties.Select(x => x.ToWebModel()).ToList();
            }

            if (shipment.DeliveryAddress != null)
            {
                retVal.DeliveryAddress = shipment.DeliveryAddress.ToWebModel();
            }

            if (shipment.InPayments != null)
            {
                retVal.InPayments = shipment.InPayments.Select(x => x.ToWebModel()).ToList();
            }

            if (shipment.Items != null)
            {
                retVal.Items = shipment.Items.Select(x => x.ToWebModel()).ToList();
            }

            if (shipment.Discount != null)
            {
                retVal.Discount       = shipment.Discount.ToWebModel();
                retVal.DiscountAmount = shipment.Discount.DiscountAmount;
            }

            retVal.ChildrenOperations = shipment.ChildrenOperations.Select(x => x.ToWebModel()).ToList();
            retVal.TaxDetails         = shipment.TaxDetails;
            return(retVal);
        }