﻿<classes>
<<|FOREACH(ModelClasses):
  <class name="Entity" assembly="FireStarterModeller.BO" displayName="<<|=DisplayName|>>" table="<<|=TableName|>>" typeParameter="<<|=ClassName|>>" >
	 <<|IF(HasSuperClass):
		<superClass class="<<|=SuperClassName|>>" assembly="<<|=SuperClassAssemblyName|>>" 
			orMapping="<<|=InheritanceType|>>" discriminator="<<|=SuperClassDiscriminator|>>"
		  <<|IF(SuperClassDefIDIsNotNullOrEmpty): id="<<|=SuperClassChildID|>>" |>> />
	 |>>
	<<|FOREACH(Properties):
    <property name="<<|=PropertyName|>>" type="<<|=PropertyType.PropertyTypeName|>>" assembly="<<|=PropertyType.AssemblyName|>>" 
     displayName="<<|=DisplayName|>>" readWriteRule="<<|=ReadWriteRule|>>" databaseField="<<|=DatabaseField|>>"
     <<|IF(!DefaultValue EQUALS NULL): default="<<|=DefaultValue|>>" |>> description="<<|=Description|>>" 
     <<|IF(IsCompulsory): compulsory="true" |>>
     <<|IF(AutoIncrementing): autoIncrementing="true" |>> 
     <<|IF(HasLength): length="<<|=Length|>>" |>>
     <<|IF(KeepValuePrivate): keepValuePrivate="true" |>>
    >
		<<|IF(!DefaultPropRule EQUALS NULL):
		<rule name="<<|=DefaultPropRule.PropRuleName|>>" class="<<|=DefaultPropRule.Class|>>" assembly="<<|=DefaultPropRule.Assembly|>>" message="<<|=DefaultPropRule.Message|>>">
			<<|FOREACH(DefaultPropRule.PropRuleParameters): <add key="<<|=KeyName|>>" value="<<|=Value|>>" /> |>>
		</rule>
		|>>
	</property>
    |>>
    <<|FOREACH(UniqueConstraints):
		<key name="<<|=KeyName|>>" <<|IF(IgnoreIfNull): ignoreIfNull="true" |>> message="<<|=Message|>>" >
		<<|FOREACH(KeyProperties):
			<prop name="<<|=PropertyName|>>" />			
		|>>
		</key>
	|>>
    <primaryKey <<|IF(!ObjectIdentity.IsObjectID): isObjectID="false" |>> >
	  <<|FOREACH(PrimaryKeyProperties):
      <prop name="<<|=PropertyName|>>" />
      |>>
    </primaryKey>
     <<|FOREACH(Relationships):
     <relationship name="<<|=RelationshipName|>>" type="<<|IF(IsMultiple):multiple|>><<|IF(!IsMultiple):single|>>"  
     relatedClass="Entity" relatedAssembly="FireStarterModeller.BO" typeParameter="<<|=RelatedClass|>>" 
     relationshipType="<<|=RelationshipType|>>"
     deleteAction="<<|=DeleteParentAction|>>" <<|IF(IsMultiple):orderBy="<<|=OrderBy|>>"|>>
     >
      <relatedProperty property="<<|=PropertyName|>>" relatedProperty="<<|=RelatedPropertyName|>>" />
    </relationship>
    |>>
    <<|FOREACH(UIViews):
	<ui name="<<|=ViewName|>>">
		<<|IF(!UIGridInfo EQUALS NULL): 
		<grid <<|IF(!UIGridInfo.SortColumn EQUALS NULL): sortColumn="<<|=UIGridInfo.SortColumn|>>" |>> >
		  <<|IF(!UIGridInfo.UIGridFilter EQUALS NULL): 
		   <filter filterMode="<<|=UIGridInfo.UIGridFilter.FilterMode|>>">
			<<|FOREACH(UIGridInfo.UIGridFilter.UIGridFilterProps):
			  <filterProperty name="<<|=PropertyName|>>" 
			  <<|IF(!LabelText EQUALS NULL):label="<<|=LabelText|>>"|>> 
			  <<|IF(!UIGridFilterType EQUALS NULL):filterType="<<|=UIGridFilterType.TypeName|>>"|>> 
			  <<|IF(!UIGridFilterType EQUALS NULL):filterTypeAssembly="<<|=UIGridFilterType.AssemblyName|>>"|>> 
			  <<|IF(!FilterClauseOp EQUALS NULL):operator="<<|=FilterClauseOp|>>" |>> >
			   <<|FOREACH(UIParameters):
				<parameter name="<<|=Name|>>" value="<<|=Value|>>"/>
			   |>>
			   </filterProperty>
			   |>>
			  </filter>
		  |>>
		  <<|FOREACH(UIGridInfo.UIColumns):
		   <column <<|IF(!Heading EQUALS NULL):heading="<<|=Heading|>>" |>> property="<<|=Property.PropertyName|>>" <<|IF(!UIGridColumnControlType EQUALS NULL):type="<<|=UIGridColumnControlType.TypeName|>>"|>> <<|IF(!UIGridColumnControlType EQUALS NULL):assembly="<<|=UIGridColumnControlType.AssemblyName|>>"|>> editable="<<|IF(Editable):true|>><<|IF(!Editable):false|>>" width="<<|=Width|>>">
		     <<|FOREACH(UIParameters):
				<parameter name="<<|=Name|>>" value="<<|=Value|>>"/>
			 |>>
		   </column>
		  |>>
		</grid>
		|>>
		<<|IF(!UIFormInfo EQUALS NULL):
		 <form width="<<|=UIFormInfo.Width|>>" height="<<|=UIFormInfo.Height|>>" title="<<|=UIFormInfo.Title|>>">
		  <<|FOREACH(UIFormInfo.UITabs):
		    <tab name="<<|=Name|>>">
		       <<|FOREACH(UIColumnLayouts):
		         <columnLayout width="<<|=Width|>>">
		           <<|FOREACH(UIFields):
						<field label="<<|=LabelText|>>"	property="<<|=PropertyOrRelationshipName|>>" <<|IF(!UIControlType EQUALS NULL):type="<<|=UIControlType.TypeName|>>"|>> <<|IF(!UIControlType EQUALS NULL):assembly="<<|=UIControlType.AssemblyName|>>"|>> <<|IF(!UIControlMapperType EQUALS NULL):mapperType="<<|=UIControlMapperType.TypeName|>>"|>> <<|IF(!UIControlMapperType EQUALS NULL):mapperAssembly="<<|=UIControlMapperType.AssemblyName|>>"|>> editable="<<|IF(Editable):true|>><<|IF(!Editable):false|>>" toolTipText="<<|=ToolTipText|>>">
						    <<|FOREACH(UIParameters):
								<parameter name="<<|=Name|>>" value="<<|=Value|>>"/>
							|>>
						</field>
					|>>
					</columnLayout>
				|>>
				</tab>
			|>>
		</form>
		|>>
	</ui>
	|>>
   </class>
|>>
</classes>