772 lines
26 KiB
C#
772 lines
26 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 ErtekelesTantargyiNyelv 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("ErtekelesTantargyiNyelv")]
|
|
// alapértelmezett EntityHistoryMode
|
|
public class ErtekelesTantargyiNyelv : Entity, IErtekelesTantargyiNyelv
|
|
{
|
|
internal protected ErtekelesTantargyiNyelv()
|
|
: base()
|
|
{
|
|
}
|
|
|
|
public class AttributeInfo
|
|
{
|
|
public const string NyelvId = "NyelvId";
|
|
public const string Szoveg = "Szoveg";
|
|
public const string SzovegFormazott = "SzovegFormazott";
|
|
public const string SzovegRovidNev = "SzovegRovidNev";
|
|
public const string Tema = "Tema";
|
|
}
|
|
|
|
public class AttributeLengthInfo
|
|
{
|
|
public const int SzovegLength = 2147483647;
|
|
public const int SzovegFormazottLength = 2147483647;
|
|
public const int SzovegRovidNevLength = 3;
|
|
public const int TemaLength = 2000;
|
|
}
|
|
|
|
#region General
|
|
private ErtekelesTantargyiNyelvDA m_DA = new ErtekelesTantargyiNyelvDA();
|
|
|
|
protected static ErtekelesTantargyiNyelv FakeErtekelesTantargyiNyelv { get; set; }
|
|
|
|
public static ErtekelesTantargyiNyelv GiveAnInstance()
|
|
{
|
|
ErtekelesTantargyiNyelv result = FakeErtekelesTantargyiNyelv == null
|
|
? new ErtekelesTantargyiNyelv()
|
|
: (ErtekelesTantargyiNyelv)FakeErtekelesTantargyiNyelv.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<ErtekelesTantargyiNyelv> 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<ErtekelesTantargyiNyelv> 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<ErtekelesTantargyiNyelv> LoadWithFilter(string filter, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<ErtekelesTantargyiNyelv>();
|
|
new ErtekelesTantargyiNyelvDA().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<ErtekelesTantargyiNyelv> LoadWithFilter(string filter, ColumnFilterMode columnFilterMode, IEnumerable<string> columns, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<ErtekelesTantargyiNyelv>();
|
|
new ErtekelesTantargyiNyelvDA().LoadWithFilter(result, filter, columnFilterMode, columns, commandParameters);
|
|
return result;
|
|
}
|
|
|
|
protected override void StoreOriginalValues()
|
|
{
|
|
base.StoreOriginalValues();
|
|
OriginalValues.Add("NyelvId", (object)m_NyelvId);
|
|
OriginalValues.Add("Szoveg", (Szoveg == null ? (object)DBNull.Value : (object)m_Szoveg));
|
|
OriginalValues.Add("SzovegFormazott", (SzovegFormazott == null ? (object)DBNull.Value : (object)m_SzovegFormazott));
|
|
OriginalValues.Add("SzovegRovidNev", (SzovegRovidNev == null ? (object)DBNull.Value : (object)m_SzovegRovidNev));
|
|
OriginalValues.Add("Tema", (Tema == null ? (object)DBNull.Value : (object)m_Tema));
|
|
OriginalValues.Add("ErtekelesTantargyiId", (m_ErtekelesTantargyiId < 0 ? (object)DBNull.Value : (object)m_ErtekelesTantargyiId));
|
|
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_Szoveg != null && m_Szoveg.Length > 2147483647)
|
|
{
|
|
throw new InvalidEntityAttributeException("ErtekelesTantargyiNyelv", "Szoveg", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_SzovegFormazott != null && m_SzovegFormazott.Length > 2147483647)
|
|
{
|
|
throw new InvalidEntityAttributeException("ErtekelesTantargyiNyelv", "SzovegFormazott", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_SzovegRovidNev != null && m_SzovegRovidNev.Length > 3)
|
|
{
|
|
throw new InvalidEntityAttributeException("ErtekelesTantargyiNyelv", "SzovegRovidNev", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_Tema != null && m_Tema.Length > 2000)
|
|
{
|
|
throw new InvalidEntityAttributeException("ErtekelesTantargyiNyelv", "Tema", EntityAttributeError.TooLong);
|
|
}
|
|
|
|
}
|
|
|
|
// kötelező asszociációk ellenőrzése...
|
|
if (m_ErtekelesTantargyiId == -1) { throw new InvalidEntityAttributeException("ErtekelesTantargyiNyelv", "ErtekelesTantargyiId", EntityAttributeError.Empty); }
|
|
if (m_IntezmenyId == -1) { throw new InvalidEntityAttributeException("ErtekelesTantargyiNyelv", "IntezmenyId", EntityAttributeError.Empty); }
|
|
if (m_TanevId == -1) { throw new InvalidEntityAttributeException("ErtekelesTantargyiNyelv", "TanevId", EntityAttributeError.Empty); }
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Alaphelyzetbe állítás
|
|
protected override void Reset()
|
|
{
|
|
base.Reset();
|
|
|
|
// alaphelyzetbe állítjuk az egyszerű mezőket
|
|
this.m_NyelvId = -1;
|
|
this.m_Szoveg = null;
|
|
this.m_SzovegFormazott = null;
|
|
this.m_SzovegRovidNev = null;
|
|
this.m_Tema = null;
|
|
|
|
// alaphelyzetbe állítjuk az asszociációkból származó mezőket
|
|
this.m_ErtekelesTantargyiId = -1;
|
|
this.m_ErtekelesTantargyi = 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...
|
|
|
|
// ErtekelesTantargyi 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 NyelvId
|
|
|
|
protected internal int /* DictionaryItem */ m_NyelvId;
|
|
|
|
/// <summary>
|
|
/// A tantárgyi értékelés nyelv ID-ja.
|
|
/// </summary>
|
|
[EntityProperty("NyelvId", EntityPropertyBaseType.ValueType, typeof(int /* DictionaryItem */), EntityCopyMethod.ShallowCopy)]
|
|
[EntityDictionaryItemProperty("NyelvId", "Anyanyelv", typeof(SDA.Kreta.Entities.Anyanyelv))]
|
|
|
|
public virtual int /* DictionaryItem */ NyelvId
|
|
{
|
|
get
|
|
{
|
|
return m_NyelvId;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_NyelvId == value) return;
|
|
m_NyelvId = value;
|
|
FieldModified("NyelvId", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Szoveg
|
|
|
|
protected internal string m_Szoveg;
|
|
|
|
/// <summary>
|
|
/// Az értékelés nyelviesített szövege HTML és/vagy WYSIWYG editor formázása nélkül.
|
|
/// </summary>
|
|
[EntityProperty("Szoveg", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string Szoveg
|
|
{
|
|
get
|
|
{
|
|
return m_Szoveg;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Szoveg == value) return;
|
|
m_Szoveg = value;
|
|
FieldModified("Szoveg", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SzovegFormazott
|
|
|
|
protected internal string m_SzovegFormazott;
|
|
|
|
/// <summary>
|
|
/// Az értékelés nyelviesített szövege HTML és/vagy WYSIWYG editor formázásával.
|
|
/// </summary>
|
|
[EntityProperty("SzovegFormazott", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string SzovegFormazott
|
|
{
|
|
get
|
|
{
|
|
return m_SzovegFormazott;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_SzovegFormazott == value) return;
|
|
m_SzovegFormazott = value;
|
|
FieldModified("SzovegFormazott", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SzovegRovidNev
|
|
|
|
protected internal string m_SzovegRovidNev;
|
|
|
|
/// <summary>
|
|
/// Az értékelés szöveg nyelviesített rövid neve.
|
|
/// </summary>
|
|
[EntityProperty("SzovegRovidNev", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string SzovegRovidNev
|
|
{
|
|
get
|
|
{
|
|
return m_SzovegRovidNev;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_SzovegRovidNev == value) return;
|
|
m_SzovegRovidNev = value;
|
|
FieldModified("SzovegRovidNev", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Tema
|
|
|
|
protected internal string m_Tema;
|
|
|
|
/// <summary>
|
|
/// Az értékelés nyelviesített témája.
|
|
/// </summary>
|
|
[EntityProperty("Tema", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string Tema
|
|
{
|
|
get
|
|
{
|
|
return m_Tema;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Tema == value) return;
|
|
m_Tema = value;
|
|
FieldModified("Tema", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region Asszociációkkal kapcsolatos dolgok
|
|
|
|
#region ErtekelesTantargyiNyelv (*) -> ErtekelesTantargyi (1)
|
|
|
|
protected internal int m_ErtekelesTantargyiId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) ErtekelesTantargyi 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 ErtekelesTantargyiId
|
|
{
|
|
get
|
|
{
|
|
return InternalErtekelesTantargyiId;
|
|
}
|
|
set
|
|
{
|
|
InternalErtekelesTantargyiId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalErtekelesTantargyiId
|
|
{
|
|
get
|
|
{
|
|
if (m_ErtekelesTantargyi != null)
|
|
{
|
|
return m_ErtekelesTantargyi.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_ErtekelesTantargyiId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_ErtekelesTantargyiId != value)
|
|
{
|
|
m_ErtekelesTantargyiId = value;
|
|
m_ErtekelesTantargyi = null;
|
|
FieldModified("ErtekelesTantargyiId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyErtekelesTantargyi(ErtekelesTantargyi value)
|
|
{
|
|
m_ErtekelesTantargyiId = value != null ? value.ID : -1;
|
|
m_ErtekelesTantargyi = value;
|
|
FieldModified("ErtekelesTantargyiId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetErtekelesTantargyi(ErtekelesTantargyi value)
|
|
{
|
|
m_ErtekelesTantargyi = value;
|
|
if (value != null)
|
|
{
|
|
m_ErtekelesTantargyiId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_ErtekelesTantargyiId = -1;
|
|
}
|
|
}
|
|
|
|
protected ErtekelesTantargyi m_ErtekelesTantargyi = null;
|
|
|
|
IErtekelesTantargyi IErtekelesTantargyiNyelv.ErtekelesTantargyi
|
|
{
|
|
get { return ErtekelesTantargyi; }
|
|
set { ErtekelesTantargyi = value as ErtekelesTantargyi; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// A tantárgyi értékelés ID-ja.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő ErtekelesTantargyiNyelv és ErtekelesTantargyi entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("ErtekelesTantargyi", EntityPropertyBaseType.Entity, typeof(ErtekelesTantargyi), EntityCopyMethod.ShallowCopy)]
|
|
public virtual ErtekelesTantargyi ErtekelesTantargyi
|
|
{
|
|
get
|
|
{
|
|
if ((m_ErtekelesTantargyi == null) && (m_ErtekelesTantargyiId != -1))
|
|
{
|
|
SDA.Kreta.Entities.ErtekelesTantargyi partner = SDA.Kreta.Entities.ErtekelesTantargyi.GiveAnInstance();
|
|
partner.LoadByID(m_ErtekelesTantargyiId);
|
|
|
|
this.SetErtekelesTantargyi(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_ErtekelesTantargyi;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_ErtekelesTantargyi == null) || (value.ID != m_ErtekelesTantargyi.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.ErtekelesTantargyi_ErtekelesTantargyiNyelv_DA da = new ErtekelesTantargyi_ErtekelesTantargyiNyelv_DA(value);
|
|
da.AddItem(this);
|
|
this.SetErtekelesTantargyi(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetErtekelesTantargyi(value);
|
|
}
|
|
FieldModified("ErtekelesTantargyiId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetErtekelesTantargyi(null);
|
|
UpdateAssociations();
|
|
FieldModified("ErtekelesTantargyiId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region ErtekelesTantargyiNyelv (*) -> 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 IErtekelesTantargyiNyelv.Intezmeny
|
|
{
|
|
get { return Intezmeny; }
|
|
set { Intezmeny = value as Intezmeny; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő ErtekelesTantargyiNyelv é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_ErtekelesTantargyiNyelv_DA da = new Intezmeny_ErtekelesTantargyiNyelv_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 ErtekelesTantargyiNyelv (*) -> 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 IErtekelesTantargyiNyelv.Tanev
|
|
{
|
|
get { return Tanev; }
|
|
set { Tanev = value as Tanev; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő ErtekelesTantargyiNyelv é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_ErtekelesTantargyiNyelv_DA da = new Tanev_ErtekelesTantargyiNyelv_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
|
|
}
|
|
}
|
|
|