Ejemplo n.º 1
0
        public static Product ToProduct(this Internal.ProductItem obj)
        {
            if (obj == null)
            {
                return(null);
            }
            var ret = new Product(obj);

            return(ret);
        }
Ejemplo 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 { }
        }
Ejemplo n.º 3
0
        public static Internal.ProductItem ToProductItem(this Product obj)
        {
            if (obj == null)
            {
                return(null);
            }

            var ret = new Internal.ProductItem();

            ret.Id            = obj.Id;
            ret.Detail        = obj.Detail;
            ret.FaxHeader     = obj.FaxHeader;
            ret.InboundCSID   = obj.InboundCSID;
            ret.InboundNumber = obj.InboundNumber;
            ret.Name          = obj.Name;
            ret.OutboundANI   = obj.OutboundANI;
            ret.OutboundCSID  = obj.OutboundCSID;
            ret.ProductState  = obj.ProductState.ToString();
            ret.ProductType   = obj.ProductType.ConvertToPolkaProdString();
            ret.TimeZone      = obj.TimeZone.ToString();

            return(ret);
        }