Esempio n. 1
0
 public Product(Internal.F2EProductItem item)
     : this()
 {
     this.Id   = item.Id;
     this.Name = item.Name;
     //Workaround for legacy product name.
     this.ProductType = EnumExtensionMethods.ConvertToSdkProdType(item.ProductType);
     //Convert Enums
     try { this.ProductState = (ProductState)Enum.Parse(typeof(ProductState), item.ProductState); }
     catch { this.ProductState = ProductState.OK; }
     this.InboundNumber = item.InboundNumber;
     try { this.TimeZone = (TimeZoneName)Enum.Parse(typeof(TimeZoneName), item.TimeZone); }
     catch { }
     this.CurrentBillingPeriodStart = item.CurrentBillingPeriodStart;
     this.CurrentBillingPeriodEnd   = item.CurrentBillingPeriodEnd;
     this.PeriodicQuantity          = item.PeriodicQuantity;
     this.QuantityInbound           = item.QuantityInbound;
     this.QuantityOutbound          = item.QuantityOutbound;
     this.FreeTrialEnd = item.FreeTrialEnd;
 }
Esempio n. 2
0
        internal Product(Internal.ProductItem item) : this()
        {
            this.Id   = item.Id;
            this.Name = item.Name;
            //Workaround for legacy product name.
            this.ProductType = EnumExtensionMethods.ConvertToSdkProdType(item.ProductType);

            this.Detail = item.Detail;

            this.InboundCSID   = item.InboundCSID;
            this.InboundNumber = item.InboundNumber;
            this.OutboundCSID  = item.OutboundCSID;
            this.OutboundANI   = item.OutboundANI;

            this.FaxHeader = item.FaxHeader;

            try { this.ProductState = (ProductState)Enum.Parse(typeof(ProductState), item.ProductState); }
            catch { this.ProductState = ProductState.OK; }

            try { this.TimeZone = (TimeZoneName)Enum.Parse(typeof(TimeZoneName), item.TimeZone); }
            catch { }
        }