1510 lines
49 KiB
C#
1510 lines
49 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 OraFile 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("OraFile")]
|
|
// alapértelmezett EntityHistoryMode
|
|
public class OraFile : Entity, IOraFile
|
|
{
|
|
internal protected OraFile()
|
|
: base()
|
|
{
|
|
}
|
|
|
|
public class AttributeInfo
|
|
{
|
|
public const string IsTanuloLathato = "IsTanuloLathato";
|
|
public const string OraDatum = "OraDatum";
|
|
public const string OraFileTipusId = "OraFileTipusId";
|
|
public const string OraIdopont = "OraIdopont";
|
|
public const string Oraszam = "Oraszam";
|
|
public const string Megjegyzes = "Megjegyzes";
|
|
}
|
|
|
|
public class AttributeLengthInfo
|
|
{
|
|
public const int MegjegyzesLength = 1000;
|
|
}
|
|
|
|
#region General
|
|
private OraFileDA m_DA = new OraFileDA();
|
|
|
|
protected static OraFile FakeOraFile { get; set; }
|
|
|
|
public static OraFile GiveAnInstance()
|
|
{
|
|
OraFile result = FakeOraFile == null
|
|
? new OraFile()
|
|
: (OraFile)FakeOraFile.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<OraFile> 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<OraFile> 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<OraFile> LoadWithFilter(string filter, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<OraFile>();
|
|
new OraFileDA().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<OraFile> LoadWithFilter(string filter, ColumnFilterMode columnFilterMode, IEnumerable<string> columns, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<OraFile>();
|
|
new OraFileDA().LoadWithFilter(result, filter, columnFilterMode, columns, commandParameters);
|
|
return result;
|
|
}
|
|
|
|
protected override void StoreOriginalValues()
|
|
{
|
|
base.StoreOriginalValues();
|
|
OriginalValues.Add("IsTanuloLathato", (object)m_IsTanuloLathato);
|
|
OriginalValues.Add("OraDatum", (object)m_OraDatum);
|
|
OriginalValues.Add("OraFileTipusId", (object)m_OraFileTipusId);
|
|
OriginalValues.Add("OraIdopont", (OraIdopont == null ? (object)DBNull.Value : (object)m_OraIdopont));
|
|
OriginalValues.Add("Oraszam", (Oraszam == null ? (object)DBNull.Value : (object)m_Oraszam));
|
|
OriginalValues.Add("Megjegyzes", (Megjegyzes == null ? (object)DBNull.Value : (object)m_Megjegyzes));
|
|
OriginalValues.Add("OrarendiOraId", (m_OrarendiOraId < 0 ? (object)DBNull.Value : (object)m_OrarendiOraId));
|
|
OriginalValues.Add("TanitasiOraId", (m_TanitasiOraId < 0 ? (object)DBNull.Value : (object)m_TanitasiOraId));
|
|
OriginalValues.Add("TantargyId", (m_TantargyId < 0 ? (object)DBNull.Value : (object)m_TantargyId));
|
|
OriginalValues.Add("DKT_FileId", (m_DKT_FileId < 0 ? (object)DBNull.Value : (object)m_DKT_FileId));
|
|
OriginalValues.Add("AlkalmazottId", (m_AlkalmazottId < 0 ? (object)DBNull.Value : (object)m_AlkalmazottId));
|
|
OriginalValues.Add("OsztalyCsoportId", (m_OsztalyCsoportId < 0 ? (object)DBNull.Value : (object)m_OsztalyCsoportId));
|
|
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_Megjegyzes != null && m_Megjegyzes.Length > 1000)
|
|
{
|
|
throw new InvalidEntityAttributeException("OraFile", "Megjegyzes", EntityAttributeError.TooLong);
|
|
}
|
|
|
|
}
|
|
|
|
// kötelező asszociációk ellenőrzése...
|
|
if (m_TantargyId == -1) { throw new InvalidEntityAttributeException("OraFile", "TantargyId", EntityAttributeError.Empty); }
|
|
if (m_DKT_FileId == -1) { throw new InvalidEntityAttributeException("OraFile", "DKT_FileId", EntityAttributeError.Empty); }
|
|
if (m_AlkalmazottId == -1) { throw new InvalidEntityAttributeException("OraFile", "AlkalmazottId", EntityAttributeError.Empty); }
|
|
if (m_OsztalyCsoportId == -1) { throw new InvalidEntityAttributeException("OraFile", "OsztalyCsoportId", EntityAttributeError.Empty); }
|
|
if (m_IntezmenyId == -1) { throw new InvalidEntityAttributeException("OraFile", "IntezmenyId", EntityAttributeError.Empty); }
|
|
if (m_TanevId == -1) { throw new InvalidEntityAttributeException("OraFile", "TanevId", EntityAttributeError.Empty); }
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Alaphelyzetbe állítás
|
|
protected override void Reset()
|
|
{
|
|
base.Reset();
|
|
|
|
// alaphelyzetbe állítjuk az egyszerű mezőket
|
|
this.m_IsTanuloLathato = false;
|
|
this.m_OraDatum = DateTime.Now /* XXX DateTime */;
|
|
this.m_OraFileTipusId = -1;
|
|
this.m_OraIdopont = null;
|
|
this.m_Oraszam = null;
|
|
this.m_Megjegyzes = null;
|
|
|
|
// alaphelyzetbe állítjuk az asszociációkból származó mezőket
|
|
this.m_OrarendiOraId = -1;
|
|
this.m_OrarendiOra = null; // Entity
|
|
this.m_TanitasiOraId = -1;
|
|
this.m_TanitasiOra = null; // Entity
|
|
this.m_TantargyId = -1;
|
|
this.m_Tantargy = null; // Entity
|
|
this.m_DKT_FileId = -1;
|
|
this.m_DKT_File = null; // Entity
|
|
this.m_AlkalmazottId = -1;
|
|
this.m_Alkalmazott = null; // Entity
|
|
this.m_OsztalyCsoportId = -1;
|
|
this.m_OsztalyCsoport = 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...
|
|
|
|
// OrarendiOra esetében mi mutatunk a másikra: startrole: *, endrole: 0..1
|
|
// TanitasiOra esetében mi mutatunk a másikra: startrole: *, endrole: 0..1
|
|
// Tantargy esetében mi mutatunk a másikra: startrole: *, endrole: 1
|
|
// DKT_File esetében mi mutatunk a másikra: startrole: *, endrole: 1
|
|
// Alkalmazott esetében mi mutatunk a másikra: startrole: *, endrole: 1
|
|
// OsztalyCsoport 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 IsTanuloLathato
|
|
|
|
protected internal bool m_IsTanuloLathato;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("IsTanuloLathato", EntityPropertyBaseType.ValueType, typeof(bool), EntityCopyMethod.ShallowCopy)]
|
|
public virtual bool IsTanuloLathato
|
|
{
|
|
get
|
|
{
|
|
return m_IsTanuloLathato;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_IsTanuloLathato == value) return;
|
|
m_IsTanuloLathato = value;
|
|
FieldModified("IsTanuloLathato", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region OraDatum
|
|
|
|
protected internal DateTime m_OraDatum;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("OraDatum", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime OraDatum
|
|
{
|
|
get
|
|
{
|
|
return m_OraDatum;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_OraDatum == value) return;
|
|
m_OraDatum = value;
|
|
FieldModified("OraDatum", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region OraFileTipusId
|
|
|
|
protected internal int /* DictionaryItem */ m_OraFileTipusId;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("OraFileTipusId", EntityPropertyBaseType.ValueType, typeof(int /* DictionaryItem */), EntityCopyMethod.ShallowCopy)]
|
|
[EntityDictionaryItemProperty("OraFileTipusId", "OraFileTipus", typeof(SDA.Kreta.Entities.OraFileTipus))]
|
|
|
|
public virtual int /* DictionaryItem */ OraFileTipusId
|
|
{
|
|
get
|
|
{
|
|
return m_OraFileTipusId;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_OraFileTipusId == value) return;
|
|
m_OraFileTipusId = value;
|
|
FieldModified("OraFileTipusId", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region OraIdopont
|
|
|
|
protected internal DateTime? m_OraIdopont;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("OraIdopont", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime? OraIdopont
|
|
{
|
|
get
|
|
{
|
|
return m_OraIdopont;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_OraIdopont == value) return;
|
|
m_OraIdopont = value;
|
|
FieldModified("OraIdopont", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Oraszam
|
|
|
|
protected internal int? m_Oraszam;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Oraszam", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Oraszam
|
|
{
|
|
get
|
|
{
|
|
return m_Oraszam;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Oraszam == value) return;
|
|
m_Oraszam = value;
|
|
FieldModified("Oraszam", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Megjegyzes
|
|
|
|
protected internal string m_Megjegyzes;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Megjegyzes", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string Megjegyzes
|
|
{
|
|
get
|
|
{
|
|
return m_Megjegyzes;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Megjegyzes == value) return;
|
|
m_Megjegyzes = value;
|
|
FieldModified("Megjegyzes", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region Asszociációkkal kapcsolatos dolgok
|
|
|
|
#region OraFile (*) -> OrarendiOra (0..1)
|
|
|
|
protected internal int m_OrarendiOraId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) OrarendiOra 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 OrarendiOraId
|
|
{
|
|
get
|
|
{
|
|
return InternalOrarendiOraId;
|
|
}
|
|
set
|
|
{
|
|
InternalOrarendiOraId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalOrarendiOraId
|
|
{
|
|
get
|
|
{
|
|
if (m_OrarendiOra != null)
|
|
{
|
|
return m_OrarendiOra.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_OrarendiOraId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_OrarendiOraId != value)
|
|
{
|
|
m_OrarendiOraId = value;
|
|
m_OrarendiOra = null;
|
|
FieldModified("OrarendiOraId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyOrarendiOra(OrarendiOra value)
|
|
{
|
|
m_OrarendiOraId = value != null ? value.ID : -1;
|
|
m_OrarendiOra = value;
|
|
FieldModified("OrarendiOraId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetOrarendiOra(OrarendiOra value)
|
|
{
|
|
m_OrarendiOra = value;
|
|
if (value != null)
|
|
{
|
|
m_OrarendiOraId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_OrarendiOraId = -1;
|
|
}
|
|
}
|
|
|
|
protected OrarendiOra m_OrarendiOra = null;
|
|
|
|
IOrarendiOra IOraFile.OrarendiOra
|
|
{
|
|
get { return OrarendiOra; }
|
|
set { OrarendiOra = value as OrarendiOra; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő OraFile és OrarendiOra entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("OrarendiOra", EntityPropertyBaseType.Entity, typeof(OrarendiOra), EntityCopyMethod.ShallowCopy)]
|
|
public virtual OrarendiOra OrarendiOra
|
|
{
|
|
get
|
|
{
|
|
if ((m_OrarendiOra == null) && (m_OrarendiOraId != -1))
|
|
{
|
|
SDA.Kreta.Entities.OrarendiOra partner = SDA.Kreta.Entities.OrarendiOra.GiveAnInstance();
|
|
partner.LoadByID(m_OrarendiOraId);
|
|
|
|
this.SetOrarendiOra(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_OrarendiOra;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_OrarendiOra == null) || (value.ID != m_OrarendiOra.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.OrarendiOra_OraFile_DA da = new OrarendiOra_OraFile_DA(value);
|
|
da.AddItem(this);
|
|
this.SetOrarendiOra(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetOrarendiOra(value);
|
|
}
|
|
FieldModified("OrarendiOraId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetOrarendiOra(null);
|
|
UpdateAssociations();
|
|
FieldModified("OrarendiOraId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region OraFile (*) -> TanitasiOra (0..1)
|
|
|
|
protected internal int m_TanitasiOraId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) TanitasiOra 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 TanitasiOraId
|
|
{
|
|
get
|
|
{
|
|
return InternalTanitasiOraId;
|
|
}
|
|
set
|
|
{
|
|
InternalTanitasiOraId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalTanitasiOraId
|
|
{
|
|
get
|
|
{
|
|
if (m_TanitasiOra != null)
|
|
{
|
|
return m_TanitasiOra.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_TanitasiOraId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_TanitasiOraId != value)
|
|
{
|
|
m_TanitasiOraId = value;
|
|
m_TanitasiOra = null;
|
|
FieldModified("TanitasiOraId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyTanitasiOra(TanitasiOra value)
|
|
{
|
|
m_TanitasiOraId = value != null ? value.ID : -1;
|
|
m_TanitasiOra = value;
|
|
FieldModified("TanitasiOraId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetTanitasiOra(TanitasiOra value)
|
|
{
|
|
m_TanitasiOra = value;
|
|
if (value != null)
|
|
{
|
|
m_TanitasiOraId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_TanitasiOraId = -1;
|
|
}
|
|
}
|
|
|
|
protected TanitasiOra m_TanitasiOra = null;
|
|
|
|
ITanitasiOra IOraFile.TanitasiOra
|
|
{
|
|
get { return TanitasiOra; }
|
|
set { TanitasiOra = value as TanitasiOra; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő OraFile és TanitasiOra entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("TanitasiOra", EntityPropertyBaseType.Entity, typeof(TanitasiOra), EntityCopyMethod.ShallowCopy)]
|
|
public virtual TanitasiOra TanitasiOra
|
|
{
|
|
get
|
|
{
|
|
if ((m_TanitasiOra == null) && (m_TanitasiOraId != -1))
|
|
{
|
|
SDA.Kreta.Entities.TanitasiOra partner = SDA.Kreta.Entities.TanitasiOra.GiveAnInstance();
|
|
partner.LoadByID(m_TanitasiOraId);
|
|
|
|
this.SetTanitasiOra(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_TanitasiOra;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_TanitasiOra == null) || (value.ID != m_TanitasiOra.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.TanitasiOra_OraFile_DA da = new TanitasiOra_OraFile_DA(value);
|
|
da.AddItem(this);
|
|
this.SetTanitasiOra(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetTanitasiOra(value);
|
|
}
|
|
FieldModified("TanitasiOraId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetTanitasiOra(null);
|
|
UpdateAssociations();
|
|
FieldModified("TanitasiOraId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region OraFile (*) -> 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 IOraFile.Tantargy
|
|
{
|
|
get { return Tantargy; }
|
|
set { Tantargy = value as Tantargy; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő OraFile é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_OraFile_DA da = new Tantargy_OraFile_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 OraFile (*) -> DKT_File (1)
|
|
|
|
protected internal int m_DKT_FileId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) DKT_File 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 DKT_FileId
|
|
{
|
|
get
|
|
{
|
|
return InternalDKT_FileId;
|
|
}
|
|
set
|
|
{
|
|
InternalDKT_FileId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalDKT_FileId
|
|
{
|
|
get
|
|
{
|
|
if (m_DKT_File != null)
|
|
{
|
|
return m_DKT_File.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_DKT_FileId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_DKT_FileId != value)
|
|
{
|
|
m_DKT_FileId = value;
|
|
m_DKT_File = null;
|
|
FieldModified("DKT_FileId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyDKT_File(DKT_File value)
|
|
{
|
|
m_DKT_FileId = value != null ? value.ID : -1;
|
|
m_DKT_File = value;
|
|
FieldModified("DKT_FileId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetDKT_File(DKT_File value)
|
|
{
|
|
m_DKT_File = value;
|
|
if (value != null)
|
|
{
|
|
m_DKT_FileId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_DKT_FileId = -1;
|
|
}
|
|
}
|
|
|
|
protected DKT_File m_DKT_File = null;
|
|
|
|
IDKT_File IOraFile.DKT_File
|
|
{
|
|
get { return DKT_File; }
|
|
set { DKT_File = value as DKT_File; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő OraFile és DKT_File entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("DKT_File", EntityPropertyBaseType.Entity, typeof(DKT_File), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DKT_File DKT_File
|
|
{
|
|
get
|
|
{
|
|
if ((m_DKT_File == null) && (m_DKT_FileId != -1))
|
|
{
|
|
SDA.Kreta.Entities.DKT_File partner = SDA.Kreta.Entities.DKT_File.GiveAnInstance();
|
|
partner.LoadByID(m_DKT_FileId);
|
|
|
|
this.SetDKT_File(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_DKT_File;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_DKT_File == null) || (value.ID != m_DKT_File.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.DKT_File_OraFile_DA da = new DKT_File_OraFile_DA(value);
|
|
da.AddItem(this);
|
|
this.SetDKT_File(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetDKT_File(value);
|
|
}
|
|
FieldModified("DKT_FileId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetDKT_File(null);
|
|
UpdateAssociations();
|
|
FieldModified("DKT_FileId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region OraFile (*) -> Alkalmazott (1)
|
|
|
|
protected internal int m_AlkalmazottId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) Alkalmazott 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 AlkalmazottId
|
|
{
|
|
get
|
|
{
|
|
return InternalAlkalmazottId;
|
|
}
|
|
set
|
|
{
|
|
InternalAlkalmazottId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalAlkalmazottId
|
|
{
|
|
get
|
|
{
|
|
if (m_Alkalmazott != null)
|
|
{
|
|
return m_Alkalmazott.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_AlkalmazottId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_AlkalmazottId != value)
|
|
{
|
|
m_AlkalmazottId = value;
|
|
m_Alkalmazott = null;
|
|
FieldModified("AlkalmazottId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyAlkalmazott(Alkalmazott value)
|
|
{
|
|
m_AlkalmazottId = value != null ? value.ID : -1;
|
|
m_Alkalmazott = value;
|
|
FieldModified("AlkalmazottId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetAlkalmazott(Alkalmazott value)
|
|
{
|
|
m_Alkalmazott = value;
|
|
if (value != null)
|
|
{
|
|
m_AlkalmazottId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_AlkalmazottId = -1;
|
|
}
|
|
}
|
|
|
|
protected Alkalmazott m_Alkalmazott = null;
|
|
|
|
IAlkalmazott IOraFile.Alkalmazott
|
|
{
|
|
get { return Alkalmazott; }
|
|
set { Alkalmazott = value as Alkalmazott; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő OraFile és Alkalmazott entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("Alkalmazott", EntityPropertyBaseType.Entity, typeof(Alkalmazott), EntityCopyMethod.ShallowCopy)]
|
|
public virtual Alkalmazott Alkalmazott
|
|
{
|
|
get
|
|
{
|
|
if ((m_Alkalmazott == null) && (m_AlkalmazottId != -1))
|
|
{
|
|
SDA.Kreta.Entities.Alkalmazott partner = SDA.Kreta.Entities.Alkalmazott.GiveAnInstance();
|
|
partner.LoadByID(m_AlkalmazottId);
|
|
|
|
this.SetAlkalmazott(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_Alkalmazott;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_Alkalmazott == null) || (value.ID != m_Alkalmazott.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.Alkalmazott_OraFile_DA da = new Alkalmazott_OraFile_DA(value);
|
|
da.AddItem(this);
|
|
this.SetAlkalmazott(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetAlkalmazott(value);
|
|
}
|
|
FieldModified("AlkalmazottId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetAlkalmazott(null);
|
|
UpdateAssociations();
|
|
FieldModified("AlkalmazottId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region OraFile (*) -> OsztalyCsoport (1)
|
|
|
|
protected internal int m_OsztalyCsoportId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) OsztalyCsoport 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 OsztalyCsoportId
|
|
{
|
|
get
|
|
{
|
|
return InternalOsztalyCsoportId;
|
|
}
|
|
set
|
|
{
|
|
InternalOsztalyCsoportId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalOsztalyCsoportId
|
|
{
|
|
get
|
|
{
|
|
if (m_OsztalyCsoport != null)
|
|
{
|
|
return m_OsztalyCsoport.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_OsztalyCsoportId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_OsztalyCsoportId != value)
|
|
{
|
|
m_OsztalyCsoportId = value;
|
|
m_OsztalyCsoport = null;
|
|
FieldModified("OsztalyCsoportId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyOsztalyCsoport(OsztalyCsoport value)
|
|
{
|
|
m_OsztalyCsoportId = value != null ? value.ID : -1;
|
|
m_OsztalyCsoport = value;
|
|
FieldModified("OsztalyCsoportId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetOsztalyCsoport(OsztalyCsoport value)
|
|
{
|
|
m_OsztalyCsoport = value;
|
|
if (value != null)
|
|
{
|
|
m_OsztalyCsoportId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_OsztalyCsoportId = -1;
|
|
}
|
|
}
|
|
|
|
protected OsztalyCsoport m_OsztalyCsoport = null;
|
|
|
|
IOsztalyCsoport IOraFile.OsztalyCsoport
|
|
{
|
|
get { return OsztalyCsoport; }
|
|
set { OsztalyCsoport = value as OsztalyCsoport; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő OraFile és OsztalyCsoport entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("OsztalyCsoport", EntityPropertyBaseType.Entity, typeof(OsztalyCsoport), EntityCopyMethod.ShallowCopy)]
|
|
public virtual OsztalyCsoport OsztalyCsoport
|
|
{
|
|
get
|
|
{
|
|
if ((m_OsztalyCsoport == null) && (m_OsztalyCsoportId != -1))
|
|
{
|
|
SDA.Kreta.Entities.OsztalyCsoport partner = SDA.Kreta.Entities.OsztalyCsoport.GiveAnInstance();
|
|
partner.LoadByID(m_OsztalyCsoportId);
|
|
|
|
this.SetOsztalyCsoport(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_OsztalyCsoport;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_OsztalyCsoport == null) || (value.ID != m_OsztalyCsoport.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.OsztalyCsoport_OraFile_DA da = new OsztalyCsoport_OraFile_DA(value);
|
|
da.AddItem(this);
|
|
this.SetOsztalyCsoport(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetOsztalyCsoport(value);
|
|
}
|
|
FieldModified("OsztalyCsoportId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetOsztalyCsoport(null);
|
|
UpdateAssociations();
|
|
FieldModified("OsztalyCsoportId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region OraFile (*) -> 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 IOraFile.Intezmeny
|
|
{
|
|
get { return Intezmeny; }
|
|
set { Intezmeny = value as Intezmeny; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő OraFile é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_OraFile_DA da = new Intezmeny_OraFile_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 OraFile (*) -> 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 IOraFile.Tanev
|
|
{
|
|
get { return Tanev; }
|
|
set { Tanev = value as Tanev; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő OraFile é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_OraFile_DA da = new Tanev_OraFile_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
|
|
}
|
|
}
|
|
|