Click here to Skip to main content
15,884,473 members
Articles / Programming Languages / C#

Roles, Role-Links and Parties Revisited Using a Simple MailOrder Processing System

Rate me:
Please Sign up or sign in to vote.
4.00/5 (2 votes)
6 Dec 2011CPOL3 min read 26.7K   308   2  
A simple mail order company case solved using Roles and Parties
namespace MailOrderSchema {
    using Microsoft.XLANGs.BaseTypes;
    
    
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.BizTalk.Schema.Compiler", "3.0.1.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [SchemaType(SchemaTypeEnum.Document)]
    [Schema(@"http://MailOrderSchema.MailOrder",@"MailOrder")]
    [Microsoft.XLANGs.BaseTypes.DistinguishedFieldAttribute(typeof(System.String), "ShippingZipCode", XPath = @"/*[local-name()='MailOrder' and namespace-uri()='http://MailOrderSchema.MailOrder']/*[local-name()='ShippingZipCode' and namespace-uri()='']", XsdType = @"string")]
    [Microsoft.XLANGs.BaseTypes.DistinguishedFieldAttribute(typeof(System.Int32), "ItemCount", XPath = @"/*[local-name()='MailOrder' and namespace-uri()='http://MailOrderSchema.MailOrder']/*[local-name()='ItemCount' and namespace-uri()='']", XsdType = @"int")]
    [Microsoft.XLANGs.BaseTypes.DistinguishedFieldAttribute(typeof(System.DateTime), "ShippingDate", XPath = @"/*[local-name()='MailOrder' and namespace-uri()='http://MailOrderSchema.MailOrder']/*[local-name()='ShippingDate' and namespace-uri()='']", XsdType = @"date")]
    [System.SerializableAttribute()]
    [SchemaRoots(new string[] {@"MailOrder"})]
    public sealed class MailOrder : Microsoft.XLANGs.BaseTypes.SchemaBase {
        
        [System.NonSerializedAttribute()]
        private static object _rawSchema;
        
        [System.NonSerializedAttribute()]
        private const string _strSchema = @"<?xml version=""1.0"" encoding=""utf-16""?>
<xs:schema xmlns=""http://MailOrderSchema.MailOrder"" xmlns:b=""http://schemas.microsoft.com/BizTalk/2003"" targetNamespace=""http://MailOrderSchema.MailOrder"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"">
  <xs:element name=""MailOrder"">
    <xs:annotation>
      <xs:appinfo>
        <b:properties>
          <b:property distinguished=""true"" xpath=""/*[local-name()='MailOrder' and namespace-uri()='http://MailOrderSchema.MailOrder']/*[local-name()='ShippingZipCode' and namespace-uri()='']"" />
          <b:property distinguished=""true"" xpath=""/*[local-name()='MailOrder' and namespace-uri()='http://MailOrderSchema.MailOrder']/*[local-name()='ItemCount' and namespace-uri()='']"" />
          <b:property distinguished=""true"" xpath=""/*[local-name()='MailOrder' and namespace-uri()='http://MailOrderSchema.MailOrder']/*[local-name()='ShippingDate' and namespace-uri()='']"" />
        </b:properties>
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name=""BillingAddress"">
          <xs:complexType>
            <xs:sequence>
              <xs:element name=""Street"" type=""xs:string"" />
              <xs:element name=""City"" type=""xs:string"" />
              <xs:element name=""State"" type=""xs:string"" />
              <xs:element name=""Zip"" type=""xs:string"" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name=""ShippingAddress"">
          <xs:complexType>
            <xs:sequence>
              <xs:element name=""Street"" type=""xs:string"" />
              <xs:element name=""City"" type=""xs:string"" />
              <xs:element name=""State"" type=""xs:string"" />
              <xs:element name=""Zip"" type=""xs:string"" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name=""ShippingZipCode"" type=""xs:string"" />
        <xs:element default=""1"" name=""ItemCount"" type=""xs:int"" />
        <xs:element default=""false"" name=""GiftWrap"" type=""xs:boolean"" />
        <xs:element default=""2011-11-11"" name=""ShippingDate"" type=""xs:date"" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>";
        
        public MailOrder() {
        }
        
        public override string XmlContent {
            get {
                return _strSchema;
            }
        }
        
        public override string[] RootNodes {
            get {
                string[] _RootElements = new string [1];
                _RootElements[0] = "MailOrder";
                return _RootElements;
            }
        }
        
        protected override object RawSchema {
            get {
                return _rawSchema;
            }
            set {
                _rawSchema = value;
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect AT&T Wi-Fi Services
United States United States
Naveen has done his Masters (M.S.) in Computer science, has started his career programming the mainframes and now has more than a decade of programming, development and design experience. Naveen has a sharp eye and keen observation skills. Naveen has worked for several companies and strived hard to build large scale business applications and bringing better solutions to the table.
Quite recently Naveen has built a fairly complex integration platform for a large bank. His hobbies include training, mentoring and research. Naveen spends his free time visiting National Parks nationwide.

Naveen has developed the BizTalk Control Center (BCC)
http://biztalkcontrolcenter.codeplex.com

Comments and Discussions