//-----------------------------------------------------------------------------------------------------
        public FileAnalysis Func_X12_300_GLO_CWO_XUS_SHP(
            string filename,
            string errorOut,
            string validOut,
            string processOut = "")
        {
            this.FileStatus = new FileAnalysis();
            if (File.Exists(filename))
            {
                var ediInt = Interchange.LoadFrom(File.OpenRead(filename));
                var xmlInt = new UniversalInterchange();
                if (ediInt.Groups != null)
                {
                    for (var g = 0; g < ediInt.Groups.Count; g++)
                    {
                        xmlInt.Header = new UniversalInterchangeHeader
                        {
                            SenderID = ediInt.Groups[g].Gs.D_142_2,
                            RecipientID = ediInt.Groups[g].Gs.D_124_3
                        };
                        xmlInt.Body = new UniversalInterchangeBody
                        {
                            UniversalShipment =
                                new UniversalShipmentData {version = "1.1"}
                        };
                        for (var m = 0; m < ediInt.Groups[g].Messages.Count; m++)
                        {
                            if (ediInt.Groups[g].Messages[m].Context.Tag == "300")
                            {
                                try
                                {
                                    var xmlMsg = ediInt.Serialize();
                                    var objMsg = ediInt.Groups[g].Messages[m].DeserializeItem<M_300>();
                                    var xmlDoc = new XmlDocument();
                                    xmlDoc.LoadXml(xmlMsg.ToString());
                                    var nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);
                                    nsmgr.AddNamespace("ns", "www.edifabric.com/x12");
                                    var objShp = new Shipment
                                    {
                                        AdditionalTerms = string.Empty,
                                        AgentsReference = string.Empty,
                                        AWBServiceLevel =
                                            new CodeDescriptionPair
                                            {
                                                Code = string.Empty,
                                                Description = string.Empty
                                            },
                                        CartageWaybillNumber = string.Empty,
                                        CFSReference = string.Empty,
                                        FirstBuyerContact = string.Empty,
                                        Folio = string.Empty,
                                        OwnerRef = string.Empty,
                                        QuoteNumber = string.Empty,
                                        SecondBuyerContact = string.Empty,
                                        VesselName = string.Empty,
                                        VoyageFlightNo = string.Empty,
                                        WarehouseLocation = string.Empty,
                                        DataContext =
                                            new DataContext
                                            {
                                                DataSourceCollection =
                                                    new List<DataSource>
                                                    {
                                                        new DataSource
                                                        {
                                                            Type
                                                                =
                                                                "ForwardingBooking",
                                                            Key
                                                                =
                                                                string
                                                                    .Empty
                                                        }
                                                    },
                                                DataTargetCollection =
                                                    new List<DataTarget>
                                                    {
                                                        new DataTarget
                                                        {
                                                            Type
                                                                =
                                                                "ForwardingBooking"
                                                        }
                                                    },
                                                ActionPurpose =
                                                    new CodeDescriptionPair
                                                    {
                                                        Code
                                                            =
                                                            "APP",
                                                        Description
                                                            =
                                                            "As Per Payload"
                                                    },
                                                Company =
                                                    new Company
                                                    {
                                                        Code = "JFK",
                                                        Country =
                                                            new Country
                                                            {
                                                                Code
                                                                    =
                                                                    "US",
                                                                Name
                                                                    =
                                                                    "United States"
                                                            },
                                                        Name =
                                                            "Walker International Transportation LLC"
                                                    },
                                                DataProvider = "X12300GLO",
                                                EnterpriseID = "WLT",
                                                EventBranch =
                                                    new Branch
                                                    {
                                                        Code = "JFK",
                                                        Name =
                                                            "USJFK - Valley Stream, NY"
                                                    },
                                                EventDepartment =
                                                    new Department
                                                    {
                                                        Code =
                                                            "FES",
                                                        Name =
                                                            "Forwarding Export Sea"
                                                    },
                                                EventType =
                                                    new CodeDescriptionPair
                                                    {
                                                        Code
                                                            =
                                                            "ADD"
                                                    },
                                                EventUser =
                                                    new Staff
                                                    {
                                                        Code = "JSM",
                                                        Name =
                                                            "Jerry S. Mabasa"
                                                    },
                                                ServerID = "JNJ",
                                                CodesMappedToTarget = true,
                                                CodesMappedToTargetSpecified =
                                                    true
                                            },
                                        ActualChargeable = 0M,
                                        ActualChargeableSpecified = true,
                                        BookingConfirmationReference = string.Empty,
                                        IsBooking = true,
                                        IsBookingSpecified = true,
                                        ContainerCount = 0,
                                        ContainerCountSpecified = true,
                                        ContainerMode = new ContainerMode(),
                                        FreightRate = 0M,
                                        FreightRateSpecified = true,
                                        FreightRateCurrency =
                                            new Currency
                                            {
                                                Code = "USD",
                                                Description = "United States Dollar"
                                            },
                                        GoodsDescription = string.Empty,
                                        GoodsValue = 0M,
                                        GoodsValueCurrency =
                                            new Currency
                                            {
                                                Code = "USD",
                                                Description = "United States Dollar"
                                            },
                                        HBLAWBChargesDisplay =
                                            new CodeDescriptionPair
                                            {
                                                Code = "SHW",
                                                Description =
                                                    "Show Collect Charges"
                                            },
                                        InsuranceValue = 0M,
                                        InsuranceValueCurrency =
                                            new Currency
                                            {
                                                Code = "USD",
                                                Description = "United States Dollar"
                                            },
                                        InterimReceiptNumber = string.Empty,
                                        IsDirectBooking = false,
                                        IsForwardRegistered = false,
                                        IsNeutralMaster = new IsNeutralMaster {Value = false},
                                        JobCosting =
                                            new ShipmentJobCosting
                                            {
                                                Branch =
                                                    new Branch
                                                    {
                                                        Code =
                                                            "JFK",
                                                        Name =
                                                            "USJFK - Valley Stream, NY"
                                                    },
                                                Currency =
                                                    new Currency
                                                    {
                                                        Code
                                                            =
                                                            "USD",
                                                        Description
                                                            =
                                                            "United States Dollar"
                                                    },
                                                Department =
                                                    new Department
                                                    {
                                                        Code
                                                            =
                                                            "FES",
                                                        Name
                                                            =
                                                            "Forwarding Export Sea"
                                                    },
                                                HomeBranch =
                                                    new Branch
                                                    {
                                                        Code =
                                                            "JFK",
                                                        Name =
                                                            "USJFK - Valley Stream, NY"
                                                    },
                                                OperationsStaff =
                                                    new Staff
                                                    {
                                                        Code =
                                                            "JSM"
                                                    },
                                                AccrualNotRecognized = 0M,
                                                AccrualNotRecognizedSpecified
                                                    = true,
                                                AccrualRecognized = 0M,
                                                AccrualRecognizedSpecified
                                                    = true,
                                                AgentRevenue = 0M,
                                                AgentRevenueSpecified =
                                                    true,
                                                LocalClientRevenue = 0M,
                                                LocalClientRevenueSpecified
                                                    = true,
                                                OtherDebtorRevenue = 0M,
                                                OtherDebtorRevenueSpecified
                                                    = true,
                                                SalesStaff =
                                                    new Staff
                                                    {
                                                        Code =
                                                            "JSM",
                                                        Name =
                                                            "Jerry S. Mabasa"
                                                    },
                                                TotalAccrual = 0M,
                                                TotalAccrualSpecified =
                                                    true,
                                                TotalCost = 0M,
                                                TotalCostSpecified = true,
                                                TotalJobProfit = 0M,
                                                TotalJobProfitSpecified =
                                                    true,
                                                TotalRevenue = 0M,
                                                TotalRevenueSpecified =
                                                    true,
                                                TotalWIP = 0M,
                                                TotalWIPSpecified = true,
                                                WIPNotRecognized = 0M,
                                                WIPNotRecognizedSpecified
                                                    = true,
                                                WIPRecognized = 0M,
                                                WIPRecognizedSpecified =
                                                    true,
                                                ChargeLineCollection =
                                                    new List
                                                        <
                                                            ShipmentJobCostingChargeLine
                                                            >()
                                            },
                                        OuterPacks = 0,
                                        OuterPacksSpecified = true,
                                        OuterPacksPackageType =
                                            new PackageType
                                            {
                                                Code = "PCS",
                                                Description = "Pieces"
                                            },
                                        PackingOrder = 0,
                                        ReleaseType =
                                            new CodeDescriptionPair
                                            {
                                                Code = string.Empty,
                                                Description = string.Empty
                                            },
                                        ServiceLevel =
                                            new ServiceLevel
                                            {
                                                Code = string.Empty,
                                                Description = string.Empty
                                            },
                                        ShipmentIncoTerm =
                                            new IncoTerm
                                            {
                                                Code = string.Empty,
                                                Description = string.Empty
                                            },
                                        ShippedOnBoard =
                                            new CodeDescriptionPair
                                            {
                                                Code = string.Empty,
                                                Description = string.Empty
                                            },
                                        TotalVolume = 0M,
                                        TotalVolumeSpecified = true,
                                        TotalVolumeUnit =
                                            new UnitOfVolume
                                            {
                                                Code = "M3",
                                                Description = "Cubic Meters"
                                            },
                                        TotalWeight = 0M,
                                        TotalWeightUnit =
                                            new UnitOfWeight
                                            {
                                                Code = "KG",
                                                Description = "Kilograms"
                                            },
                                        TotalWeightSpecified = true,
                                        TransportMode =
                                            new CodeDescriptionPair
                                            {
                                                Code = "SEA",
                                                Description =
                                                    "Sea Freight"
                                            },
                                        WayBillNumber = string.Empty,
                                        WayBillType =
                                            new WayBillType
                                            {
                                                Code = "HWB",
                                                Description = "House Waybill"
                                            },
                                        LocalProcessing =
                                            new ShipmentLocalProcessing
                                            {
                                                DeliveryRequiredBy =
                                                    string.Empty,
                                                EstimatedDelivery =
                                                    string.Empty,
                                                EstimatedPickup =
                                                    string.Empty,
                                                FCLDeliveryEquipmentNeeded
                                                    =
                                                    new CodeDescriptionPair
                                                    {
                                                        Code
                                                            =
                                                            string
                                                                .Empty,
                                                        Description
                                                            =
                                                            string
                                                                .Empty
                                                    },
                                                FCLPickupEquipmentNeeded
                                                    =
                                                    new CodeDescriptionPair
                                                    {
                                                        Code
                                                            =
                                                            string
                                                                .Empty,
                                                        Description
                                                            =
                                                            string
                                                                .Empty
                                                    },
                                                InsuranceRequired =
                                                    false,
                                                PickupRequiredBy =
                                                    string.Empty,
                                                OrderNumberCollection
                                                    =
                                                    new List
                                                        <
                                                            ShipmentLocalProcessingOrderNumber
                                                            >()
                                            },
                                        ContainerCollection = new ShipmentContainerCollection(),
                                        PackingLineCollection = new List<PackingLine>(),
                                        DateCollection = new List<Date>(),
                                        OrganizationAddressCollection =
                                            new List<OrganizationAddress>(),
                                        NoteCollection = new List<Note>()
                                    };

                                    objShp.WayBillNumber = this.Func_XML_GetResultString(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:S_B1/ns:D_145_2");

                                    objShp.CFSReference = this.Func_XML_GetResultString(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:S_B1/ns:D_145_2");

                                    objShp.OwnerRef = objShp.WayBillNumber;

                                    objShp.BookingConfirmationReference = this.Func_XML_GetResultString(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:S_N9[ns:D_128_1='MB']/ns:D_127_2");

                                    var orgLOC = new OrganizationAddress
                                    {
                                        AddressType = "LocalClient",
                                        OrganizationCode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/ns:D_67_4"),
                                        CompanyName =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/ns:D_93_2"),
                                        Address1 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/parent::ns:G_N1/ns:S_N3/ns:D_166_1"),
                                        Address2 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/parent::ns:G_N1/ns:S_N3/ns:D_166_2"),
                                        City =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                        Postcode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/parent::ns:G_N1/ns:S_N4/ns:D_116_3"),
                                        State =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                        Country =
                                            new Country
                                            {
                                                Code =
                                                    Func_SQL_ConvertCountryISO3ToISO2
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            },
                                        Contact =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='BT']/parent::ns:G_N1_2/ns:S_G61_2[1]/ns:D_93_2"),
                                        Email =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='BT']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='EM']/ns:D_364_4"),
                                        Phone =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='BT']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='TE']/ns:D_364_4"),
                                        Port =
                                            new UNLOCO
                                            {
                                                Code =
                                                    this
                                                        .Func_SQL_GetPortCodeFromCityName
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='BT']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            }
                                    };

                                    objShp.OrganizationAddressCollection.Add(orgLOC);

                                    var orgCNR = new OrganizationAddress
                                    {
                                        AddressType = "ConsignorDocumentaryAddress",
                                        OrganizationCode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/ns:D_67_4"),
                                        CompanyName =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/ns:D_93_2"),
                                        Address1 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/parent::ns:G_N1/ns:S_N3/ns:D_166_1"),
                                        Address2 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/parent::ns:G_N1/ns:S_N3/ns:D_166_2"),
                                        City =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                        Postcode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/parent::ns:G_N1/ns:S_N4/ns:D_116_3"),
                                        State =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                        Country =
                                            new Country
                                            {
                                                Code =
                                                    Func_SQL_ConvertCountryISO3ToISO2
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            },
                                        Contact =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='SH']/parent::ns:G_N1_2/ns:S_G61_2[1]/ns:D_93_2"),
                                        Email =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='SH']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='EM']/ns:D_364_4"),
                                        Phone =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='SH']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='TE']/ns:D_364_4"),
                                        Port =
                                            new UNLOCO
                                            {
                                                Code =
                                                    this
                                                        .Func_SQL_GetPortCodeFromCityName
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SH']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            }
                                    };

                                    objShp.OrganizationAddressCollection.Add(orgCNR);

                                    //objShp.PortOfOrigin = new UNLOCO
                                    //{
                                    //    Code = this
                                    //       .Func_SQL_GetPortCodeFromCityName
                                    //       (
                                    //           this
                                    //       .Func_XML_GetResultString
                                    //       (
                                    //           xmlDoc,
                                    //           nsmgr,
                                    //           @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='R']/ns:D_310_3"),
                                    //           this
                                    //       .Func_XML_GetResultString
                                    //       (
                                    //           xmlDoc,
                                    //           nsmgr,
                                    //           @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='R']/ns:D_156_8"),
                                    //           this
                                    //       .Func_XML_GetResultString
                                    //       (
                                    //           xmlDoc,
                                    //           nsmgr,
                                    //           @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='R']/ns:D_26_5"))
                                    //};

                                    var orgCNRPck = new OrganizationAddress
                                    {
                                        AddressType =
                                            "ConsignorPickupDeliveryAddress",
                                        OrganizationCode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/ns:D_67_4"),
                                        CompanyName =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/ns:D_93_2"),
                                        Address1 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/parent::ns:G_N1/ns:S_N3/ns:D_166_1"),
                                        Address2 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/parent::ns:G_N1/ns:S_N3/ns:D_166_2"),
                                        City =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                        Postcode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/parent::ns:G_N1/ns:S_N4/ns:D_116_3"),
                                        State =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                        Country =
                                            new Country
                                            {
                                                Code =
                                                    Func_SQL_ConvertCountryISO3ToISO2
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            },
                                        Contact =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='SF']/parent::ns:G_N1_2/ns:S_G61_2[1]/ns:D_93_2"),
                                        Email =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='SF']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='EM']/ns:D_364_4"),
                                        Phone =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='SF']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='TE']/ns:D_364_4"),
                                        Port =
                                            new UNLOCO
                                            {
                                                Code =
                                                    this
                                                        .Func_SQL_GetPortCodeFromCityName
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='SF']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            }
                                    };
                                    objShp.OrganizationAddressCollection.Add(orgCNRPck);

                                    var orgCNE = new OrganizationAddress
                                    {
                                        AddressType = "ConsigneeDocumentaryAddress",
                                        OrganizationCode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/ns:D_67_4"),
                                        CompanyName =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/ns:D_93_2"),
                                        Address1 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/parent::ns:G_N1/ns:S_N3/ns:D_166_1"),
                                        Address2 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/parent::ns:G_N1/ns:S_N3/ns:D_166_2"),
                                        City =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                        Postcode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/parent::ns:G_N1/ns:S_N4/ns:D_116_3"),
                                        State =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                        Country =
                                            new Country
                                            {
                                                Code =
                                                    Func_SQL_ConvertCountryISO3ToISO2
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            },
                                        Contact =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='CN']/parent::ns:G_N1_2/ns:S_G61_2[1]/ns:D_93_2"),
                                        Email =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='CN']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='EM']/ns:D_364_4"),
                                        Phone =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='CN']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='TE']/ns:D_364_4"),
                                        Port =
                                            new UNLOCO
                                            {
                                                Code =
                                                    this
                                                        .Func_SQL_GetPortCodeFromCityName
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='CN']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            }
                                    };
                                    objShp.OrganizationAddressCollection.Add(orgCNE);

                                    //objShp.PortOfDischarge = new UNLOCO
                                    //{
                                    //    Code =
                                    //        this
                                    //        .Func_SQL_GetPortCodeFromCityName
                                    //        (
                                    //     this
                                    //        .Func_XML_GetResultString
                                    //        (
                                    //     xmlDoc,
                                    //     nsmgr,
                                    //     @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='ST']/parent::ns:G_N1_2/ns:S_N4_2/ns:D_19_1"),
                                    //     this
                                    //        .Func_XML_GetResultString
                                    //        (
                                    //     xmlDoc,
                                    //     nsmgr,
                                    //     @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='ST']/parent::ns:G_N1_2/ns:S_N4_2/ns:D_156_2"),
                                    //     this
                                    //        .Func_XML_GetResultString
                                    //        (
                                    //     xmlDoc,
                                    //     nsmgr,
                                    //     @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='ST']/parent::ns:G_N1_2/ns:S_N4_2/ns:D_26_4"))
                                    //};

                                    //objShp.PortOfDestination = new UNLOCO
                                    //{
                                    //    Code =
                                    //        this
                                    //        .Func_SQL_GetPortCodeFromCityName
                                    //        (
                                    //     this
                                    //        .Func_XML_GetResultString
                                    //        (
                                    //     xmlDoc,
                                    //     nsmgr,
                                    //     @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='ST']/parent::ns:G_N1_2/ns:S_N4_2/ns:D_19_1"),
                                    //     this
                                    //        .Func_XML_GetResultString
                                    //        (
                                    //     xmlDoc,
                                    //     nsmgr,
                                    //     @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='ST']/parent::ns:G_N1_2/ns:S_N4_2/ns:D_156_2"),
                                    //     this
                                    //        .Func_XML_GetResultString
                                    //        (
                                    //     xmlDoc,
                                    //     nsmgr,
                                    //     @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='ST']/parent::ns:G_N1_2/ns:S_N4_2/ns:D_26_4"))
                                    //};

                                    var orgCNEDlv = new OrganizationAddress
                                    {
                                        AddressType =
                                            "ConsigneePickupDeliveryAddress",
                                        OrganizationCode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/ns:D_67_4"),
                                        CompanyName =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/ns:D_93_2"),
                                        Address1 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/parent::ns:G_N1/ns:S_N3/ns:D_166_1"),
                                        Address2 =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/parent::ns:G_N1/ns:S_N3/ns:D_166_2"),
                                        City =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                        Postcode =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/parent::ns:G_N1/ns:S_N4/ns:D_116_3"),
                                        State =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                        Country =
                                            new Country
                                            {
                                                Code =
                                                    Func_SQL_ConvertCountryISO3ToISO2
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            },
                                        Contact =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='ST']/parent::ns:G_N1_2/ns:S_G61_2[1]/ns:D_93_2"),
                                        Email =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='ST']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='EM']/ns:D_364_4"),
                                        Phone =
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_204/ns:G_S5/ns:G_N1_2/ns:S_N1_2[ns:D_98_1='ST']/parent::ns:G_N1_2/ns:S_G61_2[ns:D_365_3='TE']/ns:D_364_4"),
                                        Port =
                                            new UNLOCO
                                            {
                                                Code =
                                                    this
                                                        .Func_SQL_GetPortCodeFromCityName
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/parent::ns:G_N1/ns:S_N4/ns:D_19_1"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/parent::ns:G_N1/ns:S_N4/ns:D_156_2"),
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_N1/ns:S_N1[ns:D_98_1='ST']/parent::ns:G_N1/ns:S_N4/ns:D_26_4")),
                                                Name = ""
                                            }
                                    };

                                    objShp.OrganizationAddressCollection.Add(orgCNEDlv);

                                    objShp.ServiceLevel.Code =
                                        this.Func_SQL_TranslateX12TariffServiceLevel(
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:S_Y1/ns:D_375_8"));

                                    if (this.Func_XML_GetResultString(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='R']/ns:D_309_2") == "AC")
                                    {
                                        objShp.PortOfOrigin = new UNLOCO
                                        {
                                            Code =
                                                this.Func_SQL_GetPortCodeFromCityName(
                                                    this.Func_XML_GetResultString(
                                                        xmlDoc,
                                                        nsmgr,
                                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='R']/ns:D_310_3"),
                                                    this.Func_XML_GetResultString(
                                                        xmlDoc,
                                                        nsmgr,
                                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='R']/ns:D_156_8"),
                                                    this.Func_XML_GetResultString(
                                                        xmlDoc,
                                                        nsmgr,
                                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='R']/ns:D_26_5"))
                                        };
                                    }
                                    else
                                    {
                                        objShp.PortOfOrigin = new UNLOCO
                                        {
                                            Code =
                                                this.Func_XML_GetResultString(
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='R']/ns:D_310_3")
                                        };
                                    }

                                    if (this.Func_XML_GetResultString(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='L']/ns:D_309_2") == "AC")
                                    {
                                        objShp.PortOfLoading = new UNLOCO
                                        {
                                            Code =
                                                this.Func_SQL_GetPortCodeFromCityName(
                                                    this.Func_XML_GetResultString(
                                                        xmlDoc,
                                                        nsmgr,
                                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='L']/ns:D_310_3"),
                                                    this.Func_XML_GetResultString(
                                                        xmlDoc,
                                                        nsmgr,
                                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='L']/ns:D_156_8"),
                                                    this.Func_XML_GetResultString(
                                                        xmlDoc,
                                                        nsmgr,
                                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='L']/ns:D_26_5"))
                                        };
                                    }
                                    else
                                    {
                                        objShp.PortOfLoading = new UNLOCO
                                        {
                                            Code =
                                                this.Func_XML_GetResultString(
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='L']/ns:D_310_3")
                                        };
                                    }

                                    if (this.Func_XML_GetResultString(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='D']/ns:D_309_2") == "AC")
                                    {
                                        objShp.PortOfDischarge = new UNLOCO
                                        {
                                            Code =
                                                this
                                                    .Func_SQL_GetPortCodeFromCityName(
                                                        this.Func_XML_GetResultString(
                                                            xmlDoc,
                                                            nsmgr,
                                                            @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='D']/ns:D_310_3"),
                                                        this.Func_XML_GetResultString(
                                                            xmlDoc,
                                                            nsmgr,
                                                            @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='D']/ns:D_156_8"),
                                                        this.Func_XML_GetResultString(
                                                            xmlDoc,
                                                            nsmgr,
                                                            @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='D']/ns:D_26_5"))
                                        };
                                    }
                                    else
                                    {
                                        objShp.PortOfDischarge = new UNLOCO
                                        {
                                            Code =
                                                this.Func_XML_GetResultString(
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='D']/ns:D_310_3")
                                        };
                                    }

                                    if (this.Func_XML_GetResultString(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='E']/ns:D_309_2") == "AC")
                                    {
                                        objShp.PortOfDestination = new UNLOCO
                                        {
                                            Code =
                                                this
                                                    .Func_SQL_GetPortCodeFromCityName(
                                                        this.Func_XML_GetResultString(
                                                            xmlDoc,
                                                            nsmgr,
                                                            @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='E']/ns:D_310_3"),
                                                        this.Func_XML_GetResultString(
                                                            xmlDoc,
                                                            nsmgr,
                                                            @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='E']/ns:D_156_8"),
                                                        this.Func_XML_GetResultString(
                                                            xmlDoc,
                                                            nsmgr,
                                                            @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='E']/ns:D_26_5"))
                                        };
                                    }
                                    else
                                    {
                                        objShp.PortOfDestination = new UNLOCO
                                        {
                                            Code =
                                                this.Func_XML_GetResultString(
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:G_R4/ns:S_R4[ns:D_115_1='E']/ns:D_310_3")
                                        };
                                    }

                                    if (string.IsNullOrEmpty(objShp.PortOfDestination.Code))
                                    {
                                        objShp.PortOfDestination = objShp.PortOfDischarge;
                                    }

                                    objShp.TotalWeight = this.Func_XML_GetResultIntNumber(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:G_LX/ns:S_L0/ns:D_81_4");
                                    objShp.TotalWeightUnit = new UnitOfWeight
                                    {
                                        Code =
                                            this
                                                .Func_SQL_TranslateX12_Weight_UoM(
                                                    this.Func_XML_GetResultString(
                                                        xmlDoc,
                                                        nsmgr,
                                                        @"//ns:M_300/ns:G_LX/ns:S_L0/ns:D_188_11"))
                                    };
                                    objShp.TotalWeightSpecified = true;

                                    objShp.DocumentedWeight = objShp.TotalWeight;
                                    objShp.DocumentedWeightSpecified = true;

                                    objShp.ManifestedWeight = objShp.TotalWeight;
                                    objShp.ManifestedWeightSpecified = true;

                                    objShp.TotalVolume = this.Func_XML_GetResultIntNumber(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:G_LX/ns:S_L0/ns:D_183_6");
                                    objShp.TotalVolumeUnit = new UnitOfVolume
                                    {
                                        Code =
                                            this
                                                .Func_SQL_TranslateX12_Volume_UoM(
                                                    this.Func_XML_GetResultString(
                                                        xmlDoc,
                                                        nsmgr,
                                                        @"//ns:M_300/ns:G_LX/ns:S_L0/ns:D_184_7"))
                                    };
                                    objShp.TotalVolumeSpecified = true;

                                    objShp.DocumentedVolume = objShp.TotalVolume;
                                    objShp.DocumentedVolumeSpecified = true;

                                    objShp.ManifestedVolume = objShp.TotalVolume;
                                    objShp.ManifestedVolumeSpecified = true;

                                    objShp.OuterPacks = this.Func_XML_GetResultIntNumber(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:G_LX/ns:S_L0/ns:D_80_8");
                                    objShp.OuterPacksPackageType = new PackageType
                                    {
                                        Code =
                                            Func_SQL_GetCWOPackageForm(
                                                this
                                                    .Func_XML_GetResultString(
                                                        xmlDoc,
                                                        nsmgr,
                                                        @"//ns:M_300/ns:G_LX/ns:S_L0/ns:D_211_9"))
                                    };
                                    objShp.OuterPacksSpecified = true;

                                    var packLine = new PackingLine
                                    {
                                        PackQty = objShp.OuterPacks,
                                        PackType =
                                            new PackageType
                                            {
                                                Code =
                                                    objShp
                                                        .OuterPacksPackageType
                                                        .Code,
                                                Description =
                                                    objShp
                                                        .OuterPacksPackageType
                                                        .Description
                                            },
                                        Weight = objShp.TotalWeight,
                                        WeightUnit = objShp.TotalWeightUnit,
                                        WeightSpecified = true,
                                        Volume = objShp.TotalVolume,
                                        VolumeUnit = objShp.TotalVolumeUnit,
                                        VolumeSpecified = true
                                    };
                                    objShp.PackingLineCollection.Add(packLine);

                                    var cntData = new ShipmentContainerCollectionContainer
                                    {
                                        AirVentFlow = 0,
                                        Commodity =
                                            new Commodity
                                            {
                                                Code
                                                    =
                                                    string
                                                        .Empty,
                                                Description
                                                    =
                                                    string
                                                        .Empty
                                            },
                                        ContainerType =
                                            new ShipmentContainerCollectionContainerContainerType
                                            {
                                                ISOCode
                                                    =
                                                    this
                                                        .Func_XML_GetResultString
                                                        (
                                                            xmlDoc,
                                                            nsmgr,
                                                            @"//ns:M_300/ns:G_Y2/ns:S_Y2/ns:D_24_4"),
                                                Code
                                                    =
                                                    Func_SQL_GetCWOContainerType
                                                        (
                                                            this
                                                                .Func_XML_GetResultString
                                                                (
                                                                    xmlDoc,
                                                                    nsmgr,
                                                                    @"//ns:M_300/ns:G_Y2/ns:S_Y2/ns:D_24_4"))
                                            }
                                    };
                                    cntData.ContainerCount = this.Func_XML_GetResultIntNumber(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:G_Y2/ns:S_Y2/ns:D_95_1");

                                    objShp.ContainerCollection.Container.Add(cntData);

                                    objShp.LocalProcessing.EstimatedPickup =
                                        this.Func_CON_ToISODate_ISO(
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_R4/ns:S_DTM[ns:D_374_1='118']/ns:D_373_2"),
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_R4/ns:S_DTM[ns:D_374_1='118']/ns:D_337_3"));
                                    objShp.LocalProcessing.PickupRequiredBy = objShp.LocalProcessing.EstimatedPickup;
                                    //this.Func_CON_ToISODate_ISO(
                                    //    this.Func_XML_GetResultString(
                                    //        xmlDoc,
                                    //        nsmgr,
                                    //        @"//ns:M_204/ns:G_S5/ns:S_G62_2[ns:D_176_3='K']/ns:D_373_2"),
                                    //    this.Func_XML_GetResultString(
                                    //        xmlDoc,
                                    //        nsmgr,
                                    //        @"//ns:M_204/ns:G_S5/ns:S_G62_2[ns:D_176_3='K']/ns:D_337_4"));
                                    objShp.LocalProcessing.EstimatedDelivery =
                                        this.Func_CON_ToISODate_ISO(
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_R4/ns:S_DTM[ns:D_374_1='371']/ns:D_373_2"),
                                            this.Func_XML_GetResultString(
                                                xmlDoc,
                                                nsmgr,
                                                @"//ns:M_300/ns:G_R4/ns:S_DTM[ns:D_374_1='371']/ns:D_337_3"));
                                    objShp.LocalProcessing.DeliveryRequiredBy = objShp.LocalProcessing.EstimatedDelivery;
                                    //this.Func_CON_ToISODate_ISO(
                                    //    this.Func_XML_GetResultString(
                                    //        xmlDoc,
                                    //        nsmgr,
                                    //        @"//ns:M_204/ns:G_S5/ns:S_G62_2[ns:D_176_3='L']/ns:D_373_2"),
                                    //    this.Func_XML_GetResultString(
                                    //        xmlDoc,
                                    //        nsmgr,
                                    //        @"//ns:M_204/ns:G_S5/ns:S_G62_2[ns:D_176_3='L']/ns:D_337_4"));

                                    var dteETD = new Date
                                    {
                                        Type = DateType.Departure,
                                        IsEstimate = true,
                                        IsEstimateSpecified = true,
                                        Value =
                                            this.Func_CON_ToISODate_ISO(
                                                this.Func_XML_GetResultString(
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:G_R4/ns:S_DTM[ns:D_374_1='010']/ns:D_373_2"),
                                                this.Func_XML_GetResultString(
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:G_R4/ns:S_DTM[ns:D_374_1='010']/ns:D_337_3"))
                                    };

                                    objShp.DateCollection.Add(dteETD);

                                    var dteETA = new Date
                                    {
                                        Type = DateType.Arrival,
                                        IsEstimate = true,
                                        IsEstimateSpecified = true,
                                        Value =
                                            this.Func_CON_ToISODate_ISO(
                                                this.Func_XML_GetResultString(
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:G_R4/ns:S_DTM[ns:D_374_1='371']/ns:D_373_2"),
                                                this.Func_XML_GetResultString(
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:G_R4/ns:S_DTM[ns:D_374_1='371']/ns:D_337_3"))
                                    };

                                    objShp.DateCollection.Add(dteETA);

                                    var dteBkd = new Date
                                    {
                                        Type = DateType.BookingConfirmed,
                                        IsEstimate = false,
                                        IsEstimateSpecified = true,
                                        Value =
                                            this.Func_CON_ToISODate_ISO(
                                                ediInt.Groups[g].Gs.D_29_4,
                                                ediInt.Groups[g].Gs.D_30_5)
                                        //this.Func_CON_ToISODate_ISO(this.Func_XML_GetResultString(xmlDoc, nsmgr, @"//ns:M_204/ns:S_G62/ns:D_373_2"), this.Func_XML_GetResultString(xmlDoc, nsmgr, @"//ns:M_204///ns:S_G62/ns:D_337_4"))
                                    };

                                    objShp.DateCollection.Add(dteBkd);

                                    var ordRef = new ShipmentLocalProcessingOrderNumber();
                                    ordRef.OrderReference = this.Func_XML_GetResultString(
                                        xmlDoc,
                                        nsmgr,
                                        @"//ns:M_300/ns:S_N9[ns:D_128_1='PO']/ns:D_127_2");

                                    objShp.LocalProcessing.OrderNumberCollection.Add(ordRef);

                                    var ucrRef = new ShipmentAdditionalReferenceCollectionAdditionalReference
                                    {
                                        Type =
                                        {
                                            Code
                                                =
                                                "UCR"
                                        },
                                        ReferenceNumber
                                            =
                                            this
                                                .Func_XML_GetResultString
                                                (
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:S_N9[ns:D_128_1='SI']/ns:D_127_2")
                                    };

                                    if (!string.IsNullOrEmpty(ucrRef.ReferenceNumber))
                                    {
                                        objShp.AdditionalReferenceCollection.AdditionalReference.Add(ucrRef);
                                    }

                                    var oagRef = new ShipmentAdditionalReferenceCollectionAdditionalReference
                                    {
                                        Type =
                                        {
                                            Code
                                                =
                                                "OAG"
                                        },
                                        ReferenceNumber
                                            =
                                            this
                                                .Func_XML_GetResultString
                                                (
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:S_N9[ns:D_128_1='CG']/ns:D_127_2")
                                    };

                                    if (!string.IsNullOrEmpty(oagRef.ReferenceNumber))
                                    {
                                        objShp.AdditionalReferenceCollection.AdditionalReference.Add(oagRef);
                                    }

                                    var bkgRefBn = new ShipmentAdditionalReferenceCollectionAdditionalReference
                                    {
                                        Type
                                            =
                                        {
                                            Code
                                                =
                                                "BKG"
                                        },
                                        ReferenceNumber
                                            =
                                            this
                                                .Func_XML_GetResultString
                                                (
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:S_N9[ns:D_128_1='BN']/ns:D_127_2")
                                    };

                                    if (!string.IsNullOrEmpty(bkgRefBn.ReferenceNumber))
                                    {
                                        objShp.AdditionalReferenceCollection.AdditionalReference.Add(bkgRefBn);
                                    }

                                    var bkgRefMb = new ShipmentAdditionalReferenceCollectionAdditionalReference
                                    {
                                        Type
                                            =
                                        {
                                            Code
                                                =
                                                "BKG"
                                        },
                                        ReferenceNumber
                                            =
                                            this
                                                .Func_XML_GetResultString
                                                (
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:S_N9[ns:D_128_1='MB']/ns:D_127_2")
                                    };

                                    if (!string.IsNullOrEmpty(bkgRefMb.ReferenceNumber))
                                    {
                                        objShp.AdditionalReferenceCollection.AdditionalReference.Add(bkgRefMb);
                                    }

                                    var bkgCon = new ShipmentAdditionalReferenceCollectionAdditionalReference
                                    {
                                        Type =
                                        {
                                            Code
                                                =
                                                "CON"
                                        },
                                        ReferenceNumber
                                            =
                                            this
                                                .Func_XML_GetResultString
                                                (
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:S_N9[ns:D_128_1='TS']/ns:D_127_2")
                                    };

                                    if (!string.IsNullOrEmpty(bkgCon.ReferenceNumber))
                                    {
                                        objShp.AdditionalReferenceCollection.AdditionalReference.Add(bkgCon);
                                    }

                                    var bkgLid = new ShipmentAdditionalReferenceCollectionAdditionalReference
                                    {
                                        Type =
                                        {
                                            Code
                                                =
                                                "LID"
                                        },
                                        ReferenceNumber
                                            =
                                            this
                                                .Func_XML_GetResultString
                                                (
                                                    xmlDoc,
                                                    nsmgr,
                                                    @"//ns:M_300/ns:S_N9[ns:D_128_1='OL']/ns:D_127_2")
                                    };

                                    if (!string.IsNullOrEmpty(bkgLid.ReferenceNumber))
                                    {
                                        objShp.AdditionalReferenceCollection.AdditionalReference.Add(bkgLid);
                                    }

                                    var ediList = this.Func_EDI_GetOriginalMessage(filename, '*', '~');
                                    if (ediList.Count > 0)
                                    {
                                        var ediNote = new Note
                                        {
                                            IsCustomDescription = true,
                                            Description = "Original EDI Message"
                                        };
                                        foreach (var item in ediList)
                                        {
                                            if (ediNote.NoteText == string.Empty)
                                            {
                                                ediNote.NoteText = item;
                                            }
                                            else
                                            {
                                                ediNote.NoteText = ediNote.NoteText + Environment.NewLine + item;
                                            }
                                        }
                                        objShp.NoteCollection.Add(ediNote);
                                    }

                                    //var ediAdd = new Note
                                    //{
                                    //    IsCustomDescription = true,
                                    //    Description = "Must Respond By"
                                    //};

                                    //ediAdd.NoteText = "Must Respond By: " + Func_CON_ToISODate_DTM(this.Func_XML_GetResultString(xmlDoc, nsmgr, @"//ns:M_204/ns:S_G62/ns:D_373_2 "), this.Func_XML_GetResultString(xmlDoc, nsmgr, @"//ns:M_204/ns:S_G62/ns:D_337_4"));

                                    //objShp.NoteCollection.Add(ediAdd);

                                    xmlInt.Body.UniversalShipment.Shipment = objShp;
                                }
                                catch (Exception exc)
                                {
                                    Debug.Print(exc.Message);
                                    throw;
                                }
                            }
                        }
                        xmlInt.Serialize();
                        xmlInt.SaveToFile(
                            string.Concat(validOut, "\\300_GLO_", Path.GetFileNameWithoutExtension(filename), ".xml"));
                        this.FileStatus.FileOutName = string.Concat(
                            validOut,
                            "\\300_GLO_",
                            Path.GetFileNameWithoutExtension(filename),
                            ".xml");
                        this.FileStatus.Status = true;
                        Func_File_Move(filename, string.Concat(processOut, "\\", Path.GetFileName(filename)));
                    }
                }
            }
            else
            {
                this.FileStatus.ExcpMessage = "Cannot Find: " + filename;
            }
            return this.FileStatus;
        }
 public static bool LoadFromFile(string fileName, out PackingLine obj)
 {
     Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
 public static bool Deserialize(string input, out PackingLine obj)
 {
     Exception exception = null;
     return Deserialize(input, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an PackingLine object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output PackingLine object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out PackingLine obj, out Exception exception)
 {
     exception = null;
     obj = default(PackingLine);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 /// <summary>
 /// Deserializes workflow markup into an PackingLine object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output PackingLine object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string input, out PackingLine obj, out Exception exception)
 {
     exception = null;
     obj = default(PackingLine);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }