kreta/Kreta.DataAccessGenerated/Entities/AdattisztitasIndikator.cs
2024-03-13 00:33:46 +01:00

290 lines
8.7 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 AdattisztitasIndikator 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("AdattisztitasIndikator")]
// alapértelmezett EntityHistoryMode
public class AdattisztitasIndikator : Entity, IAdattisztitasIndikator
{
internal protected AdattisztitasIndikator()
: base()
{
}
public class AttributeInfo
{
public const string AdatKor = "AdatKor";
public const string Kod = "Kod";
public const string Leiras = "Leiras";
public const string Mezo = "Mezo";
}
public class AttributeLengthInfo
{
public const int AdatKorLength = 12;
public const int KodLength = 6;
public const int LeirasLength = 512;
public const int MezoLength = 50;
}
#region General
private AdattisztitasIndikatorDA m_DA = new AdattisztitasIndikatorDA();
protected static AdattisztitasIndikator FakeAdattisztitasIndikator { get; set; }
public static AdattisztitasIndikator GiveAnInstance()
{
AdattisztitasIndikator result = FakeAdattisztitasIndikator == null
? new AdattisztitasIndikator()
: (AdattisztitasIndikator)FakeAdattisztitasIndikator.MemberwiseClone();
result.Reset();
result.SetDefaultData();
return result;
}
protected void SetDefaultData()
{
}
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<AdattisztitasIndikator> 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<AdattisztitasIndikator> 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<AdattisztitasIndikator> LoadWithFilter(string filter, Dictionary<string, object> commandParameters = null)
{
var result = new EntityCollection<AdattisztitasIndikator>();
new AdattisztitasIndikatorDA().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<AdattisztitasIndikator> LoadWithFilter(string filter, ColumnFilterMode columnFilterMode, IEnumerable<string> columns, Dictionary<string, object> commandParameters = null)
{
var result = new EntityCollection<AdattisztitasIndikator>();
new AdattisztitasIndikatorDA().LoadWithFilter(result, filter, columnFilterMode, columns, commandParameters);
return result;
}
protected override void StoreOriginalValues()
{
base.StoreOriginalValues();
OriginalValues.Add("AdatKor", (object)m_AdatKor);
OriginalValues.Add("Kod", (object)m_Kod);
OriginalValues.Add("Leiras", (object)m_Leiras);
OriginalValues.Add("Mezo", (Mezo == null ? (object)DBNull.Value : (object)m_Mezo));
}
#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_AdatKor != null && m_AdatKor.Length > 12)
{
throw new InvalidEntityAttributeException("AdattisztitasIndikator", "AdatKor", EntityAttributeError.TooLong);
}
if (m_Kod != null && m_Kod.Length > 6)
{
throw new InvalidEntityAttributeException("AdattisztitasIndikator", "Kod", EntityAttributeError.TooLong);
}
if (m_Leiras != null && m_Leiras.Length > 512)
{
throw new InvalidEntityAttributeException("AdattisztitasIndikator", "Leiras", EntityAttributeError.TooLong);
}
if (m_Mezo != null && m_Mezo.Length > 50)
{
throw new InvalidEntityAttributeException("AdattisztitasIndikator", "Mezo", EntityAttributeError.TooLong);
}
}
// kötelező asszociációk ellenőrzése...
}
#endregion
#region Alaphelyzetbe állítás
protected override void Reset()
{
base.Reset();
// alaphelyzetbe állítjuk az egyszerű mezőket
this.m_AdatKor = "";
this.m_Kod = "";
this.m_Leiras = "";
this.m_Mezo = null;
// alaphelyzetbe állítjuk az asszociációkból származó mezőket
}
#endregion
protected override void DeAssociateBeforeDelete(bool runHandler = false)
{
// Nem kaszkád törölhető asszociációk ellenőrzése, hogy üresek-e...
// kaszkád törlések...
}
#region Mezők és tulajdonságok
#region Egyszerű mezők
#region AdatKor
protected internal string m_AdatKor;
/// <summary>
/// Nincs definiálva megjegyzés.
/// </summary>
[EntityProperty("AdatKor", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
public virtual string AdatKor
{
get
{
return m_AdatKor;
}
set
{
CheckModifyable();
if (m_AdatKor == value) return;
m_AdatKor = value;
FieldModified("AdatKor", value);
}
}
#endregion
#region Kod
protected internal string m_Kod;
/// <summary>
/// Nincs definiálva megjegyzés.
/// </summary>
[EntityProperty("Kod", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
public virtual string Kod
{
get
{
return m_Kod;
}
set
{
CheckModifyable();
if (m_Kod == value) return;
m_Kod = value;
FieldModified("Kod", value);
}
}
#endregion
#region Leiras
protected internal string m_Leiras;
/// <summary>
/// Nincs definiálva megjegyzés.
/// </summary>
[EntityProperty("Leiras", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
public virtual string Leiras
{
get
{
return m_Leiras;
}
set
{
CheckModifyable();
if (m_Leiras == value) return;
m_Leiras = value;
FieldModified("Leiras", value);
}
}
#endregion
#region Mezo
protected internal string m_Mezo;
/// <summary>
/// Nincs definiálva megjegyzés.
/// </summary>
[EntityProperty("Mezo", EntityPropertyBaseType.ValueType, typeof(string), EntityCopyMethod.ShallowCopy)]
public virtual string Mezo
{
get
{
return m_Mezo;
}
set
{
CheckModifyable();
if (m_Mezo == value) return;
m_Mezo = value;
FieldModified("Mezo", value);
}
}
#endregion
#endregion
#region Asszociációkkal kapcsolatos dolgok
#endregion
#endregion
}
}