public USPSPackageIntl(XElement package) : base(package)
        {
            if (Error != null)
            {
                return;
            }

            Pounds     = package.GetValueOfXMLElement <int>("Pounds");
            Ounces     = package.GetValueOfXMLElement <int>("Ounces");
            Size       = package.GetValueOfXMLElement("Size");
            Machinable = package.GetValueOfXMLElement <bool>("Machinable");

            var id          = package.GetValueOfXMLAttribute <int>("ID");
            var rate        = package.GetValueOfXMLElement <decimal>("Postage");
            var serviceCode = package.GetValueOfXMLElement("SvcDescription");

            Postage.Add(new Postage(id, rate, serviceCode));
        }
예제 #2
0
        public USPSPackage(XElement package) : base(package)
        {
            if (Error != null)
            {
                return;
            }

            Pounds         = package.GetValueOfXMLElement <int>("Pounds");
            Ounces         = package.GetValueOfXMLElement <int>("Ounces");
            Size           = package.GetValueOfXMLElement("Size");
            Machinable     = package.GetValueOfXMLElement <bool>("Machinable");
            ZipDestination = package.GetValueOfXMLElement("ZipDestination");
            ZipOrigination = package.GetValueOfXMLElement("ZipOrigination");
            Zone           = package.GetValueOfXMLElement <int>("Zone");

            foreach (var item in package.Elements("Postage"))
            {
                Postage.Add(new Postage(item));
            }
        }