770 lines
25 KiB
C#
770 lines
25 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 KIRKontenerStatusz 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("KIRKontenerStatusz")]
|
|
// alapértelmezett EntityHistoryMode
|
|
public class KIRKontenerStatusz : Entity, IKIRKontenerStatusz
|
|
{
|
|
internal protected KIRKontenerStatusz()
|
|
: base()
|
|
{
|
|
}
|
|
|
|
public class AttributeInfo
|
|
{
|
|
public const string MessageCode = "MessageCode";
|
|
public const string MessageSource = "MessageSource";
|
|
public const string MessageText = "MessageText";
|
|
public const string Kod = "Kod";
|
|
public const string Leiras = "Leiras";
|
|
}
|
|
|
|
public class AttributeLengthInfo
|
|
{
|
|
public const int MessageCodeLength = 2147483647;
|
|
public const int MessageSourceLength = 2147483647;
|
|
public const int MessageTextLength = 2147483647;
|
|
public const int LeirasLength = 2147483647;
|
|
}
|
|
|
|
#region General
|
|
private KIRKontenerStatuszDA m_DA = new KIRKontenerStatuszDA();
|
|
|
|
protected static KIRKontenerStatusz FakeKIRKontenerStatusz { get; set; }
|
|
|
|
public static KIRKontenerStatusz GiveAnInstance()
|
|
{
|
|
KIRKontenerStatusz result = FakeKIRKontenerStatusz == null
|
|
? new KIRKontenerStatusz()
|
|
: (KIRKontenerStatusz)FakeKIRKontenerStatusz.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<KIRKontenerStatusz> 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<KIRKontenerStatusz> 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<KIRKontenerStatusz> LoadWithFilter(string filter, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<KIRKontenerStatusz>();
|
|
new KIRKontenerStatuszDA().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<KIRKontenerStatusz> LoadWithFilter(string filter, ColumnFilterMode columnFilterMode, IEnumerable<string> columns, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<KIRKontenerStatusz>();
|
|
new KIRKontenerStatuszDA().LoadWithFilter(result, filter, columnFilterMode, columns, commandParameters);
|
|
return result;
|
|
}
|
|
|
|
protected override void StoreOriginalValues()
|
|
{
|
|
base.StoreOriginalValues();
|
|
OriginalValues.Add("MessageCode", (MessageCode == null ? (object)DBNull.Value : (object)m_MessageCode));
|
|
OriginalValues.Add("MessageSource", (MessageSource == null ? (object)DBNull.Value : (object)m_MessageSource));
|
|
OriginalValues.Add("MessageText", (MessageText == null ? (object)DBNull.Value : (object)m_MessageText));
|
|
OriginalValues.Add("Kod", (Kod == null ? (object)DBNull.Value : (object)m_Kod));
|
|
OriginalValues.Add("Leiras", (Leiras == null ? (object)DBNull.Value : (object)m_Leiras));
|
|
OriginalValues.Add("KIRKontenerId", (m_KIRKontenerId < 0 ? (object)DBNull.Value : (object)m_KIRKontenerId));
|
|
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_MessageCode != null && m_MessageCode.Length > 2147483647)
|
|
{
|
|
throw new InvalidEntityAttributeException("KIRKontenerStatusz", "MessageCode", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_MessageSource != null && m_MessageSource.Length > 2147483647)
|
|
{
|
|
throw new InvalidEntityAttributeException("KIRKontenerStatusz", "MessageSource", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_MessageText != null && m_MessageText.Length > 2147483647)
|
|
{
|
|
throw new InvalidEntityAttributeException("KIRKontenerStatusz", "MessageText", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_Leiras != null && m_Leiras.Length > 2147483647)
|
|
{
|
|
throw new InvalidEntityAttributeException("KIRKontenerStatusz", "Leiras", EntityAttributeError.TooLong);
|
|
}
|
|
|
|
}
|
|
|
|
// kötelező asszociációk ellenőrzése...
|
|
if (m_KIRKontenerId == -1) { throw new InvalidEntityAttributeException("KIRKontenerStatusz", "KIRKontenerId", EntityAttributeError.Empty); }
|
|
if (m_IntezmenyId == -1) { throw new InvalidEntityAttributeException("KIRKontenerStatusz", "IntezmenyId", EntityAttributeError.Empty); }
|
|
if (m_TanevId == -1) { throw new InvalidEntityAttributeException("KIRKontenerStatusz", "TanevId", EntityAttributeError.Empty); }
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Alaphelyzetbe állítás
|
|
protected override void Reset()
|
|
{
|
|
base.Reset();
|
|
|
|
// alaphelyzetbe állítjuk az egyszerű mezőket
|
|
this.m_MessageCode = null;
|
|
this.m_MessageSource = null;
|
|
this.m_MessageText = null;
|
|
this.m_Kod = null;
|
|
this.m_Leiras = null;
|
|
|
|
// alaphelyzetbe állítjuk az asszociációkból származó mezőket
|
|
this.m_KIRKontenerId = -1;
|
|
this.m_KIRKontener = 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...
|
|
|
|
// KIRKontener esetében mi mutatunk a másikra: startrole: *, endrole: 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 MessageCode
|
|
|
|
protected internal string m_MessageCode;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("MessageCode", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string MessageCode
|
|
{
|
|
get
|
|
{
|
|
return m_MessageCode;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_MessageCode == value) return;
|
|
m_MessageCode = value;
|
|
FieldModified("MessageCode", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region MessageSource
|
|
|
|
protected internal string m_MessageSource;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("MessageSource", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string MessageSource
|
|
{
|
|
get
|
|
{
|
|
return m_MessageSource;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_MessageSource == value) return;
|
|
m_MessageSource = value;
|
|
FieldModified("MessageSource", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region MessageText
|
|
|
|
protected internal string m_MessageText;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("MessageText", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string MessageText
|
|
{
|
|
get
|
|
{
|
|
return m_MessageText;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_MessageText == value) return;
|
|
m_MessageText = value;
|
|
FieldModified("MessageText", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kod
|
|
|
|
protected internal int? m_Kod;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kod", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kod
|
|
{
|
|
get
|
|
{
|
|
return m_Kod;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kod == value) return;
|
|
m_Kod = value;
|
|
FieldModified("Kod", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Leiras
|
|
|
|
protected internal string m_Leiras;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Leiras", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string Leiras
|
|
{
|
|
get
|
|
{
|
|
return m_Leiras;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Leiras == value) return;
|
|
m_Leiras = value;
|
|
FieldModified("Leiras", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region Asszociációkkal kapcsolatos dolgok
|
|
|
|
#region KIRKontenerStatusz (*) -> KIRKontener (1)
|
|
|
|
protected internal int m_KIRKontenerId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) KIRKontener 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 KIRKontenerId
|
|
{
|
|
get
|
|
{
|
|
return InternalKIRKontenerId;
|
|
}
|
|
set
|
|
{
|
|
InternalKIRKontenerId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalKIRKontenerId
|
|
{
|
|
get
|
|
{
|
|
if (m_KIRKontener != null)
|
|
{
|
|
return m_KIRKontener.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_KIRKontenerId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_KIRKontenerId != value)
|
|
{
|
|
m_KIRKontenerId = value;
|
|
m_KIRKontener = null;
|
|
FieldModified("KIRKontenerId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyKIRKontener(KIRKontener value)
|
|
{
|
|
m_KIRKontenerId = value != null ? value.ID : -1;
|
|
m_KIRKontener = value;
|
|
FieldModified("KIRKontenerId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetKIRKontener(KIRKontener value)
|
|
{
|
|
m_KIRKontener = value;
|
|
if (value != null)
|
|
{
|
|
m_KIRKontenerId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_KIRKontenerId = -1;
|
|
}
|
|
}
|
|
|
|
protected KIRKontener m_KIRKontener = null;
|
|
|
|
IKIRKontener IKIRKontenerStatusz.KIRKontener
|
|
{
|
|
get { return KIRKontener; }
|
|
set { KIRKontener = value as KIRKontener; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő KIRKontenerStatusz és KIRKontener entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("KIRKontener", EntityPropertyBaseType.Entity, typeof(KIRKontener), EntityCopyMethod.ShallowCopy)]
|
|
public virtual KIRKontener KIRKontener
|
|
{
|
|
get
|
|
{
|
|
if ((m_KIRKontener == null) && (m_KIRKontenerId != -1))
|
|
{
|
|
SDA.Kreta.Entities.KIRKontener partner = SDA.Kreta.Entities.KIRKontener.GiveAnInstance();
|
|
partner.LoadByID(m_KIRKontenerId);
|
|
|
|
this.SetKIRKontener(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_KIRKontener;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_KIRKontener == null) || (value.ID != m_KIRKontener.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.KIRKontener_KIRKontenerStatusz_DA da = new KIRKontener_KIRKontenerStatusz_DA(value);
|
|
da.AddItem(this);
|
|
this.SetKIRKontener(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetKIRKontener(value);
|
|
}
|
|
FieldModified("KIRKontenerId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetKIRKontener(null);
|
|
UpdateAssociations();
|
|
FieldModified("KIRKontenerId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region KIRKontenerStatusz (*) -> 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 IKIRKontenerStatusz.Intezmeny
|
|
{
|
|
get { return Intezmeny; }
|
|
set { Intezmeny = value as Intezmeny; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő KIRKontenerStatusz é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_KIRKontenerStatusz_DA da = new Intezmeny_KIRKontenerStatusz_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 KIRKontenerStatusz (*) -> 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 IKIRKontenerStatusz.Tanev
|
|
{
|
|
get { return Tanev; }
|
|
set { Tanev = value as Tanev; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő KIRKontenerStatusz é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_KIRKontenerStatusz_DA da = new Tanev_KIRKontenerStatusz_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
|
|
}
|
|
}
|
|
|