1000 lines
30 KiB
C#
1000 lines
30 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 NATKerdoiv 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("NATKerdoiv")]
|
|
// alapértelmezett EntityHistoryMode
|
|
public class NATKerdoiv : Entity, INATKerdoiv
|
|
{
|
|
internal protected NATKerdoiv()
|
|
: base()
|
|
{
|
|
}
|
|
|
|
public class AttributeInfo
|
|
{
|
|
public const string IsLatta = "IsLatta";
|
|
public const string Kerdes01 = "Kerdes01";
|
|
public const string Kerdes02 = "Kerdes02";
|
|
public const string Kerdes03 = "Kerdes03";
|
|
public const string Kerdes04 = "Kerdes04";
|
|
public const string Kerdes05 = "Kerdes05";
|
|
public const string Kerdes06 = "Kerdes06";
|
|
public const string Kerdes07 = "Kerdes07";
|
|
public const string Kerdes08 = "Kerdes08";
|
|
public const string Kerdes09 = "Kerdes09";
|
|
public const string Kerdes10 = "Kerdes10";
|
|
public const string Kerdes11 = "Kerdes11";
|
|
public const string Kerdes12 = "Kerdes12";
|
|
}
|
|
|
|
public class AttributeLengthInfo
|
|
{
|
|
public const int Kerdes11Length = 1000;
|
|
public const int Kerdes12Length = 1000;
|
|
}
|
|
|
|
#region General
|
|
private NATKerdoivDA m_DA = new NATKerdoivDA();
|
|
|
|
protected static NATKerdoiv FakeNATKerdoiv { get; set; }
|
|
|
|
public static NATKerdoiv GiveAnInstance()
|
|
{
|
|
NATKerdoiv result = FakeNATKerdoiv == null
|
|
? new NATKerdoiv()
|
|
: (NATKerdoiv)FakeNATKerdoiv.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<NATKerdoiv> 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<NATKerdoiv> 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<NATKerdoiv> LoadWithFilter(string filter, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<NATKerdoiv>();
|
|
new NATKerdoivDA().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<NATKerdoiv> LoadWithFilter(string filter, ColumnFilterMode columnFilterMode, IEnumerable<string> columns, Dictionary<string, object> commandParameters = null)
|
|
{
|
|
var result = new EntityCollection<NATKerdoiv>();
|
|
new NATKerdoivDA().LoadWithFilter(result, filter, columnFilterMode, columns, commandParameters);
|
|
return result;
|
|
}
|
|
|
|
protected override void StoreOriginalValues()
|
|
{
|
|
base.StoreOriginalValues();
|
|
OriginalValues.Add("IsLatta", (object)m_IsLatta);
|
|
OriginalValues.Add("Kerdes01", (Kerdes01 == null ? (object)DBNull.Value : (object)m_Kerdes01));
|
|
OriginalValues.Add("Kerdes02", (Kerdes02 == null ? (object)DBNull.Value : (object)m_Kerdes02));
|
|
OriginalValues.Add("Kerdes03", (Kerdes03 == null ? (object)DBNull.Value : (object)m_Kerdes03));
|
|
OriginalValues.Add("Kerdes04", (Kerdes04 == null ? (object)DBNull.Value : (object)m_Kerdes04));
|
|
OriginalValues.Add("Kerdes05", (Kerdes05 == null ? (object)DBNull.Value : (object)m_Kerdes05));
|
|
OriginalValues.Add("Kerdes06", (Kerdes06 == null ? (object)DBNull.Value : (object)m_Kerdes06));
|
|
OriginalValues.Add("Kerdes07", (Kerdes07 == null ? (object)DBNull.Value : (object)m_Kerdes07));
|
|
OriginalValues.Add("Kerdes08", (Kerdes08 == null ? (object)DBNull.Value : (object)m_Kerdes08));
|
|
OriginalValues.Add("Kerdes09", (Kerdes09 == null ? (object)DBNull.Value : (object)m_Kerdes09));
|
|
OriginalValues.Add("Kerdes10", (Kerdes10 == null ? (object)DBNull.Value : (object)m_Kerdes10));
|
|
OriginalValues.Add("Kerdes11", (Kerdes11 == null ? (object)DBNull.Value : (object)m_Kerdes11));
|
|
OriginalValues.Add("Kerdes12", (Kerdes12 == null ? (object)DBNull.Value : (object)m_Kerdes12));
|
|
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_Kerdes11 != null && m_Kerdes11.Length > 1000)
|
|
{
|
|
throw new InvalidEntityAttributeException("NATKerdoiv", "Kerdes11", EntityAttributeError.TooLong);
|
|
}
|
|
if (m_Kerdes12 != null && m_Kerdes12.Length > 1000)
|
|
{
|
|
throw new InvalidEntityAttributeException("NATKerdoiv", "Kerdes12", EntityAttributeError.TooLong);
|
|
}
|
|
|
|
}
|
|
|
|
// kötelező asszociációk ellenőrzése...
|
|
if (m_AlkalmazottId == -1) { throw new InvalidEntityAttributeException("NATKerdoiv", "AlkalmazottId", EntityAttributeError.Empty); }
|
|
if (m_IntezmenyId == -1) { throw new InvalidEntityAttributeException("NATKerdoiv", "IntezmenyId", EntityAttributeError.Empty); }
|
|
if (m_TanevId == -1) { throw new InvalidEntityAttributeException("NATKerdoiv", "TanevId", EntityAttributeError.Empty); }
|
|
|
|
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Alaphelyzetbe állítás
|
|
protected override void Reset()
|
|
{
|
|
base.Reset();
|
|
|
|
// alaphelyzetbe állítjuk az egyszerű mezőket
|
|
this.m_IsLatta = false;
|
|
this.m_Kerdes01 = null;
|
|
this.m_Kerdes02 = null;
|
|
this.m_Kerdes03 = null;
|
|
this.m_Kerdes04 = null;
|
|
this.m_Kerdes05 = null;
|
|
this.m_Kerdes06 = null;
|
|
this.m_Kerdes07 = null;
|
|
this.m_Kerdes08 = null;
|
|
this.m_Kerdes09 = null;
|
|
this.m_Kerdes10 = null;
|
|
this.m_Kerdes11 = null;
|
|
this.m_Kerdes12 = null;
|
|
|
|
// alaphelyzetbe állítjuk az asszociációkból származó mezőket
|
|
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...
|
|
|
|
// 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 IsLatta
|
|
|
|
protected internal bool m_IsLatta;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("IsLatta", EntityPropertyBaseType.ValueType, typeof(bool), EntityCopyMethod.ShallowCopy)]
|
|
public virtual bool IsLatta
|
|
{
|
|
get
|
|
{
|
|
return m_IsLatta;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_IsLatta == value) return;
|
|
m_IsLatta = value;
|
|
FieldModified("IsLatta", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes01
|
|
|
|
protected internal int? m_Kerdes01;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes01", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes01
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes01;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes01 == value) return;
|
|
m_Kerdes01 = value;
|
|
FieldModified("Kerdes01", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes02
|
|
|
|
protected internal int? m_Kerdes02;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes02", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes02
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes02;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes02 == value) return;
|
|
m_Kerdes02 = value;
|
|
FieldModified("Kerdes02", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes03
|
|
|
|
protected internal int? m_Kerdes03;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes03", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes03
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes03;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes03 == value) return;
|
|
m_Kerdes03 = value;
|
|
FieldModified("Kerdes03", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes04
|
|
|
|
protected internal int? m_Kerdes04;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes04", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes04
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes04;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes04 == value) return;
|
|
m_Kerdes04 = value;
|
|
FieldModified("Kerdes04", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes05
|
|
|
|
protected internal int? m_Kerdes05;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes05", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes05
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes05;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes05 == value) return;
|
|
m_Kerdes05 = value;
|
|
FieldModified("Kerdes05", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes06
|
|
|
|
protected internal int? m_Kerdes06;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes06", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes06
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes06;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes06 == value) return;
|
|
m_Kerdes06 = value;
|
|
FieldModified("Kerdes06", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes07
|
|
|
|
protected internal int? m_Kerdes07;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes07", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes07
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes07;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes07 == value) return;
|
|
m_Kerdes07 = value;
|
|
FieldModified("Kerdes07", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes08
|
|
|
|
protected internal int? m_Kerdes08;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes08", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes08
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes08;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes08 == value) return;
|
|
m_Kerdes08 = value;
|
|
FieldModified("Kerdes08", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes09
|
|
|
|
protected internal int? m_Kerdes09;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes09", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes09
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes09;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes09 == value) return;
|
|
m_Kerdes09 = value;
|
|
FieldModified("Kerdes09", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes10
|
|
|
|
protected internal int? m_Kerdes10;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes10", EntityPropertyBaseType.ValueType, typeof(int), EntityCopyMethod.ShallowCopy)]
|
|
public virtual int? Kerdes10
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes10;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes10 == value) return;
|
|
m_Kerdes10 = value;
|
|
FieldModified("Kerdes10", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes11
|
|
|
|
protected internal string m_Kerdes11;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes11", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string Kerdes11
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes11;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes11 == value) return;
|
|
m_Kerdes11 = value;
|
|
FieldModified("Kerdes11", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Kerdes12
|
|
|
|
protected internal string m_Kerdes12;
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
[EntityProperty("Kerdes12", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
|
|
public virtual string Kerdes12
|
|
{
|
|
get
|
|
{
|
|
return m_Kerdes12;
|
|
}
|
|
set
|
|
{
|
|
CheckModifyable();
|
|
|
|
if (m_Kerdes12 == value) return;
|
|
m_Kerdes12 = value;
|
|
FieldModified("Kerdes12", value);
|
|
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region Asszociációkkal kapcsolatos dolgok
|
|
|
|
#region NATKerdoiv (*) -> 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 INATKerdoiv.Alkalmazott
|
|
{
|
|
get { return Alkalmazott; }
|
|
set { Alkalmazott = value as Alkalmazott; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő NATKerdoiv é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_NATKerdoiv_DA da = new Alkalmazott_NATKerdoiv_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 NATKerdoiv (*) -> 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 INATKerdoiv.Intezmeny
|
|
{
|
|
get { return Intezmeny; }
|
|
set { Intezmeny = value as Intezmeny; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő NATKerdoiv é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_NATKerdoiv_DA da = new Intezmeny_NATKerdoiv_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 NATKerdoiv (*) -> 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 INATKerdoiv.Tanev
|
|
{
|
|
get { return Tanev; }
|
|
set { Tanev = value as Tanev; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Nincs definiálva megjegyzés.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Az UML modellben szereplő NATKerdoiv é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_NATKerdoiv_DA da = new Tanev_NATKerdoiv_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
|
|
}
|
|
}
|
|
|