Upload to server

uploading
This commit is contained in:
2025-08-02 05:20:17 +07:00
commit a5eccbd452
984 changed files with 3031800 additions and 0 deletions

View File

@@ -0,0 +1,114 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
#if !CF
using System.Runtime.Serialization;
#endif
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Common base class which is the base class for all generated entities which aren't a subtype of another entity.</summary>
[Serializable]
public abstract partial class CommonEntityBase : EntityBase2
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
/// <summary>CTor</summary>
protected CommonEntityBase()
{
}
/// <summary> CTor</summary>
protected CommonEntityBase(string name):base(name)
{
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected CommonEntityBase(SerializationInfo info, StreamingContext context) : base(info, context)
{
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Gets the inheritance info provider instance of the project this entity instance is located in. </summary>
/// <returns>ready to use inheritance info provider instance.</returns>
protected override IInheritanceInfoProvider GetInheritanceInfoProvider()
{
return InheritanceInfoProviderSingleton.GetInstance();
}
/// <summary>Creates the ITypeDefaultValue instance used to provide default values for value types which aren't of type nullable(of T)</summary>
/// <returns></returns>
protected override ITypeDefaultValue CreateTypeDefaultValueProvider()
{
return new TypeDefaultValue();
}
/// <summary>Creates the entity collection and stores it in destination if destination is null</summary>
/// <typeparam name="T">type of the element to store in the collection</typeparam>
/// <typeparam name="TFactory">The type of the factory to pass to the entitycollection ctor.</typeparam>
/// <param name="navigatorName">Name of the property this collection is for.</param>
/// <param name="setContainingEntityInfo">if set to <see langword="true"/> the collection is for an 1:n relationship, and the containing entity info has to be set</param>
/// <param name="forMN">if set to <see langword="true"/> the collection is for an m:n relationship, otherwise for an 1:n relationship</param>
/// <param name="destination">The destination member variable.</param>
/// <returns>the collection referred to by destination if destination isn't null, otherwise the newly created collection (which is then stored in destination</returns>
protected EntityCollection<T> GetOrCreateEntityCollection<T, TFactory>(string navigatorName, bool setContainingEntityInfo, bool forMN, ref EntityCollection<T> destination)
where T:EntityBase2 , IEntity2
{
if(destination==null)
{
destination = new EntityCollection<T>(EntityFactoryCache2.GetEntityFactory(typeof(TFactory)));
if(forMN)
{
((IEntityCollectionCore)destination).IsForMN = true;
}
else
{
if(setContainingEntityInfo)
{
destination.SetContainingEntityInfo(this, navigatorName);
}
}
destination.ActiveContext = this.ActiveContext;
}
return destination;
}
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,455 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblAgeGroup'.<br/><br/></summary>
[Serializable]
public partial class TblAgeGroupEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblAgeGroupEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblAgeGroupEntity():base("TblAgeGroupEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblAgeGroupEntity(IEntityFields2 fields):base("TblAgeGroupEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblAgeGroupEntity</param>
public TblAgeGroupEntity(IValidator validator):base("TblAgeGroupEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="id">PK value for TblAgeGroup which data should be fetched into this TblAgeGroup object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblAgeGroupEntity(System.Int16 id):base("TblAgeGroupEntity")
{
InitClassEmpty(null, null);
this.Id = id;
}
/// <summary> CTor</summary>
/// <param name="id">PK value for TblAgeGroup which data should be fetched into this TblAgeGroup object</param>
/// <param name="validator">The custom validator object for this TblAgeGroupEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblAgeGroupEntity(System.Int16 id, IValidator validator):base("TblAgeGroupEntity")
{
InitClassEmpty(validator, null);
this.Id = id;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblAgeGroupEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary> Method which will construct a filter (predicate expression) for the unique constraint defined on the fields:
/// Age .</summary>
/// <returns>true if succeeded and the contents is read, false otherwise</returns>
public IPredicateExpression ConstructFilterForUCAge()
{
IPredicateExpression filter = new PredicateExpression();
filter.Add(Datalib.HelperClasses.TblAgeGroupFields.Age == this.Fields.GetCurrentValue((int)TblAgeGroupFieldIndex.Age));
return filter;
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblAgeGroupRelations().GetAllRelations();
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblAgeGroupEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Age", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Grp1", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Grp2", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Id", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblAgeGroupEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblAgeGroupRelations Relations
{
get { return new TblAgeGroupRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The Age property of the Entity TblAgeGroup<br/><br/></summary>
/// <remarks>Mapped on table field: "tblAgeGroup"."Age"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Age
{
get { return (Nullable<System.Int16>)GetValue((int)TblAgeGroupFieldIndex.Age, false); }
set { SetValue((int)TblAgeGroupFieldIndex.Age, value); }
}
/// <summary> The Grp1 property of the Entity TblAgeGroup<br/><br/></summary>
/// <remarks>Mapped on table field: "tblAgeGroup"."Grp1"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 10<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Grp1
{
get { return (System.String)GetValue((int)TblAgeGroupFieldIndex.Grp1, true); }
set { SetValue((int)TblAgeGroupFieldIndex.Grp1, value); }
}
/// <summary> The Grp2 property of the Entity TblAgeGroup<br/><br/></summary>
/// <remarks>Mapped on table field: "tblAgeGroup"."Grp2"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 10<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Grp2
{
get { return (System.String)GetValue((int)TblAgeGroupFieldIndex.Grp2, true); }
set { SetValue((int)TblAgeGroupFieldIndex.Grp2, value); }
}
/// <summary> The Id property of the Entity TblAgeGroup<br/><br/></summary>
/// <remarks>Mapped on table field: "tblAgeGroup"."ID"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.Int16 Id
{
get { return (System.Int16)GetValue((int)TblAgeGroupFieldIndex.Id, true); }
set { SetValue((int)TblAgeGroupFieldIndex.Id, value); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblAgeGroupEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,479 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblAgency'.<br/><br/></summary>
[Serializable]
public partial class TblAgencyEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private EntityCollection<TblReferraltoServiceEntity> _tblReferraltoServices;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblReferraltoServices</summary>
public static readonly string TblReferraltoServices = "TblReferraltoServices";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblAgencyEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblAgencyEntity():base("TblAgencyEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblAgencyEntity(IEntityFields2 fields):base("TblAgencyEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblAgencyEntity</param>
public TblAgencyEntity(IValidator validator):base("TblAgencyEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="agencyTypeId">PK value for TblAgency which data should be fetched into this TblAgency object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblAgencyEntity(System.String agencyTypeId):base("TblAgencyEntity")
{
InitClassEmpty(null, null);
this.AgencyTypeId = agencyTypeId;
}
/// <summary> CTor</summary>
/// <param name="agencyTypeId">PK value for TblAgency which data should be fetched into this TblAgency object</param>
/// <param name="validator">The custom validator object for this TblAgencyEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblAgencyEntity(System.String agencyTypeId, IValidator validator):base("TblAgencyEntity")
{
InitClassEmpty(validator, null);
this.AgencyTypeId = agencyTypeId;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblAgencyEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblReferraltoServices = (EntityCollection<TblReferraltoServiceEntity>)info.GetValue("_tblReferraltoServices", typeof(EntityCollection<TblReferraltoServiceEntity>));
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblReferraltoServices":
this.TblReferraltoServices.Add((TblReferraltoServiceEntity)entity);
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblReferraltoServices":
toReturn.Add(Relations.TblReferraltoServiceEntityUsingAgencyTypeId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblReferraltoServices":
this.TblReferraltoServices.Add((TblReferraltoServiceEntity)relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblReferraltoServices":
this.PerformRelatedEntityRemoval(this.TblReferraltoServices, relatedEntity, signalRelatedEntityManyToOne);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
toReturn.Add(this.TblReferraltoServices);
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblReferraltoServices", ((_tblReferraltoServices!=null) && (_tblReferraltoServices.Count>0) && !this.MarkedForDeletion)?_tblReferraltoServices:null);
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblAgencyRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblReferraltoService' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblReferraltoServices()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblReferraltoServiceFields.AgencyTypeId, null, ComparisonOperator.Equal, this.AgencyTypeId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblAgencyEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
collectionsQueue.Enqueue(this._tblReferraltoServices);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
this._tblReferraltoServices = (EntityCollection<TblReferraltoServiceEntity>) collectionsQueue.Dequeue();
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
toReturn |=(this._tblReferraltoServices != null);
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<TblReferraltoServiceEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblReferraltoServiceEntityFactory))) : null);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblReferraltoServices", _tblReferraltoServices);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("AgencyTypeId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("EAgencyTypeName", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("VAgencyTypeName", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblAgencyEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblAgencyRelations Relations
{
get { return new TblAgencyRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblReferraltoService' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblReferraltoServices
{
get { return new PrefetchPathElement2( new EntityCollection<TblReferraltoServiceEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblReferraltoServiceEntityFactory))), (IEntityRelation)GetRelationsForField("TblReferraltoServices")[0], (int)Datalib.EntityType.TblAgencyEntity, (int)Datalib.EntityType.TblReferraltoServiceEntity, 0, null, null, null, null, "TblReferraltoServices", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The AgencyTypeId property of the Entity TblAgency<br/><br/></summary>
/// <remarks>Mapped on table field: "tblAgency"."AgencyTypeID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String AgencyTypeId
{
get { return (System.String)GetValue((int)TblAgencyFieldIndex.AgencyTypeId, true); }
set { SetValue((int)TblAgencyFieldIndex.AgencyTypeId, value); }
}
/// <summary> The EAgencyTypeName property of the Entity TblAgency<br/><br/></summary>
/// <remarks>Mapped on table field: "tblAgency"."eAgencyTypeName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String EAgencyTypeName
{
get { return (System.String)GetValue((int)TblAgencyFieldIndex.EAgencyTypeName, true); }
set { SetValue((int)TblAgencyFieldIndex.EAgencyTypeName, value); }
}
/// <summary> The VAgencyTypeName property of the Entity TblAgency<br/><br/></summary>
/// <remarks>Mapped on table field: "tblAgency"."vAgencyTypeName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String VAgencyTypeName
{
get { return (System.String)GetValue((int)TblAgencyFieldIndex.VAgencyTypeName, true); }
set { SetValue((int)TblAgencyFieldIndex.VAgencyTypeName, value); }
}
/// <summary> Gets the EntityCollection with the related entities of type 'TblReferraltoServiceEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblReferraltoServiceEntity))]
public virtual EntityCollection<TblReferraltoServiceEntity> TblReferraltoServices
{
get { return GetOrCreateEntityCollection<TblReferraltoServiceEntity, TblReferraltoServiceEntityFactory>("TblAgency", true, false, ref _tblReferraltoServices); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblAgencyEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,661 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblChild'.<br/><br/></summary>
[Serializable]
public partial class TblChildEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblPregnanceInfoEntity _tblPregnanceInfo;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPregnanceInfo</summary>
public static readonly string TblPregnanceInfo = "TblPregnanceInfo";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblChildEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblChildEntity():base("TblChildEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblChildEntity(IEntityFields2 fields):base("TblChildEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblChildEntity</param>
public TblChildEntity(IValidator validator):base("TblChildEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblChild which data should be fetched into this TblChild object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblChildEntity(System.String uniqueKey):base("TblChildEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblChild which data should be fetched into this TblChild object</param>
/// <param name="validator">The custom validator object for this TblChildEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblChildEntity(System.String uniqueKey, IValidator validator):base("TblChildEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblChildEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblPregnanceInfo = (TblPregnanceInfoEntity)info.GetValue("_tblPregnanceInfo", typeof(TblPregnanceInfoEntity));
if(_tblPregnanceInfo!=null)
{
_tblPregnanceInfo.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblChildFieldIndex)fieldIndex)
{
case TblChildFieldIndex.PreganceId:
DesetupSyncTblPregnanceInfo(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPregnanceInfo":
this.TblPregnanceInfo = (TblPregnanceInfoEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPregnanceInfo":
toReturn.Add(Relations.TblPregnanceInfoEntityUsingPreganceId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPregnanceInfo":
SetupSyncTblPregnanceInfo(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPregnanceInfo":
DesetupSyncTblPregnanceInfo(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblPregnanceInfo!=null)
{
toReturn.Add(_tblPregnanceInfo);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblPregnanceInfo", (!this.MarkedForDeletion?_tblPregnanceInfo:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblChildRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPregnanceInfo' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPregnanceInfo()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPregnanceInfoFields.UniqueKey, null, ComparisonOperator.Equal, this.PreganceId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblChildEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPregnanceInfo", _tblPregnanceInfo);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ChildId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ChildName", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Ctxdate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("FeedingType", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Hiv18Date", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Hiv18Result", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Pcrcdate1", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Pcrcdate2", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Pcrresult1", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Pcrresult2", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PreganceId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Sex", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblPregnanceInfo</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPregnanceInfo(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPregnanceInfo, new PropertyChangedEventHandler( OnTblPregnanceInfoPropertyChanged ), "TblPregnanceInfo", Datalib.RelationClasses.StaticTblChildRelations.TblPregnanceInfoEntityUsingPreganceIdStatic, true, signalRelatedEntity, "TblChildren", resetFKFields, new int[] { (int)TblChildFieldIndex.PreganceId } );
_tblPregnanceInfo = null;
}
/// <summary> setups the sync logic for member _tblPregnanceInfo</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPregnanceInfo(IEntityCore relatedEntity)
{
if(_tblPregnanceInfo!=relatedEntity)
{
DesetupSyncTblPregnanceInfo(true, true);
_tblPregnanceInfo = (TblPregnanceInfoEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPregnanceInfo, new PropertyChangedEventHandler( OnTblPregnanceInfoPropertyChanged ), "TblPregnanceInfo", Datalib.RelationClasses.StaticTblChildRelations.TblPregnanceInfoEntityUsingPreganceIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPregnanceInfoPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblChildEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblChildRelations Relations
{
get { return new TblChildRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPregnanceInfo' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPregnanceInfo
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPregnanceInfoEntityFactory))), (IEntityRelation)GetRelationsForField("TblPregnanceInfo")[0], (int)Datalib.EntityType.TblChildEntity, (int)Datalib.EntityType.TblPregnanceInfoEntity, 0, null, null, null, null, "TblPregnanceInfo", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The ChildId property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."ChildId"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ChildId
{
get { return (System.String)GetValue((int)TblChildFieldIndex.ChildId, true); }
set { SetValue((int)TblChildFieldIndex.ChildId, value); }
}
/// <summary> The ChildName property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."ChildName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 25<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ChildName
{
get { return (System.String)GetValue((int)TblChildFieldIndex.ChildName, true); }
set { SetValue((int)TblChildFieldIndex.ChildName, value); }
}
/// <summary> The Ctxdate property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."CTXDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> Ctxdate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblChildFieldIndex.Ctxdate, false); }
set { SetValue((int)TblChildFieldIndex.Ctxdate, value); }
}
/// <summary> The FeedingType property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."FeedingType"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Int16 FeedingType
{
get { return (System.Int16)GetValue((int)TblChildFieldIndex.FeedingType, true); }
set { SetValue((int)TblChildFieldIndex.FeedingType, value); }
}
/// <summary> The Hiv18Date property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."HIV18Date"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> Hiv18Date
{
get { return (Nullable<System.DateTime>)GetValue((int)TblChildFieldIndex.Hiv18Date, false); }
set { SetValue((int)TblChildFieldIndex.Hiv18Date, value); }
}
/// <summary> The Hiv18Result property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."HIV18Result"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Hiv18Result
{
get { return (Nullable<System.Int16>)GetValue((int)TblChildFieldIndex.Hiv18Result, false); }
set { SetValue((int)TblChildFieldIndex.Hiv18Result, value); }
}
/// <summary> The Pcrcdate1 property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."PCRCDate1"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> Pcrcdate1
{
get { return (Nullable<System.DateTime>)GetValue((int)TblChildFieldIndex.Pcrcdate1, false); }
set { SetValue((int)TblChildFieldIndex.Pcrcdate1, value); }
}
/// <summary> The Pcrcdate2 property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."PCRCDate2"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> Pcrcdate2
{
get { return (Nullable<System.DateTime>)GetValue((int)TblChildFieldIndex.Pcrcdate2, false); }
set { SetValue((int)TblChildFieldIndex.Pcrcdate2, value); }
}
/// <summary> The Pcrresult1 property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."PCRResult1"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Pcrresult1
{
get { return (Nullable<System.Int16>)GetValue((int)TblChildFieldIndex.Pcrresult1, false); }
set { SetValue((int)TblChildFieldIndex.Pcrresult1, value); }
}
/// <summary> The Pcrresult2 property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."PCRResult2"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Pcrresult2
{
get { return (Nullable<System.Int16>)GetValue((int)TblChildFieldIndex.Pcrresult2, false); }
set { SetValue((int)TblChildFieldIndex.Pcrresult2, value); }
}
/// <summary> The PreganceId property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."PreganceID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String PreganceId
{
get { return (System.String)GetValue((int)TblChildFieldIndex.PreganceId, true); }
set { SetValue((int)TblChildFieldIndex.PreganceId, value); }
}
/// <summary> The Sex property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."Sex"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Int16 Sex
{
get { return (System.Int16)GetValue((int)TblChildFieldIndex.Sex, true); }
set { SetValue((int)TblChildFieldIndex.Sex, value); }
}
/// <summary> The UniqueKey property of the Entity TblChild<br/><br/></summary>
/// <remarks>Mapped on table field: "tblChildren"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblChildFieldIndex.UniqueKey, true); }
set { SetValue((int)TblChildFieldIndex.UniqueKey, value); }
}
/// <summary> Gets / sets related entity of type 'TblPregnanceInfoEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPregnanceInfoEntity TblPregnanceInfo
{
get { return _tblPregnanceInfo; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPregnanceInfo(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblChildren", "TblPregnanceInfo", _tblPregnanceInfo, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblChildEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,745 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblClinicInfo'.<br/><br/></summary>
[Serializable]
public partial class TblClinicInfoEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblPatientEntity _tblPatient;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPatient</summary>
public static readonly string TblPatient = "TblPatient";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblClinicInfoEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblClinicInfoEntity():base("TblClinicInfoEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblClinicInfoEntity(IEntityFields2 fields):base("TblClinicInfoEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblClinicInfoEntity</param>
public TblClinicInfoEntity(IValidator validator):base("TblClinicInfoEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblClinicInfo which data should be fetched into this TblClinicInfo object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblClinicInfoEntity(System.String uniqueKey):base("TblClinicInfoEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblClinicInfo which data should be fetched into this TblClinicInfo object</param>
/// <param name="validator">The custom validator object for this TblClinicInfoEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblClinicInfoEntity(System.String uniqueKey, IValidator validator):base("TblClinicInfoEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblClinicInfoEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblPatient = (TblPatientEntity)info.GetValue("_tblPatient", typeof(TblPatientEntity));
if(_tblPatient!=null)
{
_tblPatient.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblClinicInfoFieldIndex)fieldIndex)
{
case TblClinicInfoFieldIndex.PatientId:
DesetupSyncTblPatient(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPatient":
this.TblPatient = (TblPatientEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPatient":
toReturn.Add(Relations.TblPatientEntityUsingPatientId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPatient":
SetupSyncTblPatient(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPatient":
DesetupSyncTblPatient(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblPatient!=null)
{
toReturn.Add(_tblPatient);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblPatient", (!this.MarkedForDeletion?_tblPatient:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblClinicInfoRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatient()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.PatientId, null, ComparisonOperator.Equal, this.PatientId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblClinicInfoEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPatient", _tblPatient);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Anemia", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Blackouts", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Burning", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ClinicDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ClinicStage", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Colic", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Depression", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Diarrhea", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("FatDistributionChanges", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Headache", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Height", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Jaundice", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Motion", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Nausea", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Poisoning", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ProgressTb", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Rash", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Weight", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblPatient</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPatient(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblClinicInfoRelations.TblPatientEntityUsingPatientIdStatic, true, signalRelatedEntity, "TblClinicInfos", resetFKFields, new int[] { (int)TblClinicInfoFieldIndex.PatientId } );
_tblPatient = null;
}
/// <summary> setups the sync logic for member _tblPatient</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPatient(IEntityCore relatedEntity)
{
if(_tblPatient!=relatedEntity)
{
DesetupSyncTblPatient(true, true);
_tblPatient = (TblPatientEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblClinicInfoRelations.TblPatientEntityUsingPatientIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPatientPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblClinicInfoEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblClinicInfoRelations Relations
{
get { return new TblClinicInfoRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatient
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatient")[0], (int)Datalib.EntityType.TblClinicInfoEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatient", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The Anemia property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Anemia"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Anemia
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Anemia, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Anemia, value); }
}
/// <summary> The Blackouts property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Blackouts"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Blackouts
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Blackouts, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Blackouts, value); }
}
/// <summary> The Burning property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Burning"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Burning
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Burning, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Burning, value); }
}
/// <summary> The ClinicDate property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."ClinicDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ClinicDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblClinicInfoFieldIndex.ClinicDate, false); }
set { SetValue((int)TblClinicInfoFieldIndex.ClinicDate, value); }
}
/// <summary> The ClinicStage property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."ClinicStage"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> ClinicStage
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.ClinicStage, false); }
set { SetValue((int)TblClinicInfoFieldIndex.ClinicStage, value); }
}
/// <summary> The Colic property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Colic"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Colic
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Colic, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Colic, value); }
}
/// <summary> The Depression property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Depression"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Depression
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Depression, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Depression, value); }
}
/// <summary> The Diarrhea property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Diarrhea"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Diarrhea
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Diarrhea, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Diarrhea, value); }
}
/// <summary> The FatDistributionChanges property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."FatDistributionChanges"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> FatDistributionChanges
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.FatDistributionChanges, false); }
set { SetValue((int)TblClinicInfoFieldIndex.FatDistributionChanges, value); }
}
/// <summary> The Headache property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Headache"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Headache
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Headache, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Headache, value); }
}
/// <summary> The Height property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Height"<br/>
/// Table field type characteristics (type, precision, scale, length): Double, 15, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Double> Height
{
get { return (Nullable<System.Double>)GetValue((int)TblClinicInfoFieldIndex.Height, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Height, value); }
}
/// <summary> The Jaundice property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."jaundice"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Jaundice
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Jaundice, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Jaundice, value); }
}
/// <summary> The Motion property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Motion"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Motion
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Motion, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Motion, value); }
}
/// <summary> The Nausea property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Nausea"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Nausea
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Nausea, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Nausea, value); }
}
/// <summary> The PatientId property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."PatientID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblClinicInfoFieldIndex.PatientId, true); }
set { SetValue((int)TblClinicInfoFieldIndex.PatientId, value); }
}
/// <summary> The Poisoning property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Poisoning"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Poisoning
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Poisoning, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Poisoning, value); }
}
/// <summary> The ProgressTb property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."ProgressTB"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> ProgressTb
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.ProgressTb, false); }
set { SetValue((int)TblClinicInfoFieldIndex.ProgressTb, value); }
}
/// <summary> The Rash property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Rash"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Rash
{
get { return (Nullable<System.Int16>)GetValue((int)TblClinicInfoFieldIndex.Rash, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Rash, value); }
}
/// <summary> The UniqueKey property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblClinicInfoFieldIndex.UniqueKey, true); }
set { SetValue((int)TblClinicInfoFieldIndex.UniqueKey, value); }
}
/// <summary> The Weight property of the Entity TblClinicInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblClinicInfo"."Weight"<br/>
/// Table field type characteristics (type, precision, scale, length): Double, 15, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Double> Weight
{
get { return (Nullable<System.Double>)GetValue((int)TblClinicInfoFieldIndex.Weight, false); }
set { SetValue((int)TblClinicInfoFieldIndex.Weight, value); }
}
/// <summary> Gets / sets related entity of type 'TblPatientEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPatientEntity TblPatient
{
get { return _tblPatient; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPatient(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblClinicInfos", "TblPatient", _tblPatient, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblClinicInfoEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,541 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblCommune'.<br/><br/></summary>
[Serializable]
public partial class TblCommuneEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblDistrictEntity _tblDistrict;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblDistrict</summary>
public static readonly string TblDistrict = "TblDistrict";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblCommuneEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblCommuneEntity():base("TblCommuneEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblCommuneEntity(IEntityFields2 fields):base("TblCommuneEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblCommuneEntity</param>
public TblCommuneEntity(IValidator validator):base("TblCommuneEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="communeid">PK value for TblCommune which data should be fetched into this TblCommune object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblCommuneEntity(System.String communeid):base("TblCommuneEntity")
{
InitClassEmpty(null, null);
this.Communeid = communeid;
}
/// <summary> CTor</summary>
/// <param name="communeid">PK value for TblCommune which data should be fetched into this TblCommune object</param>
/// <param name="validator">The custom validator object for this TblCommuneEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblCommuneEntity(System.String communeid, IValidator validator):base("TblCommuneEntity")
{
InitClassEmpty(validator, null);
this.Communeid = communeid;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblCommuneEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblDistrict = (TblDistrictEntity)info.GetValue("_tblDistrict", typeof(TblDistrictEntity));
if(_tblDistrict!=null)
{
_tblDistrict.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblCommuneFieldIndex)fieldIndex)
{
case TblCommuneFieldIndex.Districtid:
DesetupSyncTblDistrict(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblDistrict":
this.TblDistrict = (TblDistrictEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblDistrict":
toReturn.Add(Relations.TblDistrictEntityUsingDistrictid);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblDistrict":
SetupSyncTblDistrict(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblDistrict":
DesetupSyncTblDistrict(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblDistrict!=null)
{
toReturn.Add(_tblDistrict);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblDistrict", (!this.MarkedForDeletion?_tblDistrict:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblCommuneRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblDistrict' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblDistrict()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblDistrictFields.Districtid, null, ComparisonOperator.Equal, this.Districtid));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblCommuneEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblDistrict", _tblDistrict);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Communeid", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Communename", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Districtid", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblDistrict</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblDistrict(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblDistrict, new PropertyChangedEventHandler( OnTblDistrictPropertyChanged ), "TblDistrict", Datalib.RelationClasses.StaticTblCommuneRelations.TblDistrictEntityUsingDistrictidStatic, true, signalRelatedEntity, "TblCommunes", resetFKFields, new int[] { (int)TblCommuneFieldIndex.Districtid } );
_tblDistrict = null;
}
/// <summary> setups the sync logic for member _tblDistrict</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblDistrict(IEntityCore relatedEntity)
{
if(_tblDistrict!=relatedEntity)
{
DesetupSyncTblDistrict(true, true);
_tblDistrict = (TblDistrictEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblDistrict, new PropertyChangedEventHandler( OnTblDistrictPropertyChanged ), "TblDistrict", Datalib.RelationClasses.StaticTblCommuneRelations.TblDistrictEntityUsingDistrictidStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblDistrictPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblCommuneEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblCommuneRelations Relations
{
get { return new TblCommuneRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblDistrict' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblDistrict
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblDistrictEntityFactory))), (IEntityRelation)GetRelationsForField("TblDistrict")[0], (int)Datalib.EntityType.TblCommuneEntity, (int)Datalib.EntityType.TblDistrictEntity, 0, null, null, null, null, "TblDistrict", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The Communeid property of the Entity TblCommune<br/><br/></summary>
/// <remarks>Mapped on table field: "tblCommunes"."communeid"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 7<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String Communeid
{
get { return (System.String)GetValue((int)TblCommuneFieldIndex.Communeid, true); }
set { SetValue((int)TblCommuneFieldIndex.Communeid, value); }
}
/// <summary> The Communename property of the Entity TblCommune<br/><br/></summary>
/// <remarks>Mapped on table field: "tblCommunes"."communename"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Communename
{
get { return (System.String)GetValue((int)TblCommuneFieldIndex.Communename, true); }
set { SetValue((int)TblCommuneFieldIndex.Communename, value); }
}
/// <summary> The Districtid property of the Entity TblCommune<br/><br/></summary>
/// <remarks>Mapped on table field: "tblCommunes"."districtid"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 5<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Districtid
{
get { return (System.String)GetValue((int)TblCommuneFieldIndex.Districtid, true); }
set { SetValue((int)TblCommuneFieldIndex.Districtid, value); }
}
/// <summary> Gets / sets related entity of type 'TblDistrictEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblDistrictEntity TblDistrict
{
get { return _tblDistrict; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblDistrict(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblCommunes", "TblDistrict", _tblDistrict, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblCommuneEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,577 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblDiary'.<br/><br/></summary>
[Serializable]
public partial class TblDiaryEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblPatientEntity _tblPatient;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPatient</summary>
public static readonly string TblPatient = "TblPatient";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblDiaryEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblDiaryEntity():base("TblDiaryEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblDiaryEntity(IEntityFields2 fields):base("TblDiaryEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblDiaryEntity</param>
public TblDiaryEntity(IValidator validator):base("TblDiaryEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblDiary which data should be fetched into this TblDiary object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblDiaryEntity(System.String uniqueKey):base("TblDiaryEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblDiary which data should be fetched into this TblDiary object</param>
/// <param name="validator">The custom validator object for this TblDiaryEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblDiaryEntity(System.String uniqueKey, IValidator validator):base("TblDiaryEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblDiaryEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblPatient = (TblPatientEntity)info.GetValue("_tblPatient", typeof(TblPatientEntity));
if(_tblPatient!=null)
{
_tblPatient.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblDiaryFieldIndex)fieldIndex)
{
case TblDiaryFieldIndex.PatientId:
DesetupSyncTblPatient(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPatient":
this.TblPatient = (TblPatientEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPatient":
toReturn.Add(Relations.TblPatientEntityUsingPatientId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPatient":
SetupSyncTblPatient(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPatient":
DesetupSyncTblPatient(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblPatient!=null)
{
toReturn.Add(_tblPatient);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblPatient", (!this.MarkedForDeletion?_tblPatient:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblDiaryRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatient()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.PatientId, null, ComparisonOperator.Equal, this.PatientId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblDiaryEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPatient", _tblPatient);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("EventDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("OtherResult", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Reason", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Result", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblPatient</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPatient(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblDiaryRelations.TblPatientEntityUsingPatientIdStatic, true, signalRelatedEntity, "TblDiaries", resetFKFields, new int[] { (int)TblDiaryFieldIndex.PatientId } );
_tblPatient = null;
}
/// <summary> setups the sync logic for member _tblPatient</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPatient(IEntityCore relatedEntity)
{
if(_tblPatient!=relatedEntity)
{
DesetupSyncTblPatient(true, true);
_tblPatient = (TblPatientEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblDiaryRelations.TblPatientEntityUsingPatientIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPatientPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblDiaryEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblDiaryRelations Relations
{
get { return new TblDiaryRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatient
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatient")[0], (int)Datalib.EntityType.TblDiaryEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatient", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The EventDate property of the Entity TblDiary<br/><br/></summary>
/// <remarks>Mapped on table field: "tblDiary"."EventDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> EventDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblDiaryFieldIndex.EventDate, false); }
set { SetValue((int)TblDiaryFieldIndex.EventDate, value); }
}
/// <summary> The OtherResult property of the Entity TblDiary<br/><br/></summary>
/// <remarks>Mapped on table field: "tblDiary"."OtherResult"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String OtherResult
{
get { return (System.String)GetValue((int)TblDiaryFieldIndex.OtherResult, true); }
set { SetValue((int)TblDiaryFieldIndex.OtherResult, value); }
}
/// <summary> The PatientId property of the Entity TblDiary<br/><br/></summary>
/// <remarks>Mapped on table field: "tblDiary"."PatientID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblDiaryFieldIndex.PatientId, true); }
set { SetValue((int)TblDiaryFieldIndex.PatientId, value); }
}
/// <summary> The Reason property of the Entity TblDiary<br/><br/></summary>
/// <remarks>Mapped on table field: "tblDiary"."Reason"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Reason
{
get { return (System.String)GetValue((int)TblDiaryFieldIndex.Reason, true); }
set { SetValue((int)TblDiaryFieldIndex.Reason, value); }
}
/// <summary> The Result property of the Entity TblDiary<br/><br/></summary>
/// <remarks>Mapped on table field: "tblDiary"."Result"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 1<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Result
{
get { return (System.String)GetValue((int)TblDiaryFieldIndex.Result, true); }
set { SetValue((int)TblDiaryFieldIndex.Result, value); }
}
/// <summary> The UniqueKey property of the Entity TblDiary<br/><br/></summary>
/// <remarks>Mapped on table field: "tblDiary"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblDiaryFieldIndex.UniqueKey, true); }
set { SetValue((int)TblDiaryFieldIndex.UniqueKey, value); }
}
/// <summary> Gets / sets related entity of type 'TblPatientEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPatientEntity TblPatient
{
get { return _tblPatient; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPatient(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblDiaries", "TblPatient", _tblPatient, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblDiaryEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,587 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblDistrict'.<br/><br/></summary>
[Serializable]
public partial class TblDistrictEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private EntityCollection<TblCommuneEntity> _tblCommunes;
private TblProvinceEntity _tblProvince;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblProvince</summary>
public static readonly string TblProvince = "TblProvince";
/// <summary>Member name TblCommunes</summary>
public static readonly string TblCommunes = "TblCommunes";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblDistrictEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblDistrictEntity():base("TblDistrictEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblDistrictEntity(IEntityFields2 fields):base("TblDistrictEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblDistrictEntity</param>
public TblDistrictEntity(IValidator validator):base("TblDistrictEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="districtid">PK value for TblDistrict which data should be fetched into this TblDistrict object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblDistrictEntity(System.String districtid):base("TblDistrictEntity")
{
InitClassEmpty(null, null);
this.Districtid = districtid;
}
/// <summary> CTor</summary>
/// <param name="districtid">PK value for TblDistrict which data should be fetched into this TblDistrict object</param>
/// <param name="validator">The custom validator object for this TblDistrictEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblDistrictEntity(System.String districtid, IValidator validator):base("TblDistrictEntity")
{
InitClassEmpty(validator, null);
this.Districtid = districtid;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblDistrictEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblCommunes = (EntityCollection<TblCommuneEntity>)info.GetValue("_tblCommunes", typeof(EntityCollection<TblCommuneEntity>));
_tblProvince = (TblProvinceEntity)info.GetValue("_tblProvince", typeof(TblProvinceEntity));
if(_tblProvince!=null)
{
_tblProvince.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblDistrictFieldIndex)fieldIndex)
{
case TblDistrictFieldIndex.Provinceid:
DesetupSyncTblProvince(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblProvince":
this.TblProvince = (TblProvinceEntity)entity;
break;
case "TblCommunes":
this.TblCommunes.Add((TblCommuneEntity)entity);
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblProvince":
toReturn.Add(Relations.TblProvinceEntityUsingProvinceid);
break;
case "TblCommunes":
toReturn.Add(Relations.TblCommuneEntityUsingDistrictid);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblProvince":
SetupSyncTblProvince(relatedEntity);
break;
case "TblCommunes":
this.TblCommunes.Add((TblCommuneEntity)relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblProvince":
DesetupSyncTblProvince(false, true);
break;
case "TblCommunes":
this.PerformRelatedEntityRemoval(this.TblCommunes, relatedEntity, signalRelatedEntityManyToOne);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblProvince!=null)
{
toReturn.Add(_tblProvince);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
toReturn.Add(this.TblCommunes);
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblCommunes", ((_tblCommunes!=null) && (_tblCommunes.Count>0) && !this.MarkedForDeletion)?_tblCommunes:null);
info.AddValue("_tblProvince", (!this.MarkedForDeletion?_tblProvince:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblDistrictRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblCommune' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblCommunes()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblCommuneFields.Districtid, null, ComparisonOperator.Equal, this.Districtid));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblProvince' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblProvince()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblProvinceFields.Provinceid, null, ComparisonOperator.Equal, this.Provinceid));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblDistrictEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
collectionsQueue.Enqueue(this._tblCommunes);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
this._tblCommunes = (EntityCollection<TblCommuneEntity>) collectionsQueue.Dequeue();
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
toReturn |=(this._tblCommunes != null);
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<TblCommuneEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblCommuneEntityFactory))) : null);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblProvince", _tblProvince);
toReturn.Add("TblCommunes", _tblCommunes);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Districtid", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Districtname", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Provinceid", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblProvince</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblProvince(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblProvince, new PropertyChangedEventHandler( OnTblProvincePropertyChanged ), "TblProvince", Datalib.RelationClasses.StaticTblDistrictRelations.TblProvinceEntityUsingProvinceidStatic, true, signalRelatedEntity, "TblDistricts", resetFKFields, new int[] { (int)TblDistrictFieldIndex.Provinceid } );
_tblProvince = null;
}
/// <summary> setups the sync logic for member _tblProvince</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblProvince(IEntityCore relatedEntity)
{
if(_tblProvince!=relatedEntity)
{
DesetupSyncTblProvince(true, true);
_tblProvince = (TblProvinceEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblProvince, new PropertyChangedEventHandler( OnTblProvincePropertyChanged ), "TblProvince", Datalib.RelationClasses.StaticTblDistrictRelations.TblProvinceEntityUsingProvinceidStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblProvincePropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblDistrictEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblDistrictRelations Relations
{
get { return new TblDistrictRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblCommune' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblCommunes
{
get { return new PrefetchPathElement2( new EntityCollection<TblCommuneEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblCommuneEntityFactory))), (IEntityRelation)GetRelationsForField("TblCommunes")[0], (int)Datalib.EntityType.TblDistrictEntity, (int)Datalib.EntityType.TblCommuneEntity, 0, null, null, null, null, "TblCommunes", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblProvince' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblProvince
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblProvinceEntityFactory))), (IEntityRelation)GetRelationsForField("TblProvince")[0], (int)Datalib.EntityType.TblDistrictEntity, (int)Datalib.EntityType.TblProvinceEntity, 0, null, null, null, null, "TblProvince", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The Districtid property of the Entity TblDistrict<br/><br/></summary>
/// <remarks>Mapped on table field: "tblDistricts"."districtid"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 5<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String Districtid
{
get { return (System.String)GetValue((int)TblDistrictFieldIndex.Districtid, true); }
set { SetValue((int)TblDistrictFieldIndex.Districtid, value); }
}
/// <summary> The Districtname property of the Entity TblDistrict<br/><br/></summary>
/// <remarks>Mapped on table field: "tblDistricts"."districtname"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 26<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Districtname
{
get { return (System.String)GetValue((int)TblDistrictFieldIndex.Districtname, true); }
set { SetValue((int)TblDistrictFieldIndex.Districtname, value); }
}
/// <summary> The Provinceid property of the Entity TblDistrict<br/><br/></summary>
/// <remarks>Mapped on table field: "tblDistricts"."provinceid"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 3<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Provinceid
{
get { return (System.String)GetValue((int)TblDistrictFieldIndex.Provinceid, true); }
set { SetValue((int)TblDistrictFieldIndex.Provinceid, value); }
}
/// <summary> Gets the EntityCollection with the related entities of type 'TblCommuneEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblCommuneEntity))]
public virtual EntityCollection<TblCommuneEntity> TblCommunes
{
get { return GetOrCreateEntityCollection<TblCommuneEntity, TblCommuneEntityFactory>("TblDistrict", true, false, ref _tblCommunes); }
}
/// <summary> Gets / sets related entity of type 'TblProvinceEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblProvinceEntity TblProvince
{
get { return _tblProvince; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblProvince(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblDistricts", "TblProvince", _tblProvince, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblDistrictEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,961 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblExaminationInfo'.<br/><br/></summary>
[Serializable]
public partial class TblExaminationInfoEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblPatientEntity _tblPatient;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPatient</summary>
public static readonly string TblPatient = "TblPatient";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblExaminationInfoEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblExaminationInfoEntity():base("TblExaminationInfoEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblExaminationInfoEntity(IEntityFields2 fields):base("TblExaminationInfoEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblExaminationInfoEntity</param>
public TblExaminationInfoEntity(IValidator validator):base("TblExaminationInfoEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblExaminationInfo which data should be fetched into this TblExaminationInfo object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblExaminationInfoEntity(System.String uniqueKey):base("TblExaminationInfoEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblExaminationInfo which data should be fetched into this TblExaminationInfo object</param>
/// <param name="validator">The custom validator object for this TblExaminationInfoEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblExaminationInfoEntity(System.String uniqueKey, IValidator validator):base("TblExaminationInfoEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblExaminationInfoEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblPatient = (TblPatientEntity)info.GetValue("_tblPatient", typeof(TblPatientEntity));
if(_tblPatient!=null)
{
_tblPatient.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblExaminationInfoFieldIndex)fieldIndex)
{
case TblExaminationInfoFieldIndex.PatientId:
DesetupSyncTblPatient(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPatient":
this.TblPatient = (TblPatientEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPatient":
toReturn.Add(Relations.TblPatientEntityUsingPatientId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPatient":
SetupSyncTblPatient(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPatient":
DesetupSyncTblPatient(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblPatient!=null)
{
toReturn.Add(_tblPatient);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblPatient", (!this.MarkedForDeletion?_tblPatient:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblExaminationInfoRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatient()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.PatientId, null, ComparisonOperator.Equal, this.PatientId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblExaminationInfoEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPatient", _tblPatient);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Anemia", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Blackouts", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Burning", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Calc", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ClinicStage", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Colic", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("CommuneId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("DayDiff", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Depression", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Diarrhea", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("DistrictId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("EndExamDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ExamDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("FatDistributionChanges", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Headache", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Height", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("IsClinic", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Jaundice", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("LateAppointmentReason", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("LateTimes", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Motion", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Nausea", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("NoSelfExam", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("OutPatientTreatment", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Poisoning", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ProgressTb", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ProvinceId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Rash", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReasonEnd", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReExamDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReTreatment", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Status", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TbScreen", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TbScreenResult", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TreatmentFollow", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Weight", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblPatient</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPatient(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblExaminationInfoRelations.TblPatientEntityUsingPatientIdStatic, true, signalRelatedEntity, "TblExaminationInfos", resetFKFields, new int[] { (int)TblExaminationInfoFieldIndex.PatientId } );
_tblPatient = null;
}
/// <summary> setups the sync logic for member _tblPatient</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPatient(IEntityCore relatedEntity)
{
if(_tblPatient!=relatedEntity)
{
DesetupSyncTblPatient(true, true);
_tblPatient = (TblPatientEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblExaminationInfoRelations.TblPatientEntityUsingPatientIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPatientPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblExaminationInfoEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblExaminationInfoRelations Relations
{
get { return new TblExaminationInfoRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatient
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatient")[0], (int)Datalib.EntityType.TblExaminationInfoEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatient", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The Anemia property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Anemia"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Anemia
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Anemia, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Anemia, value); }
}
/// <summary> The Blackouts property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Blackouts"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Blackouts
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Blackouts, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Blackouts, value); }
}
/// <summary> The Burning property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Burning"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Burning
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Burning, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Burning, value); }
}
/// <summary> The Calc property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Calc"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Calc
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Calc, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Calc, value); }
}
/// <summary> The ClinicStage property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."ClinicStage"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> ClinicStage
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.ClinicStage, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.ClinicStage, value); }
}
/// <summary> The Colic property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Colic"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Colic
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Colic, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Colic, value); }
}
/// <summary> The CommuneId property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."CommuneID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 7<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String CommuneId
{
get { return (System.String)GetValue((int)TblExaminationInfoFieldIndex.CommuneId, true); }
set { SetValue((int)TblExaminationInfoFieldIndex.CommuneId, value); }
}
/// <summary> The DayDiff property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."DayDiff"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> DayDiff
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.DayDiff, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.DayDiff, value); }
}
/// <summary> The Depression property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Depression"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Depression
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Depression, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Depression, value); }
}
/// <summary> The Diarrhea property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Diarrhea"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Diarrhea
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Diarrhea, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Diarrhea, value); }
}
/// <summary> The DistrictId property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."DistrictID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 5<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String DistrictId
{
get { return (System.String)GetValue((int)TblExaminationInfoFieldIndex.DistrictId, true); }
set { SetValue((int)TblExaminationInfoFieldIndex.DistrictId, value); }
}
/// <summary> The EndExamDate property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."endExamDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> EndExamDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblExaminationInfoFieldIndex.EndExamDate, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.EndExamDate, value); }
}
/// <summary> The ExamDate property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."ExamDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ExamDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblExaminationInfoFieldIndex.ExamDate, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.ExamDate, value); }
}
/// <summary> The FatDistributionChanges property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."FatDistributionChanges"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> FatDistributionChanges
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.FatDistributionChanges, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.FatDistributionChanges, value); }
}
/// <summary> The Headache property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Headache"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Headache
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Headache, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Headache, value); }
}
/// <summary> The Height property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Height"<br/>
/// Table field type characteristics (type, precision, scale, length): Double, 15, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Double> Height
{
get { return (Nullable<System.Double>)GetValue((int)TblExaminationInfoFieldIndex.Height, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Height, value); }
}
/// <summary> The IsClinic property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."IsClinic"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> IsClinic
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.IsClinic, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.IsClinic, value); }
}
/// <summary> The Jaundice property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."jaundice"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Jaundice
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Jaundice, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Jaundice, value); }
}
/// <summary> The LateAppointmentReason property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."LateAppointmentReason"<br/>
/// Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String LateAppointmentReason
{
get { return (System.String)GetValue((int)TblExaminationInfoFieldIndex.LateAppointmentReason, true); }
set { SetValue((int)TblExaminationInfoFieldIndex.LateAppointmentReason, value); }
}
/// <summary> The LateTimes property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."LateTimes"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 10<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String LateTimes
{
get { return (System.String)GetValue((int)TblExaminationInfoFieldIndex.LateTimes, true); }
set { SetValue((int)TblExaminationInfoFieldIndex.LateTimes, value); }
}
/// <summary> The Motion property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Motion"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Motion
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Motion, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Motion, value); }
}
/// <summary> The Nausea property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Nausea"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Nausea
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Nausea, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Nausea, value); }
}
/// <summary> The NoSelfExam property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."NoSelfExam"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> NoSelfExam
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.NoSelfExam, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.NoSelfExam, value); }
}
/// <summary> The OutPatientTreatment property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."OutPatientTreatment"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> OutPatientTreatment
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.OutPatientTreatment, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.OutPatientTreatment, value); }
}
/// <summary> The PatientId property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."PatientID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblExaminationInfoFieldIndex.PatientId, true); }
set { SetValue((int)TblExaminationInfoFieldIndex.PatientId, value); }
}
/// <summary> The Poisoning property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Poisoning"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Poisoning
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Poisoning, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Poisoning, value); }
}
/// <summary> The ProgressTb property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."ProgressTB"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> ProgressTb
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.ProgressTb, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.ProgressTb, value); }
}
/// <summary> The ProvinceId property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."ProvinceID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 3<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ProvinceId
{
get { return (System.String)GetValue((int)TblExaminationInfoFieldIndex.ProvinceId, true); }
set { SetValue((int)TblExaminationInfoFieldIndex.ProvinceId, value); }
}
/// <summary> The Rash property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Rash"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Rash
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Rash, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Rash, value); }
}
/// <summary> The ReasonEnd property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."ReasonEnd"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ReasonEnd
{
get { return (System.String)GetValue((int)TblExaminationInfoFieldIndex.ReasonEnd, true); }
set { SetValue((int)TblExaminationInfoFieldIndex.ReasonEnd, value); }
}
/// <summary> The ReExamDate property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."ReExamDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ReExamDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblExaminationInfoFieldIndex.ReExamDate, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.ReExamDate, value); }
}
/// <summary> The ReTreatment property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."ReTreatment"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> ReTreatment
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.ReTreatment, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.ReTreatment, value); }
}
/// <summary> The Status property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Status"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Status
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.Status, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Status, value); }
}
/// <summary> The TbScreen property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."TbScreen"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> TbScreen
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.TbScreen, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.TbScreen, value); }
}
/// <summary> The TbScreenResult property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."tbScreenResult"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String TbScreenResult
{
get { return (System.String)GetValue((int)TblExaminationInfoFieldIndex.TbScreenResult, true); }
set { SetValue((int)TblExaminationInfoFieldIndex.TbScreenResult, value); }
}
/// <summary> The TreatmentFollow property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."TreatmentFollow"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> TreatmentFollow
{
get { return (Nullable<System.Int16>)GetValue((int)TblExaminationInfoFieldIndex.TreatmentFollow, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.TreatmentFollow, value); }
}
/// <summary> The UniqueKey property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblExaminationInfoFieldIndex.UniqueKey, true); }
set { SetValue((int)TblExaminationInfoFieldIndex.UniqueKey, value); }
}
/// <summary> The Weight property of the Entity TblExaminationInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblExaminationInfo"."Weight"<br/>
/// Table field type characteristics (type, precision, scale, length): Double, 15, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Double> Weight
{
get { return (Nullable<System.Double>)GetValue((int)TblExaminationInfoFieldIndex.Weight, false); }
set { SetValue((int)TblExaminationInfoFieldIndex.Weight, value); }
}
/// <summary> Gets / sets related entity of type 'TblPatientEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPatientEntity TblPatient
{
get { return _tblPatient; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPatient(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblExaminationInfos", "TblPatient", _tblPatient, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblExaminationInfoEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,685 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblPreClinicsInfo'.<br/><br/></summary>
[Serializable]
public partial class TblPreClinicsInfoEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblPatientEntity _tblPatient;
private TblTestEntity _tblTest;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPatient</summary>
public static readonly string TblPatient = "TblPatient";
/// <summary>Member name TblTest</summary>
public static readonly string TblTest = "TblTest";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblPreClinicsInfoEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblPreClinicsInfoEntity():base("TblPreClinicsInfoEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblPreClinicsInfoEntity(IEntityFields2 fields):base("TblPreClinicsInfoEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblPreClinicsInfoEntity</param>
public TblPreClinicsInfoEntity(IValidator validator):base("TblPreClinicsInfoEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblPreClinicsInfo which data should be fetched into this TblPreClinicsInfo object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblPreClinicsInfoEntity(System.String uniqueKey):base("TblPreClinicsInfoEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblPreClinicsInfo which data should be fetched into this TblPreClinicsInfo object</param>
/// <param name="validator">The custom validator object for this TblPreClinicsInfoEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblPreClinicsInfoEntity(System.String uniqueKey, IValidator validator):base("TblPreClinicsInfoEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblPreClinicsInfoEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblPatient = (TblPatientEntity)info.GetValue("_tblPatient", typeof(TblPatientEntity));
if(_tblPatient!=null)
{
_tblPatient.AfterSave+=new EventHandler(OnEntityAfterSave);
}
_tblTest = (TblTestEntity)info.GetValue("_tblTest", typeof(TblTestEntity));
if(_tblTest!=null)
{
_tblTest.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblPreClinicsInfoFieldIndex)fieldIndex)
{
case TblPreClinicsInfoFieldIndex.PatientId:
DesetupSyncTblPatient(true, false);
break;
case TblPreClinicsInfoFieldIndex.Testid:
DesetupSyncTblTest(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPatient":
this.TblPatient = (TblPatientEntity)entity;
break;
case "TblTest":
this.TblTest = (TblTestEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPatient":
toReturn.Add(Relations.TblPatientEntityUsingPatientId);
break;
case "TblTest":
toReturn.Add(Relations.TblTestEntityUsingTestid);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPatient":
SetupSyncTblPatient(relatedEntity);
break;
case "TblTest":
SetupSyncTblTest(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPatient":
DesetupSyncTblPatient(false, true);
break;
case "TblTest":
DesetupSyncTblTest(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblPatient!=null)
{
toReturn.Add(_tblPatient);
}
if(_tblTest!=null)
{
toReturn.Add(_tblTest);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblPatient", (!this.MarkedForDeletion?_tblPatient:null));
info.AddValue("_tblTest", (!this.MarkedForDeletion?_tblTest:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblPreClinicsInfoRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatient()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.PatientId, null, ComparisonOperator.Equal, this.PatientId));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblTest' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblTest()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblTestFields.Testid, null, ComparisonOperator.Equal, this.Testid));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblPreClinicsInfoEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPatient", _tblPatient);
toReturn.Add("TblTest", _tblTest);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("QualityResult", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("QuantityResult", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Status", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TestDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Testid", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblPatient</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPatient(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblPreClinicsInfoRelations.TblPatientEntityUsingPatientIdStatic, true, signalRelatedEntity, "TblPreClinicsInfos", resetFKFields, new int[] { (int)TblPreClinicsInfoFieldIndex.PatientId } );
_tblPatient = null;
}
/// <summary> setups the sync logic for member _tblPatient</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPatient(IEntityCore relatedEntity)
{
if(_tblPatient!=relatedEntity)
{
DesetupSyncTblPatient(true, true);
_tblPatient = (TblPatientEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblPreClinicsInfoRelations.TblPatientEntityUsingPatientIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPatientPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Removes the sync logic for member _tblTest</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblTest(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblTest, new PropertyChangedEventHandler( OnTblTestPropertyChanged ), "TblTest", Datalib.RelationClasses.StaticTblPreClinicsInfoRelations.TblTestEntityUsingTestidStatic, true, signalRelatedEntity, "TblPreClinicsInfos", resetFKFields, new int[] { (int)TblPreClinicsInfoFieldIndex.Testid } );
_tblTest = null;
}
/// <summary> setups the sync logic for member _tblTest</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblTest(IEntityCore relatedEntity)
{
if(_tblTest!=relatedEntity)
{
DesetupSyncTblTest(true, true);
_tblTest = (TblTestEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblTest, new PropertyChangedEventHandler( OnTblTestPropertyChanged ), "TblTest", Datalib.RelationClasses.StaticTblPreClinicsInfoRelations.TblTestEntityUsingTestidStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblTestPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblPreClinicsInfoEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblPreClinicsInfoRelations Relations
{
get { return new TblPreClinicsInfoRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatient
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatient")[0], (int)Datalib.EntityType.TblPreClinicsInfoEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatient", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblTest' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblTest
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblTestEntityFactory))), (IEntityRelation)GetRelationsForField("TblTest")[0], (int)Datalib.EntityType.TblPreClinicsInfoEntity, (int)Datalib.EntityType.TblTestEntity, 0, null, null, null, null, "TblTest", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The PatientId property of the Entity TblPreClinicsInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPreClinicsInfo"."PatientID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblPreClinicsInfoFieldIndex.PatientId, true); }
set { SetValue((int)TblPreClinicsInfoFieldIndex.PatientId, value); }
}
/// <summary> The QualityResult property of the Entity TblPreClinicsInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPreClinicsInfo"."QualityResult"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> QualityResult
{
get { return (Nullable<System.Int16>)GetValue((int)TblPreClinicsInfoFieldIndex.QualityResult, false); }
set { SetValue((int)TblPreClinicsInfoFieldIndex.QualityResult, value); }
}
/// <summary> The QuantityResult property of the Entity TblPreClinicsInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPreClinicsInfo"."QuantityResult"<br/>
/// Table field type characteristics (type, precision, scale, length): Double, 15, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Double> QuantityResult
{
get { return (Nullable<System.Double>)GetValue((int)TblPreClinicsInfoFieldIndex.QuantityResult, false); }
set { SetValue((int)TblPreClinicsInfoFieldIndex.QuantityResult, value); }
}
/// <summary> The Status property of the Entity TblPreClinicsInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPreClinicsInfo"."Status"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Status
{
get { return (Nullable<System.Int16>)GetValue((int)TblPreClinicsInfoFieldIndex.Status, false); }
set { SetValue((int)TblPreClinicsInfoFieldIndex.Status, value); }
}
/// <summary> The TestDate property of the Entity TblPreClinicsInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPreClinicsInfo"."TestDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> TestDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblPreClinicsInfoFieldIndex.TestDate, false); }
set { SetValue((int)TblPreClinicsInfoFieldIndex.TestDate, value); }
}
/// <summary> The Testid property of the Entity TblPreClinicsInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPreClinicsInfo"."Testid"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.String Testid
{
get { return (System.String)GetValue((int)TblPreClinicsInfoFieldIndex.Testid, true); }
set { SetValue((int)TblPreClinicsInfoFieldIndex.Testid, value); }
}
/// <summary> The UniqueKey property of the Entity TblPreClinicsInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPreClinicsInfo"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblPreClinicsInfoFieldIndex.UniqueKey, true); }
set { SetValue((int)TblPreClinicsInfoFieldIndex.UniqueKey, value); }
}
/// <summary> Gets / sets related entity of type 'TblPatientEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPatientEntity TblPatient
{
get { return _tblPatient; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPatient(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblPreClinicsInfos", "TblPatient", _tblPatient, true);
}
}
}
/// <summary> Gets / sets related entity of type 'TblTestEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblTestEntity TblTest
{
get { return _tblTest; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblTest(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblPreClinicsInfos", "TblTest", _tblTest, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblPreClinicsInfoEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,611 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblPregnanceInfo'.<br/><br/></summary>
[Serializable]
public partial class TblPregnanceInfoEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private EntityCollection<TblChildEntity> _tblChildren;
private TblPatientEntity _tblPatient;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPatient</summary>
public static readonly string TblPatient = "TblPatient";
/// <summary>Member name TblChildren</summary>
public static readonly string TblChildren = "TblChildren";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblPregnanceInfoEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblPregnanceInfoEntity():base("TblPregnanceInfoEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblPregnanceInfoEntity(IEntityFields2 fields):base("TblPregnanceInfoEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblPregnanceInfoEntity</param>
public TblPregnanceInfoEntity(IValidator validator):base("TblPregnanceInfoEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblPregnanceInfo which data should be fetched into this TblPregnanceInfo object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblPregnanceInfoEntity(System.String uniqueKey):base("TblPregnanceInfoEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblPregnanceInfo which data should be fetched into this TblPregnanceInfo object</param>
/// <param name="validator">The custom validator object for this TblPregnanceInfoEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblPregnanceInfoEntity(System.String uniqueKey, IValidator validator):base("TblPregnanceInfoEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblPregnanceInfoEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblChildren = (EntityCollection<TblChildEntity>)info.GetValue("_tblChildren", typeof(EntityCollection<TblChildEntity>));
_tblPatient = (TblPatientEntity)info.GetValue("_tblPatient", typeof(TblPatientEntity));
if(_tblPatient!=null)
{
_tblPatient.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblPregnanceInfoFieldIndex)fieldIndex)
{
case TblPregnanceInfoFieldIndex.PatientId:
DesetupSyncTblPatient(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPatient":
this.TblPatient = (TblPatientEntity)entity;
break;
case "TblChildren":
this.TblChildren.Add((TblChildEntity)entity);
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPatient":
toReturn.Add(Relations.TblPatientEntityUsingPatientId);
break;
case "TblChildren":
toReturn.Add(Relations.TblChildEntityUsingPreganceId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPatient":
SetupSyncTblPatient(relatedEntity);
break;
case "TblChildren":
this.TblChildren.Add((TblChildEntity)relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPatient":
DesetupSyncTblPatient(false, true);
break;
case "TblChildren":
this.PerformRelatedEntityRemoval(this.TblChildren, relatedEntity, signalRelatedEntityManyToOne);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblPatient!=null)
{
toReturn.Add(_tblPatient);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
toReturn.Add(this.TblChildren);
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblChildren", ((_tblChildren!=null) && (_tblChildren.Count>0) && !this.MarkedForDeletion)?_tblChildren:null);
info.AddValue("_tblPatient", (!this.MarkedForDeletion?_tblPatient:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblPregnanceInfoRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblChild' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblChildren()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblChildFields.PreganceId, null, ComparisonOperator.Equal, this.UniqueKey));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatient()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.PatientId, null, ComparisonOperator.Equal, this.PatientId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblPregnanceInfoEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
collectionsQueue.Enqueue(this._tblChildren);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
this._tblChildren = (EntityCollection<TblChildEntity>) collectionsQueue.Dequeue();
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
toReturn |=(this._tblChildren != null);
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<TblChildEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblChildEntityFactory))) : null);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPatient", _tblPatient);
toReturn.Add("TblChildren", _tblChildren);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("EstimatedDelivery", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Note", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PregnanceDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblPatient</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPatient(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblPregnanceInfoRelations.TblPatientEntityUsingPatientIdStatic, true, signalRelatedEntity, "TblPregnanceInfos", resetFKFields, new int[] { (int)TblPregnanceInfoFieldIndex.PatientId } );
_tblPatient = null;
}
/// <summary> setups the sync logic for member _tblPatient</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPatient(IEntityCore relatedEntity)
{
if(_tblPatient!=relatedEntity)
{
DesetupSyncTblPatient(true, true);
_tblPatient = (TblPatientEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblPregnanceInfoRelations.TblPatientEntityUsingPatientIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPatientPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblPregnanceInfoEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblPregnanceInfoRelations Relations
{
get { return new TblPregnanceInfoRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblChild' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblChildren
{
get { return new PrefetchPathElement2( new EntityCollection<TblChildEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblChildEntityFactory))), (IEntityRelation)GetRelationsForField("TblChildren")[0], (int)Datalib.EntityType.TblPregnanceInfoEntity, (int)Datalib.EntityType.TblChildEntity, 0, null, null, null, null, "TblChildren", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatient
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatient")[0], (int)Datalib.EntityType.TblPregnanceInfoEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatient", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The EstimatedDelivery property of the Entity TblPregnanceInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPregnanceInfo"."EstimatedDelivery"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> EstimatedDelivery
{
get { return (Nullable<System.DateTime>)GetValue((int)TblPregnanceInfoFieldIndex.EstimatedDelivery, false); }
set { SetValue((int)TblPregnanceInfoFieldIndex.EstimatedDelivery, value); }
}
/// <summary> The Note property of the Entity TblPregnanceInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPregnanceInfo"."Note"<br/>
/// Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Note
{
get { return (System.String)GetValue((int)TblPregnanceInfoFieldIndex.Note, true); }
set { SetValue((int)TblPregnanceInfoFieldIndex.Note, value); }
}
/// <summary> The PatientId property of the Entity TblPregnanceInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPregnanceInfo"."PatientID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblPregnanceInfoFieldIndex.PatientId, true); }
set { SetValue((int)TblPregnanceInfoFieldIndex.PatientId, value); }
}
/// <summary> The PregnanceDate property of the Entity TblPregnanceInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPregnanceInfo"."PregnanceDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> PregnanceDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblPregnanceInfoFieldIndex.PregnanceDate, false); }
set { SetValue((int)TblPregnanceInfoFieldIndex.PregnanceDate, value); }
}
/// <summary> The UniqueKey property of the Entity TblPregnanceInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblPregnanceInfo"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblPregnanceInfoFieldIndex.UniqueKey, true); }
set { SetValue((int)TblPregnanceInfoFieldIndex.UniqueKey, value); }
}
/// <summary> Gets the EntityCollection with the related entities of type 'TblChildEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblChildEntity))]
public virtual EntityCollection<TblChildEntity> TblChildren
{
get { return GetOrCreateEntityCollection<TblChildEntity, TblChildEntityFactory>("TblPregnanceInfo", true, false, ref _tblChildren); }
}
/// <summary> Gets / sets related entity of type 'TblPatientEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPatientEntity TblPatient
{
get { return _tblPatient; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPatient(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblPregnanceInfos", "TblPatient", _tblPatient, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblPregnanceInfoEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,467 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblProvince'.<br/><br/></summary>
[Serializable]
public partial class TblProvinceEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private EntityCollection<TblDistrictEntity> _tblDistricts;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblDistricts</summary>
public static readonly string TblDistricts = "TblDistricts";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblProvinceEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblProvinceEntity():base("TblProvinceEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblProvinceEntity(IEntityFields2 fields):base("TblProvinceEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblProvinceEntity</param>
public TblProvinceEntity(IValidator validator):base("TblProvinceEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="provinceid">PK value for TblProvince which data should be fetched into this TblProvince object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblProvinceEntity(System.String provinceid):base("TblProvinceEntity")
{
InitClassEmpty(null, null);
this.Provinceid = provinceid;
}
/// <summary> CTor</summary>
/// <param name="provinceid">PK value for TblProvince which data should be fetched into this TblProvince object</param>
/// <param name="validator">The custom validator object for this TblProvinceEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblProvinceEntity(System.String provinceid, IValidator validator):base("TblProvinceEntity")
{
InitClassEmpty(validator, null);
this.Provinceid = provinceid;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblProvinceEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblDistricts = (EntityCollection<TblDistrictEntity>)info.GetValue("_tblDistricts", typeof(EntityCollection<TblDistrictEntity>));
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblDistricts":
this.TblDistricts.Add((TblDistrictEntity)entity);
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblDistricts":
toReturn.Add(Relations.TblDistrictEntityUsingProvinceid);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblDistricts":
this.TblDistricts.Add((TblDistrictEntity)relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblDistricts":
this.PerformRelatedEntityRemoval(this.TblDistricts, relatedEntity, signalRelatedEntityManyToOne);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
toReturn.Add(this.TblDistricts);
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblDistricts", ((_tblDistricts!=null) && (_tblDistricts.Count>0) && !this.MarkedForDeletion)?_tblDistricts:null);
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblProvinceRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblDistrict' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblDistricts()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblDistrictFields.Provinceid, null, ComparisonOperator.Equal, this.Provinceid));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblProvinceEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
collectionsQueue.Enqueue(this._tblDistricts);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
this._tblDistricts = (EntityCollection<TblDistrictEntity>) collectionsQueue.Dequeue();
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
toReturn |=(this._tblDistricts != null);
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<TblDistrictEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblDistrictEntityFactory))) : null);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblDistricts", _tblDistricts);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Provinceid", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Provincename", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblProvinceEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblProvinceRelations Relations
{
get { return new TblProvinceRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblDistrict' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblDistricts
{
get { return new PrefetchPathElement2( new EntityCollection<TblDistrictEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblDistrictEntityFactory))), (IEntityRelation)GetRelationsForField("TblDistricts")[0], (int)Datalib.EntityType.TblProvinceEntity, (int)Datalib.EntityType.TblDistrictEntity, 0, null, null, null, null, "TblDistricts", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The Provinceid property of the Entity TblProvince<br/><br/></summary>
/// <remarks>Mapped on table field: "tblProvinces"."provinceid"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 3<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String Provinceid
{
get { return (System.String)GetValue((int)TblProvinceFieldIndex.Provinceid, true); }
set { SetValue((int)TblProvinceFieldIndex.Provinceid, value); }
}
/// <summary> The Provincename property of the Entity TblProvince<br/><br/></summary>
/// <remarks>Mapped on table field: "tblProvinces"."provincename"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 30<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Provincename
{
get { return (System.String)GetValue((int)TblProvinceFieldIndex.Provincename, true); }
set { SetValue((int)TblProvinceFieldIndex.Provincename, value); }
}
/// <summary> Gets the EntityCollection with the related entities of type 'TblDistrictEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblDistrictEntity))]
public virtual EntityCollection<TblDistrictEntity> TblDistricts
{
get { return GetOrCreateEntityCollection<TblDistrictEntity, TblDistrictEntityFactory>("TblProvince", true, false, ref _tblDistricts); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblProvinceEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,817 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 3.1
// Code is generated on: Sunday, February 23, 2014 10:56:43 AM
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblReferral'.<br/><br/></summary>
[Serializable]
public partial class TblReferralEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblAgencyEntity _tblAgency;
private TblPatientEntity _tblPatient;
private TblServiceEntity _tblService;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblAgency</summary>
public static readonly string TblAgency = "TblAgency";
/// <summary>Member name TblPatient</summary>
public static readonly string TblPatient = "TblPatient";
/// <summary>Member name TblService</summary>
public static readonly string TblService = "TblService";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblReferralEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblReferralEntity():base("TblReferralEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblReferralEntity(IEntityFields2 fields):base("TblReferralEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblReferralEntity</param>
public TblReferralEntity(IValidator validator):base("TblReferralEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblReferral which data should be fetched into this TblReferral object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblReferralEntity(System.String uniqueKey):base("TblReferralEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblReferral which data should be fetched into this TblReferral object</param>
/// <param name="validator">The custom validator object for this TblReferralEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblReferralEntity(System.String uniqueKey, IValidator validator):base("TblReferralEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblReferralEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblAgency = (TblAgencyEntity)info.GetValue("_tblAgency", typeof(TblAgencyEntity));
if(_tblAgency!=null)
{
_tblAgency.AfterSave+=new EventHandler(OnEntityAfterSave);
}
_tblPatient = (TblPatientEntity)info.GetValue("_tblPatient", typeof(TblPatientEntity));
if(_tblPatient!=null)
{
_tblPatient.AfterSave+=new EventHandler(OnEntityAfterSave);
}
_tblService = (TblServiceEntity)info.GetValue("_tblService", typeof(TblServiceEntity));
if(_tblService!=null)
{
_tblService.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblReferralFieldIndex)fieldIndex)
{
case TblReferralFieldIndex.AgencyTypeId:
DesetupSyncTblAgency(true, false);
break;
case TblReferralFieldIndex.PatientId:
DesetupSyncTblPatient(true, false);
break;
case TblReferralFieldIndex.ServiceId:
DesetupSyncTblService(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntity2 entity)
{
switch(propertyName)
{
case "TblAgency":
this.TblAgency = (TblAgencyEntity)entity;
break;
case "TblPatient":
this.TblPatient = (TblPatientEntity)entity;
break;
case "TblService":
this.TblService = (TblServiceEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblAgency":
toReturn.Add(Relations.TblAgencyEntityUsingAgencyTypeId);
break;
case "TblPatient":
toReturn.Add(Relations.TblPatientEntityUsingPatientId);
break;
case "TblService":
toReturn.Add(Relations.TblServiceEntityUsingServiceId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntity2 relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblAgency":
SetupSyncTblAgency(relatedEntity);
break;
case "TblPatient":
SetupSyncTblPatient(relatedEntity);
break;
case "TblService":
SetupSyncTblService(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntity2 relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblAgency":
DesetupSyncTblAgency(false, true);
break;
case "TblPatient":
DesetupSyncTblPatient(false, true);
break;
case "TblService":
DesetupSyncTblService(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblAgency!=null)
{
toReturn.Add(_tblAgency);
}
if(_tblPatient!=null)
{
toReturn.Add(_tblPatient);
}
if(_tblService!=null)
{
toReturn.Add(_tblService);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblAgency", (!this.MarkedForDeletion?_tblAgency:null));
info.AddValue("_tblPatient", (!this.MarkedForDeletion?_tblPatient:null));
info.AddValue("_tblService", (!this.MarkedForDeletion?_tblService:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblReferralRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblAgency' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblAgency()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblAgencyFields.AgencyTypeId, null, ComparisonOperator.Equal, this.AgencyTypeId));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatient()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.PatientId, null, ComparisonOperator.Equal, this.PatientId));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblService' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblService()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblServiceFields.ServiceId, null, ComparisonOperator.Equal, this.ServiceId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblReferralEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblAgency", _tblAgency);
toReturn.Add("TblPatient", _tblPatient);
toReturn.Add("TblService", _tblService);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("AgencyTypeId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Note", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ProvinceId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReceiveServiceDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReferralAgency", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReferralDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ServiceId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Status", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblAgency</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblAgency(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblAgency, new PropertyChangedEventHandler( OnTblAgencyPropertyChanged ), "TblAgency", Datalib.RelationClasses.StaticTblReferralRelations.TblAgencyEntityUsingAgencyTypeIdStatic, true, signalRelatedEntity, "TblReferrals", resetFKFields, new int[] { (int)TblReferralFieldIndex.AgencyTypeId } );
_tblAgency = null;
}
/// <summary> setups the sync logic for member _tblAgency</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblAgency(IEntity2 relatedEntity)
{
if(_tblAgency!=relatedEntity)
{
DesetupSyncTblAgency(true, true);
_tblAgency = (TblAgencyEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblAgency, new PropertyChangedEventHandler( OnTblAgencyPropertyChanged ), "TblAgency", Datalib.RelationClasses.StaticTblReferralRelations.TblAgencyEntityUsingAgencyTypeIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblAgencyPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Removes the sync logic for member _tblPatient</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPatient(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblReferralRelations.TblPatientEntityUsingPatientIdStatic, true, signalRelatedEntity, "TblReferrals", resetFKFields, new int[] { (int)TblReferralFieldIndex.PatientId } );
_tblPatient = null;
}
/// <summary> setups the sync logic for member _tblPatient</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPatient(IEntity2 relatedEntity)
{
if(_tblPatient!=relatedEntity)
{
DesetupSyncTblPatient(true, true);
_tblPatient = (TblPatientEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblReferralRelations.TblPatientEntityUsingPatientIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPatientPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Removes the sync logic for member _tblService</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblService(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblService, new PropertyChangedEventHandler( OnTblServicePropertyChanged ), "TblService", Datalib.RelationClasses.StaticTblReferralRelations.TblServiceEntityUsingServiceIdStatic, true, signalRelatedEntity, "TblReferrals", resetFKFields, new int[] { (int)TblReferralFieldIndex.ServiceId } );
_tblService = null;
}
/// <summary> setups the sync logic for member _tblService</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblService(IEntity2 relatedEntity)
{
if(_tblService!=relatedEntity)
{
DesetupSyncTblService(true, true);
_tblService = (TblServiceEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblService, new PropertyChangedEventHandler( OnTblServicePropertyChanged ), "TblService", Datalib.RelationClasses.StaticTblReferralRelations.TblServiceEntityUsingServiceIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblServicePropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblReferralEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblReferralRelations Relations
{
get { return new TblReferralRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblAgency' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblAgency
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblAgencyEntityFactory))), (IEntityRelation)GetRelationsForField("TblAgency")[0], (int)Datalib.EntityType.TblReferralEntity, (int)Datalib.EntityType.TblAgencyEntity, 0, null, null, null, null, "TblAgency", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatient
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatient")[0], (int)Datalib.EntityType.TblReferralEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatient", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblService' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblService
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblServiceEntityFactory))), (IEntityRelation)GetRelationsForField("TblService")[0], (int)Datalib.EntityType.TblReferralEntity, (int)Datalib.EntityType.TblServiceEntity, 0, null, null, null, null, "TblService", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The AgencyTypeId property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."AgencyTypeId"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String AgencyTypeId
{
get { return (System.String)GetValue((int)TblReferralFieldIndex.AgencyTypeId, true); }
set { SetValue((int)TblReferralFieldIndex.AgencyTypeId, value); }
}
/// <summary> The Note property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."Note"<br/>
/// Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 2147483647<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Note
{
get { return (System.String)GetValue((int)TblReferralFieldIndex.Note, true); }
set { SetValue((int)TblReferralFieldIndex.Note, value); }
}
/// <summary> The PatientId property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."PatientId"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblReferralFieldIndex.PatientId, true); }
set { SetValue((int)TblReferralFieldIndex.PatientId, value); }
}
/// <summary> The ProvinceId property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."ProvinceId"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 3<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ProvinceId
{
get { return (System.String)GetValue((int)TblReferralFieldIndex.ProvinceId, true); }
set { SetValue((int)TblReferralFieldIndex.ProvinceId, value); }
}
/// <summary> The ReceiveServiceDate property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."ReceiveServiceDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ReceiveServiceDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblReferralFieldIndex.ReceiveServiceDate, false); }
set { SetValue((int)TblReferralFieldIndex.ReceiveServiceDate, value); }
}
/// <summary> The ReferralAgency property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."ReferralAgency"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ReferralAgency
{
get { return (System.String)GetValue((int)TblReferralFieldIndex.ReferralAgency, true); }
set { SetValue((int)TblReferralFieldIndex.ReferralAgency, value); }
}
/// <summary> The ReferralDate property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."ReferralDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ReferralDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblReferralFieldIndex.ReferralDate, false); }
set { SetValue((int)TblReferralFieldIndex.ReferralDate, value); }
}
/// <summary> The ServiceId property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."ServiceId"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ServiceId
{
get { return (System.String)GetValue((int)TblReferralFieldIndex.ServiceId, true); }
set { SetValue((int)TblReferralFieldIndex.ServiceId, value); }
}
/// <summary> The Status property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."Status"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Status
{
get { return (Nullable<System.Int16>)GetValue((int)TblReferralFieldIndex.Status, false); }
set { SetValue((int)TblReferralFieldIndex.Status, value); }
}
/// <summary> The UniqueKey property of the Entity TblReferral<br/><br/></summary>
/// <remarks>Mapped on table field: "TblReferral"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblReferralFieldIndex.UniqueKey, true); }
set { SetValue((int)TblReferralFieldIndex.UniqueKey, value); }
}
/// <summary> Gets / sets related entity of type 'TblAgencyEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblAgencyEntity TblAgency
{
get { return _tblAgency; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblAgency(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblReferrals", "TblAgency", _tblAgency, true);
}
}
}
/// <summary> Gets / sets related entity of type 'TblPatientEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPatientEntity TblPatient
{
get { return _tblPatient; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPatient(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblReferrals", "TblPatient", _tblPatient, true);
}
}
}
/// <summary> Gets / sets related entity of type 'TblServiceEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblServiceEntity TblService
{
get { return _tblService; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblService(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblReferrals", "TblService", _tblService, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblReferralEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,479 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblReferralFromPlace'.<br/><br/></summary>
[Serializable]
public partial class TblReferralFromPlaceEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private EntityCollection<TblPatientEntity> _tblPatients;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPatients</summary>
public static readonly string TblPatients = "TblPatients";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblReferralFromPlaceEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblReferralFromPlaceEntity():base("TblReferralFromPlaceEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblReferralFromPlaceEntity(IEntityFields2 fields):base("TblReferralFromPlaceEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblReferralFromPlaceEntity</param>
public TblReferralFromPlaceEntity(IValidator validator):base("TblReferralFromPlaceEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="referralId">PK value for TblReferralFromPlace which data should be fetched into this TblReferralFromPlace object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblReferralFromPlaceEntity(System.String referralId):base("TblReferralFromPlaceEntity")
{
InitClassEmpty(null, null);
this.ReferralId = referralId;
}
/// <summary> CTor</summary>
/// <param name="referralId">PK value for TblReferralFromPlace which data should be fetched into this TblReferralFromPlace object</param>
/// <param name="validator">The custom validator object for this TblReferralFromPlaceEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblReferralFromPlaceEntity(System.String referralId, IValidator validator):base("TblReferralFromPlaceEntity")
{
InitClassEmpty(validator, null);
this.ReferralId = referralId;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblReferralFromPlaceEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblPatients = (EntityCollection<TblPatientEntity>)info.GetValue("_tblPatients", typeof(EntityCollection<TblPatientEntity>));
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPatients":
this.TblPatients.Add((TblPatientEntity)entity);
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPatients":
toReturn.Add(Relations.TblPatientEntityUsingReferralId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPatients":
this.TblPatients.Add((TblPatientEntity)relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPatients":
this.PerformRelatedEntityRemoval(this.TblPatients, relatedEntity, signalRelatedEntityManyToOne);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
toReturn.Add(this.TblPatients);
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblPatients", ((_tblPatients!=null) && (_tblPatients.Count>0) && !this.MarkedForDeletion)?_tblPatients:null);
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblReferralFromPlaceRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatients()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.ReferralId, null, ComparisonOperator.Equal, this.ReferralId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblReferralFromPlaceEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
collectionsQueue.Enqueue(this._tblPatients);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
this._tblPatients = (EntityCollection<TblPatientEntity>) collectionsQueue.Dequeue();
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
toReturn |=(this._tblPatients != null);
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<TblPatientEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))) : null);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPatients", _tblPatients);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("EReferralName", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReferralId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("VReferralName", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblReferralFromPlaceEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblReferralFromPlaceRelations Relations
{
get { return new TblReferralFromPlaceRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatients
{
get { return new PrefetchPathElement2( new EntityCollection<TblPatientEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatients")[0], (int)Datalib.EntityType.TblReferralFromPlaceEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatients", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The EReferralName property of the Entity TblReferralFromPlace<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralFromPlaces"."eReferralName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String EReferralName
{
get { return (System.String)GetValue((int)TblReferralFromPlaceFieldIndex.EReferralName, true); }
set { SetValue((int)TblReferralFromPlaceFieldIndex.EReferralName, value); }
}
/// <summary> The ReferralId property of the Entity TblReferralFromPlace<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralFromPlaces"."ReferralID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String ReferralId
{
get { return (System.String)GetValue((int)TblReferralFromPlaceFieldIndex.ReferralId, true); }
set { SetValue((int)TblReferralFromPlaceFieldIndex.ReferralId, value); }
}
/// <summary> The VReferralName property of the Entity TblReferralFromPlace<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralFromPlaces"."vReferralName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String VReferralName
{
get { return (System.String)GetValue((int)TblReferralFromPlaceFieldIndex.VReferralName, true); }
set { SetValue((int)TblReferralFromPlaceFieldIndex.VReferralName, value); }
}
/// <summary> Gets the EntityCollection with the related entities of type 'TblPatientEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblPatientEntity))]
public virtual EntityCollection<TblPatientEntity> TblPatients
{
get { return GetOrCreateEntityCollection<TblPatientEntity, TblPatientEntityFactory>("TblReferralFromPlace", true, false, ref _tblPatients); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblReferralFromPlaceEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,637 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblReferralsTo'.<br/><br/></summary>
[Serializable]
public partial class TblReferralsToEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblPatientEntity _tblPatient;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPatient</summary>
public static readonly string TblPatient = "TblPatient";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblReferralsToEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblReferralsToEntity():base("TblReferralsToEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblReferralsToEntity(IEntityFields2 fields):base("TblReferralsToEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblReferralsToEntity</param>
public TblReferralsToEntity(IValidator validator):base("TblReferralsToEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblReferralsTo which data should be fetched into this TblReferralsTo object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblReferralsToEntity(System.String uniqueKey):base("TblReferralsToEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblReferralsTo which data should be fetched into this TblReferralsTo object</param>
/// <param name="validator">The custom validator object for this TblReferralsToEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblReferralsToEntity(System.String uniqueKey, IValidator validator):base("TblReferralsToEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblReferralsToEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblPatient = (TblPatientEntity)info.GetValue("_tblPatient", typeof(TblPatientEntity));
if(_tblPatient!=null)
{
_tblPatient.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblReferralsToFieldIndex)fieldIndex)
{
case TblReferralsToFieldIndex.PatientId:
DesetupSyncTblPatient(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPatient":
this.TblPatient = (TblPatientEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPatient":
toReturn.Add(Relations.TblPatientEntityUsingPatientId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPatient":
SetupSyncTblPatient(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPatient":
DesetupSyncTblPatient(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblPatient!=null)
{
toReturn.Add(_tblPatient);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblPatient", (!this.MarkedForDeletion?_tblPatient:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblReferralsToRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatient()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.PatientId, null, ComparisonOperator.Equal, this.PatientId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblReferralsToEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPatient", _tblPatient);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("AgencyTypeId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("DeathReasonId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("EndDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Note", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ProvinceId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReceiveServiceDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReferralAgency", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Status", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TypeId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblPatient</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPatient(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblReferralsToRelations.TblPatientEntityUsingPatientIdStatic, true, signalRelatedEntity, "TblReferralsTos", resetFKFields, new int[] { (int)TblReferralsToFieldIndex.PatientId } );
_tblPatient = null;
}
/// <summary> setups the sync logic for member _tblPatient</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPatient(IEntityCore relatedEntity)
{
if(_tblPatient!=relatedEntity)
{
DesetupSyncTblPatient(true, true);
_tblPatient = (TblPatientEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblReferralsToRelations.TblPatientEntityUsingPatientIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPatientPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblReferralsToEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblReferralsToRelations Relations
{
get { return new TblReferralsToRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatient
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatient")[0], (int)Datalib.EntityType.TblReferralsToEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatient", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The AgencyTypeId property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."AgencyTypeID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String AgencyTypeId
{
get { return (System.String)GetValue((int)TblReferralsToFieldIndex.AgencyTypeId, true); }
set { SetValue((int)TblReferralsToFieldIndex.AgencyTypeId, value); }
}
/// <summary> The DeathReasonId property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."DeathReasonID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String DeathReasonId
{
get { return (System.String)GetValue((int)TblReferralsToFieldIndex.DeathReasonId, true); }
set { SetValue((int)TblReferralsToFieldIndex.DeathReasonId, value); }
}
/// <summary> The EndDate property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."EndDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> EndDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblReferralsToFieldIndex.EndDate, false); }
set { SetValue((int)TblReferralsToFieldIndex.EndDate, value); }
}
/// <summary> The Note property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."Note"<br/>
/// Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Note
{
get { return (System.String)GetValue((int)TblReferralsToFieldIndex.Note, true); }
set { SetValue((int)TblReferralsToFieldIndex.Note, value); }
}
/// <summary> The PatientId property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."PatientID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblReferralsToFieldIndex.PatientId, true); }
set { SetValue((int)TblReferralsToFieldIndex.PatientId, value); }
}
/// <summary> The ProvinceId property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."ProvinceID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 3<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ProvinceId
{
get { return (System.String)GetValue((int)TblReferralsToFieldIndex.ProvinceId, true); }
set { SetValue((int)TblReferralsToFieldIndex.ProvinceId, value); }
}
/// <summary> The ReceiveServiceDate property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."ReceiveServiceDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ReceiveServiceDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblReferralsToFieldIndex.ReceiveServiceDate, false); }
set { SetValue((int)TblReferralsToFieldIndex.ReceiveServiceDate, value); }
}
/// <summary> The ReferralAgency property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."ReferralAgency"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ReferralAgency
{
get { return (System.String)GetValue((int)TblReferralsToFieldIndex.ReferralAgency, true); }
set { SetValue((int)TblReferralsToFieldIndex.ReferralAgency, value); }
}
/// <summary> The Status property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."Status"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Status
{
get { return (Nullable<System.Int16>)GetValue((int)TblReferralsToFieldIndex.Status, false); }
set { SetValue((int)TblReferralsToFieldIndex.Status, value); }
}
/// <summary> The TypeId property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."TypeID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String TypeId
{
get { return (System.String)GetValue((int)TblReferralsToFieldIndex.TypeId, true); }
set { SetValue((int)TblReferralsToFieldIndex.TypeId, value); }
}
/// <summary> The UniqueKey property of the Entity TblReferralsTo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferralsTo"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblReferralsToFieldIndex.UniqueKey, true); }
set { SetValue((int)TblReferralsToFieldIndex.UniqueKey, value); }
}
/// <summary> Gets / sets related entity of type 'TblPatientEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPatientEntity TblPatient
{
get { return _tblPatient; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPatient(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblReferralsTos", "TblPatient", _tblPatient, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblReferralsToEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,709 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblReferraltoService'.<br/><br/></summary>
[Serializable]
public partial class TblReferraltoServiceEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblAgencyEntity _tblAgency;
private TblPatientEntity _tblPatient;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblAgency</summary>
public static readonly string TblAgency = "TblAgency";
/// <summary>Member name TblPatient</summary>
public static readonly string TblPatient = "TblPatient";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblReferraltoServiceEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblReferraltoServiceEntity():base("TblReferraltoServiceEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblReferraltoServiceEntity(IEntityFields2 fields):base("TblReferraltoServiceEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblReferraltoServiceEntity</param>
public TblReferraltoServiceEntity(IValidator validator):base("TblReferraltoServiceEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblReferraltoService which data should be fetched into this TblReferraltoService object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblReferraltoServiceEntity(System.String uniqueKey):base("TblReferraltoServiceEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblReferraltoService which data should be fetched into this TblReferraltoService object</param>
/// <param name="validator">The custom validator object for this TblReferraltoServiceEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblReferraltoServiceEntity(System.String uniqueKey, IValidator validator):base("TblReferraltoServiceEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblReferraltoServiceEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblAgency = (TblAgencyEntity)info.GetValue("_tblAgency", typeof(TblAgencyEntity));
if(_tblAgency!=null)
{
_tblAgency.AfterSave+=new EventHandler(OnEntityAfterSave);
}
_tblPatient = (TblPatientEntity)info.GetValue("_tblPatient", typeof(TblPatientEntity));
if(_tblPatient!=null)
{
_tblPatient.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblReferraltoServiceFieldIndex)fieldIndex)
{
case TblReferraltoServiceFieldIndex.AgencyTypeId:
DesetupSyncTblAgency(true, false);
break;
case TblReferraltoServiceFieldIndex.PatientId:
DesetupSyncTblPatient(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblAgency":
this.TblAgency = (TblAgencyEntity)entity;
break;
case "TblPatient":
this.TblPatient = (TblPatientEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblAgency":
toReturn.Add(Relations.TblAgencyEntityUsingAgencyTypeId);
break;
case "TblPatient":
toReturn.Add(Relations.TblPatientEntityUsingPatientId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblAgency":
SetupSyncTblAgency(relatedEntity);
break;
case "TblPatient":
SetupSyncTblPatient(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblAgency":
DesetupSyncTblAgency(false, true);
break;
case "TblPatient":
DesetupSyncTblPatient(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblAgency!=null)
{
toReturn.Add(_tblAgency);
}
if(_tblPatient!=null)
{
toReturn.Add(_tblPatient);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblAgency", (!this.MarkedForDeletion?_tblAgency:null));
info.AddValue("_tblPatient", (!this.MarkedForDeletion?_tblPatient:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblReferraltoServiceRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblAgency' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblAgency()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblAgencyFields.AgencyTypeId, null, ComparisonOperator.Equal, this.AgencyTypeId));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatient()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.PatientId, null, ComparisonOperator.Equal, this.PatientId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblReferraltoServiceEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblAgency", _tblAgency);
toReturn.Add("TblPatient", _tblPatient);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("AgencyTypeId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Note", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ProvinceId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReceiveServiceDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReferralAgency", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReferralDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Status", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblAgency</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblAgency(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblAgency, new PropertyChangedEventHandler( OnTblAgencyPropertyChanged ), "TblAgency", Datalib.RelationClasses.StaticTblReferraltoServiceRelations.TblAgencyEntityUsingAgencyTypeIdStatic, true, signalRelatedEntity, "TblReferraltoServices", resetFKFields, new int[] { (int)TblReferraltoServiceFieldIndex.AgencyTypeId } );
_tblAgency = null;
}
/// <summary> setups the sync logic for member _tblAgency</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblAgency(IEntityCore relatedEntity)
{
if(_tblAgency!=relatedEntity)
{
DesetupSyncTblAgency(true, true);
_tblAgency = (TblAgencyEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblAgency, new PropertyChangedEventHandler( OnTblAgencyPropertyChanged ), "TblAgency", Datalib.RelationClasses.StaticTblReferraltoServiceRelations.TblAgencyEntityUsingAgencyTypeIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblAgencyPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Removes the sync logic for member _tblPatient</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPatient(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblReferraltoServiceRelations.TblPatientEntityUsingPatientIdStatic, true, signalRelatedEntity, "TblReferraltoServices", resetFKFields, new int[] { (int)TblReferraltoServiceFieldIndex.PatientId } );
_tblPatient = null;
}
/// <summary> setups the sync logic for member _tblPatient</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPatient(IEntityCore relatedEntity)
{
if(_tblPatient!=relatedEntity)
{
DesetupSyncTblPatient(true, true);
_tblPatient = (TblPatientEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblReferraltoServiceRelations.TblPatientEntityUsingPatientIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPatientPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblReferraltoServiceEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblReferraltoServiceRelations Relations
{
get { return new TblReferraltoServiceRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblAgency' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblAgency
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblAgencyEntityFactory))), (IEntityRelation)GetRelationsForField("TblAgency")[0], (int)Datalib.EntityType.TblReferraltoServiceEntity, (int)Datalib.EntityType.TblAgencyEntity, 0, null, null, null, null, "TblAgency", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatient
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatient")[0], (int)Datalib.EntityType.TblReferraltoServiceEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatient", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The AgencyTypeId property of the Entity TblReferraltoService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferraltoServices"."AgencyTypeID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String AgencyTypeId
{
get { return (System.String)GetValue((int)TblReferraltoServiceFieldIndex.AgencyTypeId, true); }
set { SetValue((int)TblReferraltoServiceFieldIndex.AgencyTypeId, value); }
}
/// <summary> The Note property of the Entity TblReferraltoService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferraltoServices"."Note"<br/>
/// Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Note
{
get { return (System.String)GetValue((int)TblReferraltoServiceFieldIndex.Note, true); }
set { SetValue((int)TblReferraltoServiceFieldIndex.Note, value); }
}
/// <summary> The PatientId property of the Entity TblReferraltoService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferraltoServices"."PatientID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblReferraltoServiceFieldIndex.PatientId, true); }
set { SetValue((int)TblReferraltoServiceFieldIndex.PatientId, value); }
}
/// <summary> The ProvinceId property of the Entity TblReferraltoService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferraltoServices"."ProvinceID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 3<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ProvinceId
{
get { return (System.String)GetValue((int)TblReferraltoServiceFieldIndex.ProvinceId, true); }
set { SetValue((int)TblReferraltoServiceFieldIndex.ProvinceId, value); }
}
/// <summary> The ReceiveServiceDate property of the Entity TblReferraltoService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferraltoServices"."ReceiveServiceDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ReceiveServiceDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblReferraltoServiceFieldIndex.ReceiveServiceDate, false); }
set { SetValue((int)TblReferraltoServiceFieldIndex.ReceiveServiceDate, value); }
}
/// <summary> The ReferralAgency property of the Entity TblReferraltoService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferraltoServices"."ReferralAgency"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ReferralAgency
{
get { return (System.String)GetValue((int)TblReferraltoServiceFieldIndex.ReferralAgency, true); }
set { SetValue((int)TblReferraltoServiceFieldIndex.ReferralAgency, value); }
}
/// <summary> The ReferralDate property of the Entity TblReferraltoService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferraltoServices"."ReferralDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ReferralDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblReferraltoServiceFieldIndex.ReferralDate, false); }
set { SetValue((int)TblReferraltoServiceFieldIndex.ReferralDate, value); }
}
/// <summary> The Status property of the Entity TblReferraltoService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferraltoServices"."Status"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Status
{
get { return (Nullable<System.Int16>)GetValue((int)TblReferraltoServiceFieldIndex.Status, false); }
set { SetValue((int)TblReferraltoServiceFieldIndex.Status, value); }
}
/// <summary> The UniqueKey property of the Entity TblReferraltoService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblReferraltoServices"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblReferraltoServiceFieldIndex.UniqueKey, true); }
set { SetValue((int)TblReferraltoServiceFieldIndex.UniqueKey, value); }
}
/// <summary> Gets / sets related entity of type 'TblAgencyEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblAgencyEntity TblAgency
{
get { return _tblAgency; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblAgency(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblReferraltoServices", "TblAgency", _tblAgency, true);
}
}
}
/// <summary> Gets / sets related entity of type 'TblPatientEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPatientEntity TblPatient
{
get { return _tblPatient; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPatient(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblReferraltoServices", "TblPatient", _tblPatient, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblReferraltoServiceEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,503 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblRegimen'.<br/><br/></summary>
[Serializable]
public partial class TblRegimenEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private EntityCollection<TblTreatmentInfoEntity> _tblTreatmentInfos;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblTreatmentInfos</summary>
public static readonly string TblTreatmentInfos = "TblTreatmentInfos";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblRegimenEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblRegimenEntity():base("TblRegimenEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblRegimenEntity(IEntityFields2 fields):base("TblRegimenEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblRegimenEntity</param>
public TblRegimenEntity(IValidator validator):base("TblRegimenEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="regimenid">PK value for TblRegimen which data should be fetched into this TblRegimen object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblRegimenEntity(System.String regimenid):base("TblRegimenEntity")
{
InitClassEmpty(null, null);
this.Regimenid = regimenid;
}
/// <summary> CTor</summary>
/// <param name="regimenid">PK value for TblRegimen which data should be fetched into this TblRegimen object</param>
/// <param name="validator">The custom validator object for this TblRegimenEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblRegimenEntity(System.String regimenid, IValidator validator):base("TblRegimenEntity")
{
InitClassEmpty(validator, null);
this.Regimenid = regimenid;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblRegimenEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblTreatmentInfos = (EntityCollection<TblTreatmentInfoEntity>)info.GetValue("_tblTreatmentInfos", typeof(EntityCollection<TblTreatmentInfoEntity>));
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblTreatmentInfos":
this.TblTreatmentInfos.Add((TblTreatmentInfoEntity)entity);
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblTreatmentInfos":
toReturn.Add(Relations.TblTreatmentInfoEntityUsingRegimenid);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblTreatmentInfos":
this.TblTreatmentInfos.Add((TblTreatmentInfoEntity)relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblTreatmentInfos":
this.PerformRelatedEntityRemoval(this.TblTreatmentInfos, relatedEntity, signalRelatedEntityManyToOne);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
toReturn.Add(this.TblTreatmentInfos);
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblTreatmentInfos", ((_tblTreatmentInfos!=null) && (_tblTreatmentInfos.Count>0) && !this.MarkedForDeletion)?_tblTreatmentInfos:null);
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblRegimenRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblTreatmentInfo' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblTreatmentInfos()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblTreatmentInfoFields.Regimenid, null, ComparisonOperator.Equal, this.Regimenid));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblRegimenEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
collectionsQueue.Enqueue(this._tblTreatmentInfos);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
this._tblTreatmentInfos = (EntityCollection<TblTreatmentInfoEntity>) collectionsQueue.Dequeue();
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
toReturn |=(this._tblTreatmentInfos != null);
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<TblTreatmentInfoEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblTreatmentInfoEntityFactory))) : null);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblTreatmentInfos", _tblTreatmentInfos);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ERegimenName", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Regimenid", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Sign", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Type", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("VRegimenname", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblRegimenEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblRegimenRelations Relations
{
get { return new TblRegimenRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblTreatmentInfo' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblTreatmentInfos
{
get { return new PrefetchPathElement2( new EntityCollection<TblTreatmentInfoEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblTreatmentInfoEntityFactory))), (IEntityRelation)GetRelationsForField("TblTreatmentInfos")[0], (int)Datalib.EntityType.TblRegimenEntity, (int)Datalib.EntityType.TblTreatmentInfoEntity, 0, null, null, null, null, "TblTreatmentInfos", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The ERegimenName property of the Entity TblRegimen<br/><br/></summary>
/// <remarks>Mapped on table field: "tblRegimens"."eRegimenName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ERegimenName
{
get { return (System.String)GetValue((int)TblRegimenFieldIndex.ERegimenName, true); }
set { SetValue((int)TblRegimenFieldIndex.ERegimenName, value); }
}
/// <summary> The Regimenid property of the Entity TblRegimen<br/><br/></summary>
/// <remarks>Mapped on table field: "tblRegimens"."Regimenid"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String Regimenid
{
get { return (System.String)GetValue((int)TblRegimenFieldIndex.Regimenid, true); }
set { SetValue((int)TblRegimenFieldIndex.Regimenid, value); }
}
/// <summary> The Sign property of the Entity TblRegimen<br/><br/></summary>
/// <remarks>Mapped on table field: "tblRegimens"."Sign"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 3<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Sign
{
get { return (System.String)GetValue((int)TblRegimenFieldIndex.Sign, true); }
set { SetValue((int)TblRegimenFieldIndex.Sign, value); }
}
/// <summary> The Type property of the Entity TblRegimen<br/><br/></summary>
/// <remarks>Mapped on table field: "tblRegimens"."Type"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int16> Type
{
get { return (Nullable<System.Int16>)GetValue((int)TblRegimenFieldIndex.Type, false); }
set { SetValue((int)TblRegimenFieldIndex.Type, value); }
}
/// <summary> The VRegimenname property of the Entity TblRegimen<br/><br/></summary>
/// <remarks>Mapped on table field: "tblRegimens"."vRegimenname"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String VRegimenname
{
get { return (System.String)GetValue((int)TblRegimenFieldIndex.VRegimenname, true); }
set { SetValue((int)TblRegimenFieldIndex.VRegimenname, value); }
}
/// <summary> Gets the EntityCollection with the related entities of type 'TblTreatmentInfoEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblTreatmentInfoEntity))]
public virtual EntityCollection<TblTreatmentInfoEntity> TblTreatmentInfos
{
get { return GetOrCreateEntityCollection<TblTreatmentInfoEntity, TblTreatmentInfoEntityFactory>("TblRegiman", true, false, ref _tblTreatmentInfos); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblRegimenEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,491 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblRegimenStopReason'.<br/><br/></summary>
[Serializable]
public partial class TblRegimenStopReasonEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private EntityCollection<TblTreatmentInfoEntity> _tblTreatmentInfos;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblTreatmentInfos</summary>
public static readonly string TblTreatmentInfos = "TblTreatmentInfos";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblRegimenStopReasonEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblRegimenStopReasonEntity():base("TblRegimenStopReasonEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblRegimenStopReasonEntity(IEntityFields2 fields):base("TblRegimenStopReasonEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblRegimenStopReasonEntity</param>
public TblRegimenStopReasonEntity(IValidator validator):base("TblRegimenStopReasonEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="reasonId">PK value for TblRegimenStopReason which data should be fetched into this TblRegimenStopReason object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblRegimenStopReasonEntity(System.String reasonId):base("TblRegimenStopReasonEntity")
{
InitClassEmpty(null, null);
this.ReasonId = reasonId;
}
/// <summary> CTor</summary>
/// <param name="reasonId">PK value for TblRegimenStopReason which data should be fetched into this TblRegimenStopReason object</param>
/// <param name="validator">The custom validator object for this TblRegimenStopReasonEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblRegimenStopReasonEntity(System.String reasonId, IValidator validator):base("TblRegimenStopReasonEntity")
{
InitClassEmpty(validator, null);
this.ReasonId = reasonId;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblRegimenStopReasonEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblTreatmentInfos = (EntityCollection<TblTreatmentInfoEntity>)info.GetValue("_tblTreatmentInfos", typeof(EntityCollection<TblTreatmentInfoEntity>));
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblTreatmentInfos":
this.TblTreatmentInfos.Add((TblTreatmentInfoEntity)entity);
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblTreatmentInfos":
toReturn.Add(Relations.TblTreatmentInfoEntityUsingReasonId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblTreatmentInfos":
this.TblTreatmentInfos.Add((TblTreatmentInfoEntity)relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblTreatmentInfos":
this.PerformRelatedEntityRemoval(this.TblTreatmentInfos, relatedEntity, signalRelatedEntityManyToOne);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
toReturn.Add(this.TblTreatmentInfos);
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblTreatmentInfos", ((_tblTreatmentInfos!=null) && (_tblTreatmentInfos.Count>0) && !this.MarkedForDeletion)?_tblTreatmentInfos:null);
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblRegimenStopReasonRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblTreatmentInfo' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblTreatmentInfos()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblTreatmentInfoFields.ReasonId, null, ComparisonOperator.Equal, this.ReasonId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblRegimenStopReasonEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
collectionsQueue.Enqueue(this._tblTreatmentInfos);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
this._tblTreatmentInfos = (EntityCollection<TblTreatmentInfoEntity>) collectionsQueue.Dequeue();
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
toReturn |=(this._tblTreatmentInfos != null);
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<TblTreatmentInfoEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblTreatmentInfoEntityFactory))) : null);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblTreatmentInfos", _tblTreatmentInfos);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("EReasonDes", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReasonId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Sign", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("VReasonDes", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblRegimenStopReasonEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblRegimenStopReasonRelations Relations
{
get { return new TblRegimenStopReasonRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblTreatmentInfo' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblTreatmentInfos
{
get { return new PrefetchPathElement2( new EntityCollection<TblTreatmentInfoEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblTreatmentInfoEntityFactory))), (IEntityRelation)GetRelationsForField("TblTreatmentInfos")[0], (int)Datalib.EntityType.TblRegimenStopReasonEntity, (int)Datalib.EntityType.TblTreatmentInfoEntity, 0, null, null, null, null, "TblTreatmentInfos", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The EReasonDes property of the Entity TblRegimenStopReason<br/><br/></summary>
/// <remarks>Mapped on table field: "tblRegimenStopReasons"."eReasonDes"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String EReasonDes
{
get { return (System.String)GetValue((int)TblRegimenStopReasonFieldIndex.EReasonDes, true); }
set { SetValue((int)TblRegimenStopReasonFieldIndex.EReasonDes, value); }
}
/// <summary> The ReasonId property of the Entity TblRegimenStopReason<br/><br/></summary>
/// <remarks>Mapped on table field: "tblRegimenStopReasons"."ReasonID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String ReasonId
{
get { return (System.String)GetValue((int)TblRegimenStopReasonFieldIndex.ReasonId, true); }
set { SetValue((int)TblRegimenStopReasonFieldIndex.ReasonId, value); }
}
/// <summary> The Sign property of the Entity TblRegimenStopReason<br/><br/></summary>
/// <remarks>Mapped on table field: "tblRegimenStopReasons"."Sign"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Sign
{
get { return (System.String)GetValue((int)TblRegimenStopReasonFieldIndex.Sign, true); }
set { SetValue((int)TblRegimenStopReasonFieldIndex.Sign, value); }
}
/// <summary> The VReasonDes property of the Entity TblRegimenStopReason<br/><br/></summary>
/// <remarks>Mapped on table field: "tblRegimenStopReasons"."vReasonDes"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String VReasonDes
{
get { return (System.String)GetValue((int)TblRegimenStopReasonFieldIndex.VReasonDes, true); }
set { SetValue((int)TblRegimenStopReasonFieldIndex.VReasonDes, value); }
}
/// <summary> Gets the EntityCollection with the related entities of type 'TblTreatmentInfoEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblTreatmentInfoEntity))]
public virtual EntityCollection<TblTreatmentInfoEntity> TblTreatmentInfos
{
get { return GetOrCreateEntityCollection<TblTreatmentInfoEntity, TblTreatmentInfoEntityFactory>("TblRegimenStopReason", true, false, ref _tblTreatmentInfos); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblRegimenStopReasonEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,433 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblService'.<br/><br/></summary>
[Serializable]
public partial class TblServiceEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblServiceEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblServiceEntity():base("TblServiceEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblServiceEntity(IEntityFields2 fields):base("TblServiceEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblServiceEntity</param>
public TblServiceEntity(IValidator validator):base("TblServiceEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="serviceId">PK value for TblService which data should be fetched into this TblService object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblServiceEntity(System.String serviceId):base("TblServiceEntity")
{
InitClassEmpty(null, null);
this.ServiceId = serviceId;
}
/// <summary> CTor</summary>
/// <param name="serviceId">PK value for TblService which data should be fetched into this TblService object</param>
/// <param name="validator">The custom validator object for this TblServiceEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblServiceEntity(System.String serviceId, IValidator validator):base("TblServiceEntity")
{
InitClassEmpty(validator, null);
this.ServiceId = serviceId;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblServiceEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblServiceRelations().GetAllRelations();
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblServiceEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("EServiceName", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ServiceId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("VServiceName", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblServiceEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblServiceRelations Relations
{
get { return new TblServiceRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The EServiceName property of the Entity TblService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblServices"."eServiceName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String EServiceName
{
get { return (System.String)GetValue((int)TblServiceFieldIndex.EServiceName, true); }
set { SetValue((int)TblServiceFieldIndex.EServiceName, value); }
}
/// <summary> The ServiceId property of the Entity TblService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblServices"."ServiceID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String ServiceId
{
get { return (System.String)GetValue((int)TblServiceFieldIndex.ServiceId, true); }
set { SetValue((int)TblServiceFieldIndex.ServiceId, value); }
}
/// <summary> The VServiceName property of the Entity TblService<br/><br/></summary>
/// <remarks>Mapped on table field: "tblServices"."vServiceName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String VServiceName
{
get { return (System.String)GetValue((int)TblServiceFieldIndex.VServiceName, true); }
set { SetValue((int)TblServiceFieldIndex.VServiceName, value); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblServiceEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,479 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblTest'.<br/><br/></summary>
[Serializable]
public partial class TblTestEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private EntityCollection<TblPreClinicsInfoEntity> _tblPreClinicsInfos;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPreClinicsInfos</summary>
public static readonly string TblPreClinicsInfos = "TblPreClinicsInfos";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblTestEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblTestEntity():base("TblTestEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblTestEntity(IEntityFields2 fields):base("TblTestEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblTestEntity</param>
public TblTestEntity(IValidator validator):base("TblTestEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="testid">PK value for TblTest which data should be fetched into this TblTest object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblTestEntity(System.String testid):base("TblTestEntity")
{
InitClassEmpty(null, null);
this.Testid = testid;
}
/// <summary> CTor</summary>
/// <param name="testid">PK value for TblTest which data should be fetched into this TblTest object</param>
/// <param name="validator">The custom validator object for this TblTestEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblTestEntity(System.String testid, IValidator validator):base("TblTestEntity")
{
InitClassEmpty(validator, null);
this.Testid = testid;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblTestEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblPreClinicsInfos = (EntityCollection<TblPreClinicsInfoEntity>)info.GetValue("_tblPreClinicsInfos", typeof(EntityCollection<TblPreClinicsInfoEntity>));
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPreClinicsInfos":
this.TblPreClinicsInfos.Add((TblPreClinicsInfoEntity)entity);
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPreClinicsInfos":
toReturn.Add(Relations.TblPreClinicsInfoEntityUsingTestid);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPreClinicsInfos":
this.TblPreClinicsInfos.Add((TblPreClinicsInfoEntity)relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPreClinicsInfos":
this.PerformRelatedEntityRemoval(this.TblPreClinicsInfos, relatedEntity, signalRelatedEntityManyToOne);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
toReturn.Add(this.TblPreClinicsInfos);
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblPreClinicsInfos", ((_tblPreClinicsInfos!=null) && (_tblPreClinicsInfos.Count>0) && !this.MarkedForDeletion)?_tblPreClinicsInfos:null);
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblTestRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblPreClinicsInfo' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPreClinicsInfos()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPreClinicsInfoFields.Testid, null, ComparisonOperator.Equal, this.Testid));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblTestEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
collectionsQueue.Enqueue(this._tblPreClinicsInfos);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
this._tblPreClinicsInfos = (EntityCollection<TblPreClinicsInfoEntity>) collectionsQueue.Dequeue();
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
toReturn |=(this._tblPreClinicsInfos != null);
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<TblPreClinicsInfoEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblPreClinicsInfoEntityFactory))) : null);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPreClinicsInfos", _tblPreClinicsInfos);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ETestName", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Testid", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("VTestName", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblTestEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblTestRelations Relations
{
get { return new TblTestRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPreClinicsInfo' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPreClinicsInfos
{
get { return new PrefetchPathElement2( new EntityCollection<TblPreClinicsInfoEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblPreClinicsInfoEntityFactory))), (IEntityRelation)GetRelationsForField("TblPreClinicsInfos")[0], (int)Datalib.EntityType.TblTestEntity, (int)Datalib.EntityType.TblPreClinicsInfoEntity, 0, null, null, null, null, "TblPreClinicsInfos", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The ETestName property of the Entity TblTest<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTests"."eTestName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ETestName
{
get { return (System.String)GetValue((int)TblTestFieldIndex.ETestName, true); }
set { SetValue((int)TblTestFieldIndex.ETestName, value); }
}
/// <summary> The Testid property of the Entity TblTest<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTests"."Testid"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String Testid
{
get { return (System.String)GetValue((int)TblTestFieldIndex.Testid, true); }
set { SetValue((int)TblTestFieldIndex.Testid, value); }
}
/// <summary> The VTestName property of the Entity TblTest<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTests"."vTestName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String VTestName
{
get { return (System.String)GetValue((int)TblTestFieldIndex.VTestName, true); }
set { SetValue((int)TblTestFieldIndex.VTestName, value); }
}
/// <summary> Gets the EntityCollection with the related entities of type 'TblPreClinicsInfoEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblPreClinicsInfoEntity))]
public virtual EntityCollection<TblPreClinicsInfoEntity> TblPreClinicsInfos
{
get { return GetOrCreateEntityCollection<TblPreClinicsInfoEntity, TblPreClinicsInfoEntityFactory>("TblTest", true, false, ref _tblPreClinicsInfos); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblTestEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,491 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblTreatment'.<br/><br/></summary>
[Serializable]
public partial class TblTreatmentEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private EntityCollection<TblTreatmentInfoEntity> _tblTreatmentInfos;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblTreatmentInfos</summary>
public static readonly string TblTreatmentInfos = "TblTreatmentInfos";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblTreatmentEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblTreatmentEntity():base("TblTreatmentEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblTreatmentEntity(IEntityFields2 fields):base("TblTreatmentEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblTreatmentEntity</param>
public TblTreatmentEntity(IValidator validator):base("TblTreatmentEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="treatmentId">PK value for TblTreatment which data should be fetched into this TblTreatment object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblTreatmentEntity(System.String treatmentId):base("TblTreatmentEntity")
{
InitClassEmpty(null, null);
this.TreatmentId = treatmentId;
}
/// <summary> CTor</summary>
/// <param name="treatmentId">PK value for TblTreatment which data should be fetched into this TblTreatment object</param>
/// <param name="validator">The custom validator object for this TblTreatmentEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblTreatmentEntity(System.String treatmentId, IValidator validator):base("TblTreatmentEntity")
{
InitClassEmpty(validator, null);
this.TreatmentId = treatmentId;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblTreatmentEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblTreatmentInfos = (EntityCollection<TblTreatmentInfoEntity>)info.GetValue("_tblTreatmentInfos", typeof(EntityCollection<TblTreatmentInfoEntity>));
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblTreatmentInfos":
this.TblTreatmentInfos.Add((TblTreatmentInfoEntity)entity);
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblTreatmentInfos":
toReturn.Add(Relations.TblTreatmentInfoEntityUsingTreatmentId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblTreatmentInfos":
this.TblTreatmentInfos.Add((TblTreatmentInfoEntity)relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblTreatmentInfos":
this.PerformRelatedEntityRemoval(this.TblTreatmentInfos, relatedEntity, signalRelatedEntityManyToOne);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
toReturn.Add(this.TblTreatmentInfos);
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblTreatmentInfos", ((_tblTreatmentInfos!=null) && (_tblTreatmentInfos.Count>0) && !this.MarkedForDeletion)?_tblTreatmentInfos:null);
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblTreatmentRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblTreatmentInfo' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblTreatmentInfos()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblTreatmentInfoFields.TreatmentId, null, ComparisonOperator.Equal, this.TreatmentId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblTreatmentEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
collectionsQueue.Enqueue(this._tblTreatmentInfos);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
this._tblTreatmentInfos = (EntityCollection<TblTreatmentInfoEntity>) collectionsQueue.Dequeue();
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
toReturn |=(this._tblTreatmentInfos != null);
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
collectionsQueue.Enqueue(requiredQueue.Dequeue() ? new EntityCollection<TblTreatmentInfoEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblTreatmentInfoEntityFactory))) : null);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblTreatmentInfos", _tblTreatmentInfos);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ETreatmentDes", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Sign", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TreatmentId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("VTreatmentDes", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblTreatmentEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblTreatmentRelations Relations
{
get { return new TblTreatmentRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblTreatmentInfo' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblTreatmentInfos
{
get { return new PrefetchPathElement2( new EntityCollection<TblTreatmentInfoEntity>(EntityFactoryCache2.GetEntityFactory(typeof(TblTreatmentInfoEntityFactory))), (IEntityRelation)GetRelationsForField("TblTreatmentInfos")[0], (int)Datalib.EntityType.TblTreatmentEntity, (int)Datalib.EntityType.TblTreatmentInfoEntity, 0, null, null, null, null, "TblTreatmentInfos", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The ETreatmentDes property of the Entity TblTreatment<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatments"."eTreatmentDes"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ETreatmentDes
{
get { return (System.String)GetValue((int)TblTreatmentFieldIndex.ETreatmentDes, true); }
set { SetValue((int)TblTreatmentFieldIndex.ETreatmentDes, value); }
}
/// <summary> The Sign property of the Entity TblTreatment<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatments"."Sign"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 10<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Sign
{
get { return (System.String)GetValue((int)TblTreatmentFieldIndex.Sign, true); }
set { SetValue((int)TblTreatmentFieldIndex.Sign, value); }
}
/// <summary> The TreatmentId property of the Entity TblTreatment<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatments"."TreatmentID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String TreatmentId
{
get { return (System.String)GetValue((int)TblTreatmentFieldIndex.TreatmentId, true); }
set { SetValue((int)TblTreatmentFieldIndex.TreatmentId, value); }
}
/// <summary> The VTreatmentDes property of the Entity TblTreatment<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatments"."vTreatmentDes"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String VTreatmentDes
{
get { return (System.String)GetValue((int)TblTreatmentFieldIndex.VTreatmentDes, true); }
set { SetValue((int)TblTreatmentFieldIndex.VTreatmentDes, value); }
}
/// <summary> Gets the EntityCollection with the related entities of type 'TblTreatmentInfoEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblTreatmentInfoEntity))]
public virtual EntityCollection<TblTreatmentInfoEntity> TblTreatmentInfos
{
get { return GetOrCreateEntityCollection<TblTreatmentInfoEntity, TblTreatmentInfoEntityFactory>("TblTreatment", true, false, ref _tblTreatmentInfos); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblTreatmentEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,877 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblTreatmentInfo'.<br/><br/></summary>
[Serializable]
public partial class TblTreatmentInfoEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private TblPatientEntity _tblPatient;
private TblRegimenEntity _tblRegiman;
private TblRegimenStopReasonEntity _tblRegimenStopReason;
private TblTreatmentEntity _tblTreatment;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblPatient</summary>
public static readonly string TblPatient = "TblPatient";
/// <summary>Member name TblRegiman</summary>
public static readonly string TblRegiman = "TblRegiman";
/// <summary>Member name TblRegimenStopReason</summary>
public static readonly string TblRegimenStopReason = "TblRegimenStopReason";
/// <summary>Member name TblTreatment</summary>
public static readonly string TblTreatment = "TblTreatment";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblTreatmentInfoEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblTreatmentInfoEntity():base("TblTreatmentInfoEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblTreatmentInfoEntity(IEntityFields2 fields):base("TblTreatmentInfoEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblTreatmentInfoEntity</param>
public TblTreatmentInfoEntity(IValidator validator):base("TblTreatmentInfoEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblTreatmentInfo which data should be fetched into this TblTreatmentInfo object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblTreatmentInfoEntity(System.String uniqueKey):base("TblTreatmentInfoEntity")
{
InitClassEmpty(null, null);
this.UniqueKey = uniqueKey;
}
/// <summary> CTor</summary>
/// <param name="uniqueKey">PK value for TblTreatmentInfo which data should be fetched into this TblTreatmentInfo object</param>
/// <param name="validator">The custom validator object for this TblTreatmentInfoEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblTreatmentInfoEntity(System.String uniqueKey, IValidator validator):base("TblTreatmentInfoEntity")
{
InitClassEmpty(validator, null);
this.UniqueKey = uniqueKey;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblTreatmentInfoEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_tblPatient = (TblPatientEntity)info.GetValue("_tblPatient", typeof(TblPatientEntity));
if(_tblPatient!=null)
{
_tblPatient.AfterSave+=new EventHandler(OnEntityAfterSave);
}
_tblRegiman = (TblRegimenEntity)info.GetValue("_tblRegiman", typeof(TblRegimenEntity));
if(_tblRegiman!=null)
{
_tblRegiman.AfterSave+=new EventHandler(OnEntityAfterSave);
}
_tblRegimenStopReason = (TblRegimenStopReasonEntity)info.GetValue("_tblRegimenStopReason", typeof(TblRegimenStopReasonEntity));
if(_tblRegimenStopReason!=null)
{
_tblRegimenStopReason.AfterSave+=new EventHandler(OnEntityAfterSave);
}
_tblTreatment = (TblTreatmentEntity)info.GetValue("_tblTreatment", typeof(TblTreatmentEntity));
if(_tblTreatment!=null)
{
_tblTreatment.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((TblTreatmentInfoFieldIndex)fieldIndex)
{
case TblTreatmentInfoFieldIndex.PatientId:
DesetupSyncTblPatient(true, false);
break;
case TblTreatmentInfoFieldIndex.ReasonId:
DesetupSyncTblRegimenStopReason(true, false);
break;
case TblTreatmentInfoFieldIndex.Regimenid:
DesetupSyncTblRegiman(true, false);
break;
case TblTreatmentInfoFieldIndex.TreatmentId:
DesetupSyncTblTreatment(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "TblPatient":
this.TblPatient = (TblPatientEntity)entity;
break;
case "TblRegiman":
this.TblRegiman = (TblRegimenEntity)entity;
break;
case "TblRegimenStopReason":
this.TblRegimenStopReason = (TblRegimenStopReasonEntity)entity;
break;
case "TblTreatment":
this.TblTreatment = (TblTreatmentEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "TblPatient":
toReturn.Add(Relations.TblPatientEntityUsingPatientId);
break;
case "TblRegiman":
toReturn.Add(Relations.TblRegimenEntityUsingRegimenid);
break;
case "TblRegimenStopReason":
toReturn.Add(Relations.TblRegimenStopReasonEntityUsingReasonId);
break;
case "TblTreatment":
toReturn.Add(Relations.TblTreatmentEntityUsingTreatmentId);
break;
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "TblPatient":
SetupSyncTblPatient(relatedEntity);
break;
case "TblRegiman":
SetupSyncTblRegiman(relatedEntity);
break;
case "TblRegimenStopReason":
SetupSyncTblRegimenStopReason(relatedEntity);
break;
case "TblTreatment":
SetupSyncTblTreatment(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "TblPatient":
DesetupSyncTblPatient(false, true);
break;
case "TblRegiman":
DesetupSyncTblRegiman(false, true);
break;
case "TblRegimenStopReason":
DesetupSyncTblRegimenStopReason(false, true);
break;
case "TblTreatment":
DesetupSyncTblTreatment(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_tblPatient!=null)
{
toReturn.Add(_tblPatient);
}
if(_tblRegiman!=null)
{
toReturn.Add(_tblRegiman);
}
if(_tblRegimenStopReason!=null)
{
toReturn.Add(_tblRegimenStopReason);
}
if(_tblTreatment!=null)
{
toReturn.Add(_tblTreatment);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_tblPatient", (!this.MarkedForDeletion?_tblPatient:null));
info.AddValue("_tblRegiman", (!this.MarkedForDeletion?_tblRegiman:null));
info.AddValue("_tblRegimenStopReason", (!this.MarkedForDeletion?_tblRegimenStopReason:null));
info.AddValue("_tblTreatment", (!this.MarkedForDeletion?_tblTreatment:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblTreatmentInfoRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblPatient' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblPatient()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblPatientFields.PatientId, null, ComparisonOperator.Equal, this.PatientId));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblRegimen' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblRegiman()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblRegimenFields.Regimenid, null, ComparisonOperator.Equal, this.Regimenid));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblRegimenStopReason' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblRegimenStopReason()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblRegimenStopReasonFields.ReasonId, null, ComparisonOperator.Equal, this.ReasonId));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblTreatment' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblTreatment()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TblTreatmentFields.TreatmentId, null, ComparisonOperator.Equal, this.TreatmentId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblTreatmentInfoEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("TblPatient", _tblPatient);
toReturn.Add("TblRegiman", _tblRegiman);
toReturn.Add("TblRegimenStopReason", _tblRegimenStopReason);
toReturn.Add("TblTreatment", _tblTreatment);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReasonId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Regimenid", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TreatmentEdate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TreatmentId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TreatmentSdate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("UniqueKey", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _tblPatient</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblPatient(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblTreatmentInfoRelations.TblPatientEntityUsingPatientIdStatic, true, signalRelatedEntity, "TblTreatmentInfos", resetFKFields, new int[] { (int)TblTreatmentInfoFieldIndex.PatientId } );
_tblPatient = null;
}
/// <summary> setups the sync logic for member _tblPatient</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblPatient(IEntityCore relatedEntity)
{
if(_tblPatient!=relatedEntity)
{
DesetupSyncTblPatient(true, true);
_tblPatient = (TblPatientEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblPatient, new PropertyChangedEventHandler( OnTblPatientPropertyChanged ), "TblPatient", Datalib.RelationClasses.StaticTblTreatmentInfoRelations.TblPatientEntityUsingPatientIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblPatientPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Removes the sync logic for member _tblRegiman</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblRegiman(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblRegiman, new PropertyChangedEventHandler( OnTblRegimanPropertyChanged ), "TblRegiman", Datalib.RelationClasses.StaticTblTreatmentInfoRelations.TblRegimenEntityUsingRegimenidStatic, true, signalRelatedEntity, "TblTreatmentInfos", resetFKFields, new int[] { (int)TblTreatmentInfoFieldIndex.Regimenid } );
_tblRegiman = null;
}
/// <summary> setups the sync logic for member _tblRegiman</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblRegiman(IEntityCore relatedEntity)
{
if(_tblRegiman!=relatedEntity)
{
DesetupSyncTblRegiman(true, true);
_tblRegiman = (TblRegimenEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblRegiman, new PropertyChangedEventHandler( OnTblRegimanPropertyChanged ), "TblRegiman", Datalib.RelationClasses.StaticTblTreatmentInfoRelations.TblRegimenEntityUsingRegimenidStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblRegimanPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Removes the sync logic for member _tblRegimenStopReason</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblRegimenStopReason(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblRegimenStopReason, new PropertyChangedEventHandler( OnTblRegimenStopReasonPropertyChanged ), "TblRegimenStopReason", Datalib.RelationClasses.StaticTblTreatmentInfoRelations.TblRegimenStopReasonEntityUsingReasonIdStatic, true, signalRelatedEntity, "TblTreatmentInfos", resetFKFields, new int[] { (int)TblTreatmentInfoFieldIndex.ReasonId } );
_tblRegimenStopReason = null;
}
/// <summary> setups the sync logic for member _tblRegimenStopReason</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblRegimenStopReason(IEntityCore relatedEntity)
{
if(_tblRegimenStopReason!=relatedEntity)
{
DesetupSyncTblRegimenStopReason(true, true);
_tblRegimenStopReason = (TblRegimenStopReasonEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblRegimenStopReason, new PropertyChangedEventHandler( OnTblRegimenStopReasonPropertyChanged ), "TblRegimenStopReason", Datalib.RelationClasses.StaticTblTreatmentInfoRelations.TblRegimenStopReasonEntityUsingReasonIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblRegimenStopReasonPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Removes the sync logic for member _tblTreatment</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncTblTreatment(bool signalRelatedEntity, bool resetFKFields)
{
this.PerformDesetupSyncRelatedEntity( _tblTreatment, new PropertyChangedEventHandler( OnTblTreatmentPropertyChanged ), "TblTreatment", Datalib.RelationClasses.StaticTblTreatmentInfoRelations.TblTreatmentEntityUsingTreatmentIdStatic, true, signalRelatedEntity, "TblTreatmentInfos", resetFKFields, new int[] { (int)TblTreatmentInfoFieldIndex.TreatmentId } );
_tblTreatment = null;
}
/// <summary> setups the sync logic for member _tblTreatment</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncTblTreatment(IEntityCore relatedEntity)
{
if(_tblTreatment!=relatedEntity)
{
DesetupSyncTblTreatment(true, true);
_tblTreatment = (TblTreatmentEntity)relatedEntity;
this.PerformSetupSyncRelatedEntity( _tblTreatment, new PropertyChangedEventHandler( OnTblTreatmentPropertyChanged ), "TblTreatment", Datalib.RelationClasses.StaticTblTreatmentInfoRelations.TblTreatmentEntityUsingTreatmentIdStatic, true, new string[] { } );
}
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnTblTreatmentPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblTreatmentInfoEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblTreatmentInfoRelations Relations
{
get { return new TblTreatmentInfoRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblPatient' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblPatient
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblPatientEntityFactory))), (IEntityRelation)GetRelationsForField("TblPatient")[0], (int)Datalib.EntityType.TblTreatmentInfoEntity, (int)Datalib.EntityType.TblPatientEntity, 0, null, null, null, null, "TblPatient", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblRegimen' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblRegiman
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblRegimenEntityFactory))), (IEntityRelation)GetRelationsForField("TblRegiman")[0], (int)Datalib.EntityType.TblTreatmentInfoEntity, (int)Datalib.EntityType.TblRegimenEntity, 0, null, null, null, null, "TblRegiman", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblRegimenStopReason' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblRegimenStopReason
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblRegimenStopReasonEntityFactory))), (IEntityRelation)GetRelationsForField("TblRegimenStopReason")[0], (int)Datalib.EntityType.TblTreatmentInfoEntity, (int)Datalib.EntityType.TblRegimenStopReasonEntity, 0, null, null, null, null, "TblRegimenStopReason", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblTreatment' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblTreatment
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TblTreatmentEntityFactory))), (IEntityRelation)GetRelationsForField("TblTreatment")[0], (int)Datalib.EntityType.TblTreatmentInfoEntity, (int)Datalib.EntityType.TblTreatmentEntity, 0, null, null, null, null, "TblTreatment", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The PatientId property of the Entity TblTreatmentInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatmentInfo"."PatientID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblTreatmentInfoFieldIndex.PatientId, true); }
set { SetValue((int)TblTreatmentInfoFieldIndex.PatientId, value); }
}
/// <summary> The ReasonId property of the Entity TblTreatmentInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatmentInfo"."ReasonID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String ReasonId
{
get { return (System.String)GetValue((int)TblTreatmentInfoFieldIndex.ReasonId, true); }
set { SetValue((int)TblTreatmentInfoFieldIndex.ReasonId, value); }
}
/// <summary> The Regimenid property of the Entity TblTreatmentInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatmentInfo"."Regimenid"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Regimenid
{
get { return (System.String)GetValue((int)TblTreatmentInfoFieldIndex.Regimenid, true); }
set { SetValue((int)TblTreatmentInfoFieldIndex.Regimenid, value); }
}
/// <summary> The TreatmentEdate property of the Entity TblTreatmentInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatmentInfo"."TreatmentEdate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> TreatmentEdate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblTreatmentInfoFieldIndex.TreatmentEdate, false); }
set { SetValue((int)TblTreatmentInfoFieldIndex.TreatmentEdate, value); }
}
/// <summary> The TreatmentId property of the Entity TblTreatmentInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatmentInfo"."TreatmentID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String TreatmentId
{
get { return (System.String)GetValue((int)TblTreatmentInfoFieldIndex.TreatmentId, true); }
set { SetValue((int)TblTreatmentInfoFieldIndex.TreatmentId, value); }
}
/// <summary> The TreatmentSdate property of the Entity TblTreatmentInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatmentInfo"."TreatmentSdate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> TreatmentSdate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblTreatmentInfoFieldIndex.TreatmentSdate, false); }
set { SetValue((int)TblTreatmentInfoFieldIndex.TreatmentSdate, value); }
}
/// <summary> The UniqueKey property of the Entity TblTreatmentInfo<br/><br/></summary>
/// <remarks>Mapped on table field: "tblTreatmentInfo"."UniqueKey"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueKey
{
get { return (System.String)GetValue((int)TblTreatmentInfoFieldIndex.UniqueKey, true); }
set { SetValue((int)TblTreatmentInfoFieldIndex.UniqueKey, value); }
}
/// <summary> Gets / sets related entity of type 'TblPatientEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblPatientEntity TblPatient
{
get { return _tblPatient; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblPatient(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblTreatmentInfos", "TblPatient", _tblPatient, true);
}
}
}
/// <summary> Gets / sets related entity of type 'TblRegimenEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblRegimenEntity TblRegiman
{
get { return _tblRegiman; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblRegiman(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblTreatmentInfos", "TblRegiman", _tblRegiman, true);
}
}
}
/// <summary> Gets / sets related entity of type 'TblRegimenStopReasonEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblRegimenStopReasonEntity TblRegimenStopReason
{
get { return _tblRegimenStopReason; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblRegimenStopReason(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblTreatmentInfos", "TblRegimenStopReason", _tblRegimenStopReason, true);
}
}
}
/// <summary> Gets / sets related entity of type 'TblTreatmentEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual TblTreatmentEntity TblTreatment
{
get { return _tblTreatment; }
set
{
if(this.IsDeserializing)
{
SetupSyncTblTreatment(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "TblTreatmentInfos", "TblTreatment", _tblTreatment, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblTreatmentInfoEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}

View File

@@ -0,0 +1,517 @@
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Xml.Serialization;
using Datalib;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'TblWaitingList'.<br/><br/></summary>
[Serializable]
public partial class TblWaitingListEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static TblWaitingListEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public TblWaitingListEntity():base("TblWaitingListEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblWaitingListEntity(IEntityFields2 fields):base("TblWaitingListEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblWaitingListEntity</param>
public TblWaitingListEntity(IValidator validator):base("TblWaitingListEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="patientId">PK value for TblWaitingList which data should be fetched into this TblWaitingList object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblWaitingListEntity(System.String patientId):base("TblWaitingListEntity")
{
InitClassEmpty(null, null);
this.PatientId = patientId;
}
/// <summary> CTor</summary>
/// <param name="patientId">PK value for TblWaitingList which data should be fetched into this TblWaitingList object</param>
/// <param name="validator">The custom validator object for this TblWaitingListEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public TblWaitingListEntity(System.String patientId, IValidator validator):base("TblWaitingListEntity")
{
InitClassEmpty(validator, null);
this.PatientId = patientId;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected TblWaitingListEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
default:
break;
}
return toReturn;
}
#if !CF
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
#endif
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new TblWaitingListRelations().GetAllRelations();
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(TblWaitingListEntityFactory));
}
#if !CF
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
#endif
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Arv", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("FollowNum", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("LastFolowResult", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("LateTimes", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PatientName", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ReExamDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Selected", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("Status", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("TelephoneNo", fieldHashtable);
}
#endregion
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblWaitingListEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static TblWaitingListRelations Relations
{
get { return new TblWaitingListRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The Arv property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."ARV"<br/>
/// Table field type characteristics (type, precision, scale, length): Boolean, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Boolean Arv
{
get { return (System.Boolean)GetValue((int)TblWaitingListFieldIndex.Arv, true); }
set { SetValue((int)TblWaitingListFieldIndex.Arv, value); }
}
/// <summary> The FollowNum property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."FollowNum"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String FollowNum
{
get { return (System.String)GetValue((int)TblWaitingListFieldIndex.FollowNum, true); }
set { SetValue((int)TblWaitingListFieldIndex.FollowNum, value); }
}
/// <summary> The LastFolowResult property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."lastFolowResult"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String LastFolowResult
{
get { return (System.String)GetValue((int)TblWaitingListFieldIndex.LastFolowResult, true); }
set { SetValue((int)TblWaitingListFieldIndex.LastFolowResult, value); }
}
/// <summary> The LateTimes property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."LateTimes"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String LateTimes
{
get { return (System.String)GetValue((int)TblWaitingListFieldIndex.LateTimes, true); }
set { SetValue((int)TblWaitingListFieldIndex.LateTimes, value); }
}
/// <summary> The PatientId property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."PatientID"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 15<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String PatientId
{
get { return (System.String)GetValue((int)TblWaitingListFieldIndex.PatientId, true); }
set { SetValue((int)TblWaitingListFieldIndex.PatientId, value); }
}
/// <summary> The PatientName property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."PatientName"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String PatientName
{
get { return (System.String)GetValue((int)TblWaitingListFieldIndex.PatientName, true); }
set { SetValue((int)TblWaitingListFieldIndex.PatientName, value); }
}
/// <summary> The ReExamDate property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."ReExamDate"<br/>
/// Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ReExamDate
{
get { return (Nullable<System.DateTime>)GetValue((int)TblWaitingListFieldIndex.ReExamDate, false); }
set { SetValue((int)TblWaitingListFieldIndex.ReExamDate, value); }
}
/// <summary> The Selected property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."Selected"<br/>
/// Table field type characteristics (type, precision, scale, length): Boolean, 0, 0, 2<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Boolean Selected
{
get { return (System.Boolean)GetValue((int)TblWaitingListFieldIndex.Selected, true); }
set { SetValue((int)TblWaitingListFieldIndex.Selected, value); }
}
/// <summary> The Status property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."Status"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 50<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Status
{
get { return (System.String)GetValue((int)TblWaitingListFieldIndex.Status, true); }
set { SetValue((int)TblWaitingListFieldIndex.Status, value); }
}
/// <summary> The TelephoneNo property of the Entity TblWaitingList<br/><br/></summary>
/// <remarks>Mapped on table field: "tblWaitingList"."TelephoneNo"<br/>
/// Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 20<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String TelephoneNo
{
get { return (System.String)GetValue((int)TblWaitingListFieldIndex.TelephoneNo, true); }
set { SetValue((int)TblWaitingListFieldIndex.TelephoneNo, value); }
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the Datalib.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)Datalib.EntityType.TblWaitingListEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}