public PSDataBoxEdgeOrder(DataBoxEdgeOrder dataBoxEdgeOrder)
        {
            if (dataBoxEdgeOrder == null)
            {
                throw new ArgumentNullException("dataBoxEdgeOrder");
            }

            this.DataBoxEdgeOrder = dataBoxEdgeOrder;
            this.Id = dataBoxEdgeOrder.Id;
            var dataBoxEdgeResourceIdentifier = new DataBoxEdgeResourceIdentifier(dataBoxEdgeOrder.Id);

            this.ResourceGroupName = dataBoxEdgeResourceIdentifier.ResourceGroupName;
            this.DeviceName        = dataBoxEdgeResourceIdentifier.DeviceName;
            OrderHistory           = dataBoxEdgeOrder.OrderHistory.Select(t => new PSDataBoxEdgeOrderStatus(t)).ToList();
            ForwardTrackingInfo    = dataBoxEdgeOrder.DeliveryTrackingInfo
                                     .Select(t => new PSDataBoxEdgeOrderTrackingInfo(t)).ToList();
            ReturnTrackingInfo = dataBoxEdgeOrder.ReturnTrackingInfo.Select(t => new PSDataBoxEdgeOrderTrackingInfo(t))
                                 .ToList();
            ShippingAddress = dataBoxEdgeOrder.ShippingAddress;
        }
Exemplo n.º 2
0
        private PSResourceModel CreateResourceModel()
        {
            var contactDetails = new ContactDetails(ContactPerson, CompanyName, Phone, Email);
            var address        = new Address(AddressLine1, PostalCode, City, State, Country, AddressLine2, AddressLine3);

            if (this.IsParameterBound(c => c.AddressLine2))
            {
                address.AddressLine2 = this.AddressLine2;
            }

            if (this.IsParameterBound(c => c.AddressLine3))
            {
                address.AddressLine3 = this.AddressLine3;
            }

            var order           = new ResourceModel(contactDetails, address);
            var psResourceModel = new PSResourceModel(
                _operations.CreateOrUpdate(
                    this.DeviceName,
                    order,
                    this.ResourceGroupName));

            return(psResourceModel);
        }
 public PSDataBoxEdgeOrder()
 {
     DataBoxEdgeOrder = new DataBoxEdgeOrder();
 }