1313 lines
44 KiB
C#
1313 lines
44 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Kreta.DataAccess.Interfaces;
|
|
using Kreta.Framework;
|
|
using Kreta.Framework.Actions;
|
|
using Kreta.Framework.Collections;
|
|
using Kreta.Framework.Collections.Generic;
|
|
using Kreta.Framework.Entities;
|
|
using Kreta.Framework.Entities.Generic;
|
|
using Kreta.Framework.Exceptions;
|
|
|
|
namespace SDA.Kreta.Entities
|
|
{
|
|
/// <summary>
|
|
/// Az UML modell TanuloMentesseg entitásának megvalósítása.
|
|
/// </summary>
|
|
/// <remarks>A kód teljes egészében generált, kézi módosítása nem megengedett!</remarks>
|
|
[Entity("TanuloMentesseg")]
|
|
// alapértelmezett EntityHistoryMode
|
|
public class TanuloMentesseg : Entity, ITanuloMentesseg
|
|
{
|
|
internal protected TanuloMentesseg()
|
|
: base()
|
|
{
|
|
}
|
|
|
|
public class AttributeInfo
|
|
{
|
|
public const string ErtekelesMentesites = "ErtekelesMentesites";
|
|
public const string Kezdete = "Kezdete";
|
|
public const string MentessegOka = "MentessegOka";
|
|
public const string OraMentesites = "OraMentesites";
|
|
public const string Vege = "Vege";
|
|
public const string SzovegesenErtekelheto = "SzovegesenErtekelheto";
|
|
public const string FelmentesRogzitesIdopontja = "FelmentesRogzitesIdopontja";
|
|
public const string UtolsoModositasIdopontja = "UtolsoModositasIdopontja";
|
|
public const string FelmentesRogzitoTanarNev = "FelmentesRogzitoTanarNev";
|
|
}
|
|
|
|
public class AttributeLengthInfo
|
|
{
|
|
public const int MentessegOkaLength = 2147483647;
|
|
public const int FelmentesRogzitoTanarNevLength = 255;
|
|
}
|
|
|
|
#region General
|
|
private TanuloMentessegDA m_DA = new TanuloMentessegDA();
|
|
|
|
protected static TanuloMentesseg FakeTanuloMentesseg { get; set; }
|
|
|
|
public static TanuloMentesseg GiveAnInstance()
|
|
{
|
|
TanuloMentesseg result = FakeTanuloMentesseg == null
|
|
? new TanuloMentesseg()
|
|
: (TanuloMentesseg)FakeTanuloMentesseg.MemberwiseClone();
|
|
result.Reset();
|
|
result.SetDefaultData();
|
|
|
|
return result;
|
|
}
|
|
|
|
protected void SetDefaultData()
|
|
{
|
|
if (UserContext.Instance != null)
|
|
{
|
|
if (UserContext.Instance.IntezmenyId > 0)
|
|
{
|
|
IntezmenyId = UserContext.Instance.IntezmenyId;
|
|
}
|
|
|
|
if (UserContext.Instance.AktivTanevId > 0)
|
|
{
|
|
TanevId = UserContext.Instance.AktivTanevId;
|
|
}
|
|
|
|
m_State = EntityState.Uninitialized;
|
|
}
|
|
}
|
|
|
|
protected override IEntityDataAccessor GetDataAccessor() { return m_DA; }
|
|
protected internal virtual IEntityDataAccessor InheritedDA { get { return null; } }
|
|
|
|
[Obsolete("Ezt ne használjátok, mert mindenhova bele kellene fogalmazni a tanév szűrést is! Meg fog majd szűnni!")]
|
|
public static IEntityCollection<TanuloMentesseg> LoadAll()
|
|
{
|
|
return LoadWithFilter("");
|
|
}
|
|
|
|
[Obsolete("Ezt ne használjátok, mert mindenhova bele kellene fogalmazni a tanév szűrést is! Meg fog majd szűnni!")]
|
|
public static IEntityCollection<TanuloMentesseg> LoadAll(ColumnFilterMode columnFilterMode, IEnumerable<string> columns)
|
|
{
|
|
return LoadWithFilter("", columnFilterMode, columns);
|
|
}
|
|
|
|
[Obsolete("Ezt ne használjátok, mert mindenhova bele kellene fogalmazni a tanév szűrést is! Meg fog majd szűnni!")]
|
|
public static IEntityCollection<TanuloMentesseg> LoadWithFilter(string filter, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<TanuloMentesseg>();
|
|
new TanuloMentessegDA().LoadWithFilter(result, filter, commandParameters);
|
|
return result;
|
|
}
|
|
|
|
[Obsolete("Ezt ne használjátok, mert mindenhova bele kellene fogalmazni a tanév szűrést is! Meg fog majd szűnni!")]
|
|
public static IEntityCollection<TanuloMentesseg> LoadWithFilter(string filter, ColumnFilterMode columnFilterMode, IEnumerable<string> columns, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<TanuloMentesseg>();
|
|
new TanuloMentessegDA().LoadWithFilter(result, filter, columnFilterMode, columns, commandParameters);
|
|
return result;
|
|
}
|
|
|
|
protected override void StoreOriginalValues()
|
|
{
|
|
base.StoreOriginalValues();
|
|
OriginalValues.Add("ErtekelesMentesites", (ErtekelesMentesites == null ? (object)DBNull.Value : (object)m_ErtekelesMentesites));
|
|
OriginalValues.Add("Kezdete", (Kezdete == null ? (object)DBNull.Value : (object)m_Kezdete));
|
|
OriginalValues.Add("MentessegOka", (MentessegOka == null ? (object)DBNull.Value : (object)m_MentessegOka));
|
|
OriginalValues.Add("OraMentesites", (OraMentesites == null ? (object)DBNull.Value : (object)m_OraMentesites));
|
|
OriginalValues.Add("Vege", (Vege == null ? (object)DBNull.Value : (object)m_Vege));
|
|
OriginalValues.Add("SzovegesenErtekelheto", (SzovegesenErtekelheto == null ? (object)DBNull.Value : (object)m_SzovegesenErtekelheto));
|
|
OriginalValues.Add("FelmentesRogzitesIdopontja", (FelmentesRogzitesIdopontja == null ? (object)DBNull.Value : (object)m_FelmentesRogzitesIdopontja));
|
|
OriginalValues.Add("UtolsoModositasIdopontja", (UtolsoModositasIdopontja == null ? (object)DBNull.Value : (object)m_UtolsoModositasIdopontja));
|
|
OriginalValues.Add("FelmentesRogzitoTanarNev", (FelmentesRogzitoTanarNev == null ? (object)DBNull.Value : (object)m_FelmentesRogzitoTanarNev));
|
|
OriginalValues.Add("TantargyId", (m_TantargyId < 0 ? (object)DBNull.Value : (object)m_TantargyId));
|
|
OriginalValues.Add("TanuloId", (m_TanuloId < 0 ? (object)DBNull.Value : (object)m_TanuloId));
|
|
OriginalValues.Add("FelmentesRogzitoTanarId", (m_FelmentesRogzitoTanarId < 0 ? (object)DBNull.Value : (object)m_FelmentesRogzitoTanarId));
|
|
OriginalValues.Add("UtolsoModositoTanarId", (m_UtolsoModositoTanarId < 0 ? (object)DBNull.Value : (object)m_UtolsoModositoTanarId));
|
|
OriginalValues.Add("IntezmenyId", (m_IntezmenyId < 0 ? (object)DBNull.Value : (object)m_IntezmenyId));
|
|
OriginalValues.Add("TanevId", (m_TanevId < 0 ? (object)DBNull.Value : (object)m_TanevId));
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region Ellenőrzés
|
|
|
|
protected override void Validate(bool skipValidateAttributes = false)
|
|
{
|
|
base.Validate();
|
|
|
|
if (!skipValidateAttributes)
|
|
{
|
|
// korlátos hosszúságú mezők ellenőrzése...
|
|
if (m_MentessegOka != null && m_MentessegOka.Length > 2147483647)
|
|
{
|
|
throw new InvalidEntityAttributeException("TanuloMentesseg", "MentessegOka", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_FelmentesRogzitoTanarNev != null && m_FelmentesRogzitoTanarNev.Length > 255)
|
|
{
|
|
throw new InvalidEntityAttributeException("TanuloMentesseg", "FelmentesRogzitoTanarNev", EntityAttributeError.TooLong);
|
|
}
|
|
|
|
}
|
|
|
|
// kötelező asszociációk ellenőrzése...
|
|
if (m_TantargyId == -1) { throw new InvalidEntityAttributeException("TanuloMentesseg", "TantargyId", EntityAttributeError.Empty); }
|
|
if (m_TanuloId == -1) { throw new InvalidEntityAttributeException("TanuloMentesseg", "TanuloId", EntityAttributeError.Empty); }
|
|
if (m_IntezmenyId == -1) { throw new InvalidEntityAttributeException("TanuloMentesseg", "IntezmenyId", EntityAttributeError.Empty); }
|
|
if (m_TanevId == -1) { throw new InvalidEntityAttributeException("TanuloMentesseg", "TanevId", EntityAttributeError.Empty); }
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Alaphelyzetbe állítás
|
|
protected override void Reset()
|
|
{
|
|
base.Reset();
|
|
|
|
// alaphelyzetbe állítjuk az egyszerű mezőket
|
|
this.m_ErtekelesMentesites = null;
|
|
this.m_Kezdete = null;
|
|
this.m_MentessegOka = null;
|
|
this.m_OraMentesites = null;
|
|
this.m_Vege = null;
|
|
this.m_SzovegesenErtekelheto = null;
|
|
this.m_FelmentesRogzitesIdopontja = null;
|
|
this.m_UtolsoModositasIdopontja = null;
|
|
this.m_FelmentesRogzitoTanarNev = null;
|
|
|
|
// alaphelyzetbe állítjuk az asszociációkból származó mezőket
|
|
this.m_TantargyId = -1;
|
|
this.m_Tantargy = null; // Entity
|
|
this.m_TanuloId = -1;
|
|
this.m_Tanulo = null; // Entity
|
|
this.m_FelmentesRogzitoTanarId = -1;
|
|
this.m_FelmentesRogzitoTanar = null; // Entity
|
|
this.m_UtolsoModositoTanarId = -1;
|
|
this.m_UtolsoModositoTanar = null; // Entity
|
|
this.m_IntezmenyId = -1;
|
|
this.m_Intezmeny = null; // Entity
|
|
this.m_TanevId = -1;
|
|
this.m_Tanev = null; // Entity
|
|
}
|
|
|
|
#endregion
|
|
|
|
protected override void DeAssociateBeforeDelete(bool runHandler = false)
|
|
{
|
|
// Nem kaszkád törölhető asszociációk ellenőrzése, hogy üresek-e...
|
|
|
|
// Tantargy esetében mi mutatunk a másikra: startrole: *, endrole: 1
|
|
// Tanulo esetében mi mutatunk a másikra: startrole: *, endrole: 1
|
|
// FelmentesRogzitoTanar esetében mi mutatunk a másikra: startrole: *, endrole: 0..1
|
|
// UtolsoModositoTanar esetében mi mutatunk a másikra: startrole: *, endrole: 0..1
|
|
// Intezmeny esetében mi mutatunk a másikra: startrole: *, endrole: 1
|
|
// Tanev esetében mi mutatunk a másikra: startrole: *, endrole: 1
|
|
|
|
// kaszkád törlések...
|
|
|
|
}
|
|
|
|
#region Mezők és tulajdonságok
|
|
|
|
#region Egyszerű mezők
|
|
|
|
#region ErtekelesMentesites
|
|
|
|
protected internal bool? m_ErtekelesMentesites;
|
|
|
|
/// <summary>
|
|
/// Értékelés alól mentesítve
|
|
/// </summary>
|
|
[EntityProperty("ErtekelesMentesites", EntityPropertyBaseType.ValueType, typeof(bool), EntityCopyMethod.ShallowCopy)]
|
|
public virtual bool? ErtekelesMentesites
|
|
{
|
|
get
|
|
{
|
|
return m_ErtekelesMentesites;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_ErtekelesMentesites == value) return;
|
|
m_ErtekelesMentesites = value;
|
|
FieldModified("ErtekelesMentesites", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kezdete
|
|
|
|
protected internal DateTime? m_Kezdete;
|
|
|
|
/// <summary>
|
|
/// kezdete
|
|
/// </summary>
|
|
[EntityProperty("Kezdete", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime? Kezdete
|
|
{
|
|
get
|
|
{
|
|
return m_Kezdete;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kezdete == value) return;
|
|
m_Kezdete = value;
|
|
FieldModified("Kezdete", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region MentessegOka
|
|
|
|
protected internal string m_MentessegOka;
|
|
|
|
/// <summary>
|
|
/// mentesség oka
|
|
/// </summary>
|
|
[EntityProperty("MentessegOka", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string MentessegOka
|
|
{
|
|
get
|
|
{
|
|
return m_MentessegOka;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_MentessegOka == value) return;
|
|
m_MentessegOka = value;
|
|
FieldModified("MentessegOka", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region OraMentesites
|
|
|
|
protected internal bool? m_OraMentesites;
|
|
|
|
/// <summary>
|
|
/// Tanóra látogatása alól mentesítve
|
|
/// </summary>
|
|
[EntityProperty("OraMentesites", EntityPropertyBaseType.ValueType, typeof(bool), EntityCopyMethod.ShallowCopy)]
|
|
public virtual bool? OraMentesites
|
|
{
|
|
get
|
|
{
|
|
return m_OraMentesites;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_OraMentesites == value) return;
|
|
m_OraMentesites = value;
|
|
FieldModified("OraMentesites", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Vege
|
|
|
|
protected internal DateTime? m_Vege;
|
|
|
|
/// <summary>
|
|
/// vége
|
|
/// </summary>
|
|
[EntityProperty("Vege", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime? Vege
|
|
{
|
|
get
|
|
{
|
|
return m_Vege;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Vege == value) return;
|
|
m_Vege = value;
|
|
FieldModified("Vege", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SzovegesenErtekelheto
|
|
|
|
protected internal bool? m_SzovegesenErtekelheto;
|
|
|
|
/// <summary>
|
|
/// szövegesen értékelheto
|
|
/// </summary>
|
|
[EntityProperty("SzovegesenErtekelheto", EntityPropertyBaseType.ValueType, typeof(bool), EntityCopyMethod.ShallowCopy)]
|
|
public virtual bool? SzovegesenErtekelheto
|
|
{
|
|
get
|
|
{
|
|
return m_SzovegesenErtekelheto;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_SzovegesenErtekelheto == value) return;
|
|
m_SzovegesenErtekelheto = value;
|
|
FieldModified("SzovegesenErtekelheto", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region FelmentesRogzitesIdopontja
|
|
|
|
protected internal DateTime? m_FelmentesRogzitesIdopontja;
|
|
|
|
/// <summary>
|
|
/// Felmentés rögzítésének idopontja
|
|
/// </summary>
|
|
[EntityProperty("FelmentesRogzitesIdopontja", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime? FelmentesRogzitesIdopontja
|
|
{
|
|
get
|
|
{
|
|
return m_FelmentesRogzitesIdopontja;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_FelmentesRogzitesIdopontja == value) return;
|
|
m_FelmentesRogzitesIdopontja = value;
|
|
FieldModified("FelmentesRogzitesIdopontja", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region UtolsoModositasIdopontja
|
|
|
|
protected internal DateTime? m_UtolsoModositasIdopontja;
|
|
|
|
/// <summary>
|
|
/// Utolsó módosítás idopontja
|
|
/// </summary>
|
|
[EntityProperty("UtolsoModositasIdopontja", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime? UtolsoModositasIdopontja
|
|
{
|
|
get
|
|
{
|
|
return m_UtolsoModositasIdopontja;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_UtolsoModositasIdopontja == value) return;
|
|
m_UtolsoModositasIdopontja = value;
|
|
FieldModified("UtolsoModositasIdopontja", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region FelmentesRogzitoTanarNev
|
|
|
|
protected internal string m_FelmentesRogzitoTanarNev;
|
|
|
|
/// <summary>
|
|
/// Rögzítő felhasználó neve (ha archivált DB-ben van)
|
|
/// </summary>
|
|
[EntityProperty("FelmentesRogzitoTanarNev", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string FelmentesRogzitoTanarNev
|
|
{
|
|
get
|
|
{
|
|
return m_FelmentesRogzitoTanarNev;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_FelmentesRogzitoTanarNev == value) return;
|
|
m_FelmentesRogzitoTanarNev = value;
|
|
FieldModified("FelmentesRogzitoTanarNev", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region Asszociációkkal kapcsolatos dolgok
|
|
|
|
#region TanuloMentesseg (*) -> Tantargy (1)
|
|
|
|
protected internal int m_TantargyId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) Tantargy asszociáció végpontjának ID-ja.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// - Insert() előtt célszerű kitölteni
|
|
/// - Update() nincs rá hatással: ezt a mezőt nem frissíti
|
|
/// - LoadByID() felhozza ezt a mezőt
|
|
/// </remarks>
|
|
public virtual int TantargyId
|
|
{
|
|
get
|
|
{
|
|
return InternalTantargyId;
|
|
}
|
|
set
|
|
{
|
|
InternalTantargyId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalTantargyId
|
|
{
|
|
get
|
|
{
|
|
if (m_Tantargy != null)
|
|
{
|
|
return m_Tantargy.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_TantargyId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_TantargyId != value)
|
|
{
|
|
m_TantargyId = value;
|
|
m_Tantargy = null;
|
|
FieldModified("TantargyId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyTantargy(Tantargy value)
|
|
{
|
|
m_TantargyId = value != null ? value.ID : -1;
|
|
m_Tantargy = value;
|
|
FieldModified("TantargyId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetTantargy(Tantargy value)
|
|
{
|
|
m_Tantargy = value;
|
|
if (value != null)
|
|
{
|
|
m_TantargyId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_TantargyId = -1;
|
|
}
|
|
}
|
|
|
|
protected Tantargy m_Tantargy = null;
|
|
|
|
ITantargy ITanuloMentesseg.Tantargy
|
|
{
|
|
get { return Tantargy; }
|
|
set { Tantargy = value as Tantargy; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TanuloMentesseg és Tantargy entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("Tantargy", EntityPropertyBaseType.Entity, typeof(Tantargy), EntityCopyMethod.ShallowCopy)]
|
|
public virtual Tantargy Tantargy
|
|
{
|
|
get
|
|
{
|
|
if ((m_Tantargy == null) && (m_TantargyId != -1))
|
|
{
|
|
SDA.Kreta.Entities.Tantargy partner = SDA.Kreta.Entities.Tantargy.GiveAnInstance();
|
|
partner.LoadByID(m_TantargyId);
|
|
|
|
this.SetTantargy(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_Tantargy;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_Tantargy == null) || (value.ID != m_Tantargy.ID))
|
|
{
|
|
if (value.State != EntityState.Initialized)
|
|
{
|
|
throw new EntityStateException(value.State);
|
|
}
|
|
if ((this.State != EntityState.New))
|
|
{
|
|
// Lista van a másik oldalon, úgyhogy a lista DA-ját használjuk
|
|
SDA.Kreta.Entities.Tantargy_TanuloMentesseg_DA da = new Tantargy_TanuloMentesseg_DA(value);
|
|
da.AddItem(this);
|
|
this.SetTantargy(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetTantargy(value);
|
|
}
|
|
FieldModified("TantargyId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetTantargy(null);
|
|
UpdateAssociations();
|
|
FieldModified("TantargyId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region TanuloMentesseg (*) -> Tanulo (1)
|
|
|
|
protected internal int m_TanuloId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) Tanulo asszociáció végpontjának ID-ja.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// - Insert() előtt célszerű kitölteni
|
|
/// - Update() nincs rá hatással: ezt a mezőt nem frissíti
|
|
/// - LoadByID() felhozza ezt a mezőt
|
|
/// </remarks>
|
|
public virtual int TanuloId
|
|
{
|
|
get
|
|
{
|
|
return InternalTanuloId;
|
|
}
|
|
set
|
|
{
|
|
InternalTanuloId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalTanuloId
|
|
{
|
|
get
|
|
{
|
|
if (m_Tanulo != null)
|
|
{
|
|
return m_Tanulo.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_TanuloId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_TanuloId != value)
|
|
{
|
|
m_TanuloId = value;
|
|
m_Tanulo = null;
|
|
FieldModified("TanuloId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyTanulo(Tanulo value)
|
|
{
|
|
m_TanuloId = value != null ? value.ID : -1;
|
|
m_Tanulo = value;
|
|
FieldModified("TanuloId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetTanulo(Tanulo value)
|
|
{
|
|
m_Tanulo = value;
|
|
if (value != null)
|
|
{
|
|
m_TanuloId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_TanuloId = -1;
|
|
}
|
|
}
|
|
|
|
protected Tanulo m_Tanulo = null;
|
|
|
|
ITanulo ITanuloMentesseg.Tanulo
|
|
{
|
|
get { return Tanulo; }
|
|
set { Tanulo = value as Tanulo; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TanuloMentesseg és Tanulo entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("Tanulo", EntityPropertyBaseType.Entity, typeof(Tanulo), EntityCopyMethod.ShallowCopy)]
|
|
public virtual Tanulo Tanulo
|
|
{
|
|
get
|
|
{
|
|
if ((m_Tanulo == null) && (m_TanuloId != -1))
|
|
{
|
|
SDA.Kreta.Entities.Tanulo partner = SDA.Kreta.Entities.Tanulo.GiveAnInstance();
|
|
partner.LoadByID(m_TanuloId);
|
|
|
|
this.SetTanulo(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_Tanulo;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_Tanulo == null) || (value.ID != m_Tanulo.ID))
|
|
{
|
|
if (value.State != EntityState.Initialized)
|
|
{
|
|
throw new EntityStateException(value.State);
|
|
}
|
|
if ((this.State != EntityState.New))
|
|
{
|
|
// Lista van a másik oldalon, úgyhogy a lista DA-ját használjuk
|
|
SDA.Kreta.Entities.Tanulo_TanuloMentesseg_DA da = new Tanulo_TanuloMentesseg_DA(value);
|
|
da.AddItem(this);
|
|
this.SetTanulo(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetTanulo(value);
|
|
}
|
|
FieldModified("TanuloId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetTanulo(null);
|
|
UpdateAssociations();
|
|
FieldModified("TanuloId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region TanuloMentesseg (*) -> Felhasznalo (0..1)
|
|
|
|
protected internal int m_FelmentesRogzitoTanarId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) FelmentesRogzitoTanar asszociáció végpontjának ID-ja.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// - Insert() előtt célszerű kitölteni
|
|
/// - Update() nincs rá hatással: ezt a mezőt nem frissíti
|
|
/// - LoadByID() felhozza ezt a mezőt
|
|
/// </remarks>
|
|
public virtual int FelmentesRogzitoTanarId
|
|
{
|
|
get
|
|
{
|
|
return InternalFelmentesRogzitoTanarId;
|
|
}
|
|
set
|
|
{
|
|
InternalFelmentesRogzitoTanarId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalFelmentesRogzitoTanarId
|
|
{
|
|
get
|
|
{
|
|
if (m_FelmentesRogzitoTanar != null)
|
|
{
|
|
return m_FelmentesRogzitoTanar.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_FelmentesRogzitoTanarId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_FelmentesRogzitoTanarId != value)
|
|
{
|
|
m_FelmentesRogzitoTanarId = value;
|
|
m_FelmentesRogzitoTanar = null;
|
|
FieldModified("FelmentesRogzitoTanarId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyFelmentesRogzitoTanar(Felhasznalo value)
|
|
{
|
|
m_FelmentesRogzitoTanarId = value != null ? value.ID : -1;
|
|
m_FelmentesRogzitoTanar = value;
|
|
FieldModified("FelmentesRogzitoTanarId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetFelmentesRogzitoTanar(Felhasznalo value)
|
|
{
|
|
m_FelmentesRogzitoTanar = value;
|
|
if (value != null)
|
|
{
|
|
m_FelmentesRogzitoTanarId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_FelmentesRogzitoTanarId = -1;
|
|
}
|
|
}
|
|
|
|
protected Felhasznalo m_FelmentesRogzitoTanar = null;
|
|
|
|
IFelhasznalo ITanuloMentesseg.FelmentesRogzitoTanar
|
|
{
|
|
get { return FelmentesRogzitoTanar; }
|
|
set { FelmentesRogzitoTanar = value as Felhasznalo; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TanuloMentesseg és Felhasznalo entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("FelmentesRogzitoTanar", EntityPropertyBaseType.Entity, typeof(Felhasznalo), EntityCopyMethod.ShallowCopy)]
|
|
public virtual Felhasznalo FelmentesRogzitoTanar
|
|
{
|
|
get
|
|
{
|
|
if ((m_FelmentesRogzitoTanar == null) && (m_FelmentesRogzitoTanarId != -1))
|
|
{
|
|
SDA.Kreta.Entities.Felhasznalo partner = SDA.Kreta.Entities.Felhasznalo.GiveAnInstance();
|
|
partner.LoadByID(m_FelmentesRogzitoTanarId);
|
|
|
|
this.SetFelmentesRogzitoTanar(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_FelmentesRogzitoTanar;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_FelmentesRogzitoTanar == null) || (value.ID != m_FelmentesRogzitoTanar.ID))
|
|
{
|
|
if (value.State != EntityState.Initialized)
|
|
{
|
|
throw new EntityStateException(value.State);
|
|
}
|
|
if ((this.State != EntityState.New))
|
|
{
|
|
// Lista van a másik oldalon, úgyhogy a lista DA-ját használjuk
|
|
SDA.Kreta.Entities.Felhasznalo_RogzitettFelmentesek_DA da = new Felhasznalo_RogzitettFelmentesek_DA(value);
|
|
da.AddItem(this);
|
|
this.SetFelmentesRogzitoTanar(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetFelmentesRogzitoTanar(value);
|
|
}
|
|
FieldModified("FelmentesRogzitoTanarId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetFelmentesRogzitoTanar(null);
|
|
UpdateAssociations();
|
|
FieldModified("FelmentesRogzitoTanarId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region TanuloMentesseg (*) -> Felhasznalo (0..1)
|
|
|
|
protected internal int m_UtolsoModositoTanarId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) UtolsoModositoTanar asszociáció végpontjának ID-ja.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// - Insert() előtt célszerű kitölteni
|
|
/// - Update() nincs rá hatással: ezt a mezőt nem frissíti
|
|
/// - LoadByID() felhozza ezt a mezőt
|
|
/// </remarks>
|
|
public virtual int UtolsoModositoTanarId
|
|
{
|
|
get
|
|
{
|
|
return InternalUtolsoModositoTanarId;
|
|
}
|
|
set
|
|
{
|
|
InternalUtolsoModositoTanarId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalUtolsoModositoTanarId
|
|
{
|
|
get
|
|
{
|
|
if (m_UtolsoModositoTanar != null)
|
|
{
|
|
return m_UtolsoModositoTanar.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_UtolsoModositoTanarId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_UtolsoModositoTanarId != value)
|
|
{
|
|
m_UtolsoModositoTanarId = value;
|
|
m_UtolsoModositoTanar = null;
|
|
FieldModified("UtolsoModositoTanarId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyUtolsoModositoTanar(Felhasznalo value)
|
|
{
|
|
m_UtolsoModositoTanarId = value != null ? value.ID : -1;
|
|
m_UtolsoModositoTanar = value;
|
|
FieldModified("UtolsoModositoTanarId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetUtolsoModositoTanar(Felhasznalo value)
|
|
{
|
|
m_UtolsoModositoTanar = value;
|
|
if (value != null)
|
|
{
|
|
m_UtolsoModositoTanarId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_UtolsoModositoTanarId = -1;
|
|
}
|
|
}
|
|
|
|
protected Felhasznalo m_UtolsoModositoTanar = null;
|
|
|
|
IFelhasznalo ITanuloMentesseg.UtolsoModositoTanar
|
|
{
|
|
get { return UtolsoModositoTanar; }
|
|
set { UtolsoModositoTanar = value as Felhasznalo; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TanuloMentesseg és Felhasznalo entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("UtolsoModositoTanar", EntityPropertyBaseType.Entity, typeof(Felhasznalo), EntityCopyMethod.ShallowCopy)]
|
|
public virtual Felhasznalo UtolsoModositoTanar
|
|
{
|
|
get
|
|
{
|
|
if ((m_UtolsoModositoTanar == null) && (m_UtolsoModositoTanarId != -1))
|
|
{
|
|
SDA.Kreta.Entities.Felhasznalo partner = SDA.Kreta.Entities.Felhasznalo.GiveAnInstance();
|
|
partner.LoadByID(m_UtolsoModositoTanarId);
|
|
|
|
this.SetUtolsoModositoTanar(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_UtolsoModositoTanar;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_UtolsoModositoTanar == null) || (value.ID != m_UtolsoModositoTanar.ID))
|
|
{
|
|
if (value.State != EntityState.Initialized)
|
|
{
|
|
throw new EntityStateException(value.State);
|
|
}
|
|
if ((this.State != EntityState.New))
|
|
{
|
|
// Lista van a másik oldalon, úgyhogy a lista DA-ját használjuk
|
|
SDA.Kreta.Entities.Felhasznalo_ModositottFelmentesek_DA da = new Felhasznalo_ModositottFelmentesek_DA(value);
|
|
da.AddItem(this);
|
|
this.SetUtolsoModositoTanar(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetUtolsoModositoTanar(value);
|
|
}
|
|
FieldModified("UtolsoModositoTanarId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetUtolsoModositoTanar(null);
|
|
UpdateAssociations();
|
|
FieldModified("UtolsoModositoTanarId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region TanuloMentesseg (*) -> Intezmeny (1)
|
|
|
|
protected internal int m_IntezmenyId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) Intezmeny asszociáció végpontjának ID-ja.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// - Insert() előtt célszerű kitölteni
|
|
/// - Update() nincs rá hatással: ezt a mezőt nem frissíti
|
|
/// - LoadByID() felhozza ezt a mezőt
|
|
/// </remarks>
|
|
public virtual int IntezmenyId
|
|
{
|
|
get
|
|
{
|
|
return InternalIntezmenyId;
|
|
}
|
|
set
|
|
{
|
|
InternalIntezmenyId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalIntezmenyId
|
|
{
|
|
get
|
|
{
|
|
if (m_Intezmeny != null)
|
|
{
|
|
return m_Intezmeny.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_IntezmenyId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_IntezmenyId != value)
|
|
{
|
|
m_IntezmenyId = value;
|
|
m_Intezmeny = null;
|
|
FieldModified("IntezmenyId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyIntezmeny(Intezmeny value)
|
|
{
|
|
m_IntezmenyId = value != null ? value.ID : -1;
|
|
m_Intezmeny = value;
|
|
FieldModified("IntezmenyId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetIntezmeny(Intezmeny value)
|
|
{
|
|
m_Intezmeny = value;
|
|
if (value != null)
|
|
{
|
|
m_IntezmenyId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_IntezmenyId = -1;
|
|
}
|
|
}
|
|
|
|
protected Intezmeny m_Intezmeny = null;
|
|
|
|
IIntezmeny ITanuloMentesseg.Intezmeny
|
|
{
|
|
get { return Intezmeny; }
|
|
set { Intezmeny = value as Intezmeny; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TanuloMentesseg és Intezmeny entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("Intezmeny", EntityPropertyBaseType.Entity, typeof(Intezmeny), EntityCopyMethod.ShallowCopy)]
|
|
public virtual Intezmeny Intezmeny
|
|
{
|
|
get
|
|
{
|
|
if ((m_Intezmeny == null) && (m_IntezmenyId != -1))
|
|
{
|
|
SDA.Kreta.Entities.Intezmeny partner = SDA.Kreta.Entities.Intezmeny.GiveAnInstance();
|
|
partner.LoadByID(m_IntezmenyId);
|
|
|
|
this.SetIntezmeny(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_Intezmeny;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_Intezmeny == null) || (value.ID != m_Intezmeny.ID))
|
|
{
|
|
if (value.State != EntityState.Initialized)
|
|
{
|
|
throw new EntityStateException(value.State);
|
|
}
|
|
if ((this.State != EntityState.New))
|
|
{
|
|
// Lista van a másik oldalon, úgyhogy a lista DA-ját használjuk
|
|
SDA.Kreta.Entities.Intezmeny_TanuloMentesseg_DA da = new Intezmeny_TanuloMentesseg_DA(value);
|
|
da.AddItem(this);
|
|
this.SetIntezmeny(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetIntezmeny(value);
|
|
}
|
|
FieldModified("IntezmenyId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetIntezmeny(null);
|
|
UpdateAssociations();
|
|
FieldModified("IntezmenyId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region TanuloMentesseg (*) -> Tanev (1)
|
|
|
|
protected internal int m_TanevId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) Tanev asszociáció végpontjának ID-ja.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// - Insert() előtt célszerű kitölteni
|
|
/// - Update() nincs rá hatással: ezt a mezőt nem frissíti
|
|
/// - LoadByID() felhozza ezt a mezőt
|
|
/// </remarks>
|
|
public virtual int TanevId
|
|
{
|
|
get
|
|
{
|
|
return InternalTanevId;
|
|
}
|
|
set
|
|
{
|
|
InternalTanevId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalTanevId
|
|
{
|
|
get
|
|
{
|
|
if (m_Tanev != null)
|
|
{
|
|
return m_Tanev.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_TanevId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_TanevId != value)
|
|
{
|
|
m_TanevId = value;
|
|
m_Tanev = null;
|
|
FieldModified("TanevId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyTanev(Tanev value)
|
|
{
|
|
m_TanevId = value != null ? value.ID : -1;
|
|
m_Tanev = value;
|
|
FieldModified("TanevId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetTanev(Tanev value)
|
|
{
|
|
m_Tanev = value;
|
|
if (value != null)
|
|
{
|
|
m_TanevId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_TanevId = -1;
|
|
}
|
|
}
|
|
|
|
protected Tanev m_Tanev = null;
|
|
|
|
ITanev ITanuloMentesseg.Tanev
|
|
{
|
|
get { return Tanev; }
|
|
set { Tanev = value as Tanev; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TanuloMentesseg és Tanev entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("Tanev", EntityPropertyBaseType.Entity, typeof(Tanev), EntityCopyMethod.ShallowCopy)]
|
|
public virtual Tanev Tanev
|
|
{
|
|
get
|
|
{
|
|
if ((m_Tanev == null) && (m_TanevId != -1))
|
|
{
|
|
SDA.Kreta.Entities.Tanev partner = SDA.Kreta.Entities.Tanev.GiveAnInstance();
|
|
partner.LoadByID(m_TanevId);
|
|
|
|
this.SetTanev(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_Tanev;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_Tanev == null) || (value.ID != m_Tanev.ID))
|
|
{
|
|
if (value.State != EntityState.Initialized)
|
|
{
|
|
throw new EntityStateException(value.State);
|
|
}
|
|
if ((this.State != EntityState.New))
|
|
{
|
|
// Lista van a másik oldalon, úgyhogy a lista DA-ját használjuk
|
|
SDA.Kreta.Entities.Tanev_TanuloMentesseg_DA da = new Tanev_TanuloMentesseg_DA(value);
|
|
da.AddItem(this);
|
|
this.SetTanev(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetTanev(value);
|
|
}
|
|
FieldModified("TanevId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetTanev(null);
|
|
UpdateAssociations();
|
|
FieldModified("TanevId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
}
|
|
}
|
|
|