Exemple #1
0
        public static TransportationStatusType Create()
        {
            var doc = new TransportationStatusType
            {
                UBLVersionID = "2.1",
                ID           = "TS_1",
                IssueDate    = "2011-10-06",
                IssueTime    = "09:29:30+01:00",
                TransportationStatusTypeCode = "All deviations",
                TransportExecutionStatusCode = "35",
                Consignment = new ConsignmentType[]
                {
                    new ConsignmentType
                    {
                        ID = "CON_1",
                        TransportHandlingUnit = new TransportHandlingUnitType[]
                        {
                            new TransportHandlingUnitType
                            {
                                ID = "CON_THU_1",
                                TransportEquipment = new TransportEquipmentType[]
                                {
                                    new TransportEquipmentType
                                    {
                                        ID = "CON_TE_1"
                                    }
                                },
                                Status = new StatusType[]
                                {
                                    new StatusType
                                    {
                                        ConditionCode    = "4",
                                        StatusReasonCode = "23",
                                        StatusReason     = new TextType[]
                                        {
                                            new TextType
                                            {
                                                Value = "Reefer container lost power - cargo of fish destroyed"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                TransportExecutionPlanDocumentReference = new DocumentReferenceType
                {
                    ID = "TEP_1"
                }
            };

            doc.Xmlns = new System.Xml.Serialization.XmlSerializerNamespaces(new[]
            {
                new XmlQualifiedName("cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"),
                new XmlQualifiedName("cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"),
            });
            return(doc);
        }
        public static TransportationStatusType Create()
        {
            var doc = new TransportationStatusType
            {
                UBLExtensions = new List <UBLExtensionType>()
                {
                    new UBLExtensionType
                    {
                        ExtensionContent = @"<mec:Additional xmlns:mec=""urn:X-MyCompany:Extension"" xmlns:mac=""urn:X-MyCompany:Aggregate"" xmlns:mbc=""urn:X-MyCompany:Basic""><mac:QualificationLevel><cbc:ID xmlns:cbc=""urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"">L1</cbc:ID><cbc:Description xmlns:cbc=""urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"">Level 1</cbc:Description><mbc:LevelPrerequisite>Level0</mbc:LevelPrerequisite></mac:QualificationLevel><mac:ThirdPartyBilling><cac:Party xmlns:cac=""urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2""><cac:PartyName><cbc:Name xmlns:cbc=""urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"">Jane Doe</cbc:Name></cac:PartyName></cac:Party></mac:ThirdPartyBilling></mec:Additional>".ToXmlElement()
                    }
                },
                UBLVersionID    = "2.1",
                CustomizationID = "urn:X-demo:TransportShipments",
                ProfileID       = "urn:X-demo:CoreElement",
                ID          = "1234",
                IssueDate   = "2010-08-13",
                IssueTime   = "15:30:00.0Z",
                Description = new List <TextType>()
                {
                    new TextType
                    {
                        Value = "En route"
                    }
                },
                Consignment = new List <ConsignmentType>()
                {
                    new ConsignmentType
                    {
                        ID = "XYZ987",
                        SummaryDescription = new List <TextType>()
                        {
                            new TextType
                            {
                                Value = "Electronic components"
                            }
                        },
                    }
                },
                TransportEvent = new List <TransportEventType>()
                {
                    new TransportEventType
                    {
                        CurrentStatus = new List <StatusType>()
                        {
                            new StatusType
                            {
                                ConditionCode = "31",
                                Description   = new List <TextType>()
                                {
                                    new TextType
                                    {
                                        Value = "En route"
                                    }
                                },
                            }
                        },
                        Contact = new List <ContactType>()
                        {
                            new ContactType
                            {
                                Name           = "John Smith",
                                ElectronicMail = "*****@*****.**"
                            }
                        },
                    }
                },
            };

            doc.Xmlns = new System.Xml.Serialization.XmlSerializerNamespaces(new[]
            {
                new XmlQualifiedName("cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"),
                new XmlQualifiedName("cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"),
                new XmlQualifiedName("ext", "urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"),
            });
            return(doc);
        }