1157 lines
38 KiB
C#
1157 lines
38 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 TavolletJelento 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("TavolletJelento")]
|
|
// alapértelmezett EntityHistoryMode
|
|
public class TavolletJelento : Entity, ITavolletJelento
|
|
{
|
|
internal protected TavolletJelento()
|
|
: base()
|
|
{
|
|
}
|
|
|
|
public class AttributeInfo
|
|
{
|
|
public const string HianypotlasSzovege = "HianypotlasSzovege";
|
|
public const string Megjegyzes = "Megjegyzes";
|
|
public const string RogzitesIdopontja = "RogzitesIdopontja";
|
|
public const string StatuszId = "StatuszId";
|
|
public const string TavolletIdotartama = "TavolletIdotartama";
|
|
public const string TavolletKezdete = "TavolletKezdete";
|
|
public const string TavolletTipusId = "TavolletTipusId";
|
|
public const string TavolletVege = "TavolletVege";
|
|
public const string FenntartoFelhasznaloId = "FenntartoFelhasznaloId";
|
|
public const string StatuszvaltozasIdopontja = "StatuszvaltozasIdopontja";
|
|
public const string KrHianypotlasSzovege = "KrHianypotlasSzovege";
|
|
}
|
|
|
|
public class AttributeLengthInfo
|
|
{
|
|
public const int HianypotlasSzovegeLength = 1000;
|
|
public const int MegjegyzesLength = 1000;
|
|
public const int KrHianypotlasSzovegeLength = 1000;
|
|
}
|
|
|
|
#region General
|
|
private TavolletJelentoDA m_DA = new TavolletJelentoDA();
|
|
|
|
protected static TavolletJelento FakeTavolletJelento { get; set; }
|
|
|
|
public static TavolletJelento GiveAnInstance()
|
|
{
|
|
TavolletJelento result = FakeTavolletJelento == null
|
|
? new TavolletJelento()
|
|
: (TavolletJelento)FakeTavolletJelento.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<TavolletJelento> 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<TavolletJelento> 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<TavolletJelento> LoadWithFilter(string filter, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<TavolletJelento>();
|
|
new TavolletJelentoDA().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<TavolletJelento> LoadWithFilter(string filter, ColumnFilterMode columnFilterMode, IEnumerable<string> columns, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<TavolletJelento>();
|
|
new TavolletJelentoDA().LoadWithFilter(result, filter, columnFilterMode, columns, commandParameters);
|
|
return result;
|
|
}
|
|
|
|
protected override void StoreOriginalValues()
|
|
{
|
|
base.StoreOriginalValues();
|
|
OriginalValues.Add("HianypotlasSzovege", (HianypotlasSzovege == null ? (object)DBNull.Value : (object)m_HianypotlasSzovege));
|
|
OriginalValues.Add("Megjegyzes", (Megjegyzes == null ? (object)DBNull.Value : (object)m_Megjegyzes));
|
|
OriginalValues.Add("RogzitesIdopontja", (object)m_RogzitesIdopontja);
|
|
OriginalValues.Add("StatuszId", (object)m_StatuszId);
|
|
OriginalValues.Add("TavolletIdotartama", (object)m_TavolletIdotartama);
|
|
OriginalValues.Add("TavolletKezdete", (object)m_TavolletKezdete);
|
|
OriginalValues.Add("TavolletTipusId", (object)m_TavolletTipusId);
|
|
OriginalValues.Add("TavolletVege", (object)m_TavolletVege);
|
|
OriginalValues.Add("FenntartoFelhasznaloId", (FenntartoFelhasznaloId == null ? (object)DBNull.Value : (object)m_FenntartoFelhasznaloId));
|
|
OriginalValues.Add("StatuszvaltozasIdopontja", (object)m_StatuszvaltozasIdopontja);
|
|
OriginalValues.Add("KrHianypotlasSzovege", (KrHianypotlasSzovege == null ? (object)DBNull.Value : (object)m_KrHianypotlasSzovege));
|
|
OriginalValues.Add("RogzitoId", (m_RogzitoId < 0 ? (object)DBNull.Value : (object)m_RogzitoId));
|
|
OriginalValues.Add("AlkalmazottId", (m_AlkalmazottId < 0 ? (object)DBNull.Value : (object)m_AlkalmazottId));
|
|
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_HianypotlasSzovege != null && m_HianypotlasSzovege.Length > 1000)
|
|
{
|
|
throw new InvalidEntityAttributeException("TavolletJelento", "HianypotlasSzovege", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_Megjegyzes != null && m_Megjegyzes.Length > 1000)
|
|
{
|
|
throw new InvalidEntityAttributeException("TavolletJelento", "Megjegyzes", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_KrHianypotlasSzovege != null && m_KrHianypotlasSzovege.Length > 1000)
|
|
{
|
|
throw new InvalidEntityAttributeException("TavolletJelento", "KrHianypotlasSzovege", EntityAttributeError.TooLong);
|
|
}
|
|
|
|
}
|
|
|
|
// kötelező asszociációk ellenőrzése...
|
|
if (m_RogzitoId == -1) { throw new InvalidEntityAttributeException("TavolletJelento", "RogzitoId", EntityAttributeError.Empty); }
|
|
if (m_AlkalmazottId == -1) { throw new InvalidEntityAttributeException("TavolletJelento", "AlkalmazottId", EntityAttributeError.Empty); }
|
|
if (m_IntezmenyId == -1) { throw new InvalidEntityAttributeException("TavolletJelento", "IntezmenyId", EntityAttributeError.Empty); }
|
|
if (m_TanevId == -1) { throw new InvalidEntityAttributeException("TavolletJelento", "TanevId", EntityAttributeError.Empty); }
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Alaphelyzetbe állítás
|
|
protected override void Reset()
|
|
{
|
|
base.Reset();
|
|
|
|
// alaphelyzetbe állítjuk az egyszerű mezőket
|
|
this.m_HianypotlasSzovege = null;
|
|
this.m_Megjegyzes = null;
|
|
this.m_RogzitesIdopontja = DateTime.Now /* XXX DateTime */;
|
|
this.m_StatuszId = -1;
|
|
this.m_TavolletIdotartama = -1;
|
|
this.m_TavolletKezdete = DateTime.Now /* XXX DateTime */;
|
|
this.m_TavolletTipusId = -1;
|
|
this.m_TavolletVege = DateTime.Now /* XXX DateTime */;
|
|
this.m_FenntartoFelhasznaloId = null;
|
|
this.m_StatuszvaltozasIdopontja = DateTime.Now /* XXX DateTime */;
|
|
this.m_KrHianypotlasSzovege = null;
|
|
|
|
// alaphelyzetbe állítjuk az asszociációkból származó mezőket
|
|
this.m_RogzitoId = -1;
|
|
this.m_Rogzito = null; // Entity
|
|
this.m_IktatottDokumentum = null; // EntityCollection
|
|
this.m_AlkalmazottId = -1;
|
|
this.m_Alkalmazott = 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...
|
|
|
|
// Rogzito esetében mi mutatunk a másikra: startrole: 0..*, endrole: 1
|
|
if (this.IktatottDokumentum.Count > 0)
|
|
{
|
|
throw new EntityDeleteFailedException("TavolletJelento", "IktatottDokumentum", EntityUtil.GetAssociationDescription("T_IKTATOTTDOKUMENTUM_OSSZES", "ID")); // *-* + kapcsolotabla
|
|
}
|
|
// Alkalmazott 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 HianypotlasSzovege
|
|
|
|
protected internal string m_HianypotlasSzovege;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("HianypotlasSzovege", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string HianypotlasSzovege
|
|
{
|
|
get
|
|
{
|
|
return m_HianypotlasSzovege;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_HianypotlasSzovege == value) return;
|
|
m_HianypotlasSzovege = value;
|
|
FieldModified("HianypotlasSzovege", 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
|
|
|
|
#region RogzitesIdopontja
|
|
|
|
protected internal DateTime m_RogzitesIdopontja;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("RogzitesIdopontja", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime RogzitesIdopontja
|
|
{
|
|
get
|
|
{
|
|
return m_RogzitesIdopontja;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_RogzitesIdopontja == value) return;
|
|
m_RogzitesIdopontja = value;
|
|
FieldModified("RogzitesIdopontja", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region StatuszId
|
|
|
|
protected internal int /* DictionaryItem */ m_StatuszId;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("StatuszId", EntityPropertyBaseType.ValueType, typeof(int /* DictionaryItem */), EntityCopyMethod.ShallowCopy)]
|
|
[EntityDictionaryItemProperty("StatuszId", "TavolletStatusz", typeof(SDA.Kreta.Entities.TavolletStatusz))]
|
|
|
|
public virtual int /* DictionaryItem */ StatuszId
|
|
{
|
|
get
|
|
{
|
|
return m_StatuszId;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_StatuszId == value) return;
|
|
m_StatuszId = value;
|
|
FieldModified("StatuszId", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region TavolletIdotartama
|
|
|
|
protected internal int m_TavolletIdotartama;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("TavolletIdotartama", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int TavolletIdotartama
|
|
{
|
|
get
|
|
{
|
|
return m_TavolletIdotartama;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_TavolletIdotartama == value) return;
|
|
m_TavolletIdotartama = value;
|
|
FieldModified("TavolletIdotartama", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region TavolletKezdete
|
|
|
|
protected internal DateTime m_TavolletKezdete;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("TavolletKezdete", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime TavolletKezdete
|
|
{
|
|
get
|
|
{
|
|
return m_TavolletKezdete;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_TavolletKezdete == value) return;
|
|
m_TavolletKezdete = value;
|
|
FieldModified("TavolletKezdete", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region TavolletTipusId
|
|
|
|
protected internal int /* DictionaryItem */ m_TavolletTipusId;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("TavolletTipusId", EntityPropertyBaseType.ValueType, typeof(int /* DictionaryItem */), EntityCopyMethod.ShallowCopy)]
|
|
[EntityDictionaryItemProperty("TavolletTipusId", "TavolletTipus", typeof(SDA.Kreta.Entities.TavolletTipus))]
|
|
|
|
public virtual int /* DictionaryItem */ TavolletTipusId
|
|
{
|
|
get
|
|
{
|
|
return m_TavolletTipusId;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_TavolletTipusId == value) return;
|
|
m_TavolletTipusId = value;
|
|
FieldModified("TavolletTipusId", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region TavolletVege
|
|
|
|
protected internal DateTime m_TavolletVege;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("TavolletVege", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime TavolletVege
|
|
{
|
|
get
|
|
{
|
|
return m_TavolletVege;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_TavolletVege == value) return;
|
|
m_TavolletVege = value;
|
|
FieldModified("TavolletVege", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region FenntartoFelhasznaloId
|
|
|
|
protected internal int? m_FenntartoFelhasznaloId;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("FenntartoFelhasznaloId", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? FenntartoFelhasznaloId
|
|
{
|
|
get
|
|
{
|
|
return m_FenntartoFelhasznaloId;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_FenntartoFelhasznaloId == value) return;
|
|
m_FenntartoFelhasznaloId = value;
|
|
FieldModified("FenntartoFelhasznaloId", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region StatuszvaltozasIdopontja
|
|
|
|
protected internal DateTime m_StatuszvaltozasIdopontja;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("StatuszvaltozasIdopontja", EntityPropertyBaseType.ValueType, typeof(DateTime), EntityCopyMethod.ShallowCopy)]
|
|
public virtual DateTime StatuszvaltozasIdopontja
|
|
{
|
|
get
|
|
{
|
|
return m_StatuszvaltozasIdopontja;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_StatuszvaltozasIdopontja == value) return;
|
|
m_StatuszvaltozasIdopontja = value;
|
|
FieldModified("StatuszvaltozasIdopontja", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region KrHianypotlasSzovege
|
|
|
|
protected internal string m_KrHianypotlasSzovege;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("KrHianypotlasSzovege", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string KrHianypotlasSzovege
|
|
{
|
|
get
|
|
{
|
|
return m_KrHianypotlasSzovege;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_KrHianypotlasSzovege == value) return;
|
|
m_KrHianypotlasSzovege = value;
|
|
FieldModified("KrHianypotlasSzovege", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region Asszociációkkal kapcsolatos dolgok
|
|
|
|
#region TavolletJelento (0..*) -> Felhasznalo (1)
|
|
|
|
protected internal int m_RogzitoId = -1;
|
|
|
|
/// <summary>
|
|
/// A(z) Rogzito 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 RogzitoId
|
|
{
|
|
get
|
|
{
|
|
return InternalRogzitoId;
|
|
}
|
|
set
|
|
{
|
|
InternalRogzitoId = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal int InternalRogzitoId
|
|
{
|
|
get
|
|
{
|
|
if (m_Rogzito != null)
|
|
{
|
|
return m_Rogzito.ID;
|
|
}
|
|
else
|
|
{
|
|
return m_RogzitoId;// XXX az meg nem teljesen OK
|
|
}
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (m_RogzitoId != value)
|
|
{
|
|
m_RogzitoId = value;
|
|
m_Rogzito = null;
|
|
FieldModified("RogzitoId", value);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ez egy külön bejárat a DA számára
|
|
/// <summary>
|
|
internal void ModifyRogzito(Felhasznalo value)
|
|
{
|
|
m_RogzitoId = value != null ? value.ID : -1;
|
|
m_Rogzito = value;
|
|
FieldModified("RogzitoId", value != null ? (object)value.ID : DBNull.Value);
|
|
}
|
|
|
|
protected internal void SetRogzito(Felhasznalo value)
|
|
{
|
|
m_Rogzito = value;
|
|
if (value != null)
|
|
{
|
|
m_RogzitoId = value.ID;
|
|
}
|
|
else
|
|
{
|
|
m_RogzitoId = -1;
|
|
}
|
|
}
|
|
|
|
protected Felhasznalo m_Rogzito = null;
|
|
|
|
IFelhasznalo ITavolletJelento.Rogzito
|
|
{
|
|
get { return Rogzito; }
|
|
set { Rogzito = value as Felhasznalo; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TavolletJelento és Felhasznalo entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("Rogzito", EntityPropertyBaseType.Entity, typeof(Felhasznalo), EntityCopyMethod.ShallowCopy)]
|
|
public virtual Felhasznalo Rogzito
|
|
{
|
|
get
|
|
{
|
|
if ((m_Rogzito == null) && (m_RogzitoId != -1))
|
|
{
|
|
SDA.Kreta.Entities.Felhasznalo partner = SDA.Kreta.Entities.Felhasznalo.GiveAnInstance();
|
|
partner.LoadByID(m_RogzitoId);
|
|
|
|
this.SetRogzito(partner);
|
|
}
|
|
// természetesen null-t adunk vissza, ha nem tudtunk felhozni semmit
|
|
return m_Rogzito;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
if (value != null)
|
|
{
|
|
if ((m_Rogzito == null) || (value.ID != m_Rogzito.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_TavolletJelento_DA da = new Felhasznalo_TavolletJelento_DA(value);
|
|
da.AddItem(this);
|
|
this.SetRogzito(value);
|
|
}
|
|
else
|
|
{
|
|
this.SetRogzito(value);
|
|
}
|
|
FieldModified("RogzitoId", value.ID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// ki kell törölni a kapcsolatot az adatbázisban
|
|
this.SetRogzito(null);
|
|
UpdateAssociations();
|
|
FieldModified("RogzitoId", DBNull.Value);
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region TavolletJelento (*) -> 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 ITavolletJelento.Alkalmazott
|
|
{
|
|
get { return Alkalmazott; }
|
|
set { Alkalmazott = value as Alkalmazott; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TavolletJelento é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_TavolletJelento_DA da = new Alkalmazott_TavolletJelento_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 TavolletJelento (*) -> 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 ITavolletJelento.Intezmeny
|
|
{
|
|
get { return Intezmeny; }
|
|
set { Intezmeny = value as Intezmeny; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TavolletJelento é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_TavolletJelento_DA da = new Intezmeny_TavolletJelento_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 TavolletJelento (*) -> 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 ITavolletJelento.Tanev
|
|
{
|
|
get { return Tanev; }
|
|
set { Tanev = value as Tanev; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TavolletJelento é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_TavolletJelento_DA da = new Tanev_TavolletJelento_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
|
|
|
|
|
|
#region TavolletJelento (*) -> IktatottDokumentum (*)
|
|
protected IAssociatedEntityCollection<IktatottDokumentum> m_IktatottDokumentum = null;
|
|
|
|
IReadOnlyList<IIktatottDokumentum> ITavolletJelento.IktatottDokumentum => IktatottDokumentum.Cast<IIktatottDokumentum>().ToList();
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő TavolletJelento és IktatottDokumentum entitások közötti asszociáció megvalósítása.
|
|
/// </remarks>
|
|
[EntityProperty("IktatottDokumentum", EntityPropertyBaseType.EntityCollection, typeof(IAssociatedEntityCollection<IktatottDokumentum>), EntityCopyMethod.ShallowCopy, "TavolletJelentoId", "IktatottDokumentumId", "T_TAVOLLETJELENTO_IKTATOTTDOKU_OSSZES")]
|
|
public virtual IAssociatedEntityCollection<IktatottDokumentum> IktatottDokumentum
|
|
{
|
|
get
|
|
{
|
|
if (m_IktatottDokumentum == null)
|
|
{
|
|
m_IktatottDokumentum = new AssociatedEntityCollection<TavolletJelento, IktatottDokumentum>(
|
|
new TavolletJelento_IktatottDokumentum_DA(this)
|
|
);
|
|
m_IktatottDokumentum.Load();
|
|
}
|
|
return m_IktatottDokumentum;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Teljesítményre optimalizált metódus a(z) IktatottDokumentum hozzárendelésre. <b>Ne használd, ha nem muszáj!</b>
|
|
/// </summary>
|
|
public void AddToIktatottDokumentum(IktatottDokumentum partner)
|
|
{
|
|
if (m_IktatottDokumentum == null)
|
|
{
|
|
new TavolletJelento_IktatottDokumentum_DA(this).AddItem(partner);
|
|
}
|
|
else
|
|
{
|
|
IktatottDokumentum.Add(partner);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Teljesítményre optimalizált metódus a(z) IktatottDokumentum szétrendelésre. <b>Ne használd, ha nem muszáj!</b>
|
|
/// </summary>
|
|
public void RemoveFromIktatottDokumentum(IktatottDokumentum partner)
|
|
{
|
|
if (m_IktatottDokumentum == null)
|
|
{
|
|
new TavolletJelento_IktatottDokumentum_DA(this).DeleteItem(partner);
|
|
}
|
|
else
|
|
{
|
|
IktatottDokumentum.Remove(partner);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
}
|
|
}
|
|
|