Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommunicationPackage"/> class.
        /// </summary>
        /// <param name="xmlPackage">The XML package.</param>
        public CommunicationPackage(XElement xmlPackage)
        {
            XmlData    = new XmlTransferObject();
            XmlData.Id = new Guid(xmlPackage.Element("id").Value);
            XmlData.LocalTransactionId    = new Guid(xmlPackage.Element("localTransactionId").Value);
            XmlData.DeferredTransactionId = new Guid(xmlPackage.Element("deferredTransactionId").Value);
            XmlData.XmlType = xmlPackage.Element("type").Value;
            XmlData.Content = xmlPackage.Element("xml").FirstNode.ToString(SaveOptions.DisableFormatting);
            OrderNumber     = Int32.Parse(xmlPackage.Element("order").Value, CultureInfo.InvariantCulture);

            XElement departmentId = xmlPackage.Element("departmentId");

            if (departmentId != null)
            {
                DatabaseId = new Guid(departmentId.Value);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommunicationPackage"/> class from <see cref="XmlTransferObject"/> object.
 /// </summary>
 /// <param name="data">The data.</param>
 public CommunicationPackage(XmlTransferObject data)
 {
     XmlData = data;
 }