init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Naplo.Domain.V3.Interfaces;
|
||||
using Kreta.Naplo.Domain.V3.Logic;
|
||||
|
||||
namespace Kreta.Naplo.Domain.V3.UniqueIdentifier
|
||||
{
|
||||
[Serializable]
|
||||
public class AdatszotarUid : IReadonlyUidRaw, IEqualityComparer<AdatszotarUid>
|
||||
{
|
||||
public AdatszotarUid(int id, string nev)
|
||||
{
|
||||
Id = id;
|
||||
Nev = nev;
|
||||
UidRaw = UidLogic.Concat(id, nev);
|
||||
}
|
||||
|
||||
public AdatszotarUid(string uidRaw)
|
||||
{
|
||||
var compositeKeyElements = UidLogic.GetCompositeKeyElements(uidRaw);
|
||||
Id = int.TryParse(compositeKeyElements[0], out int result) ? result : 0;
|
||||
Nev = compositeKeyElements[1];
|
||||
UidRaw = uidRaw;
|
||||
}
|
||||
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string Nev { get; private set; }
|
||||
|
||||
public string UidRaw { get; private set; }
|
||||
|
||||
public bool Equals(AdatszotarUid x, AdatszotarUid y) => x == y || x.UidRaw == y.UidRaw;
|
||||
|
||||
public int GetHashCode(AdatszotarUid obj) => obj.UidRaw.GetHashCode();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Naplo.Domain.V3.Interfaces;
|
||||
|
||||
namespace Kreta.Naplo.Domain.V3.UniqueIdentifier
|
||||
{
|
||||
public class IntezmenyUid : IReadonlyUidRaw, IEqualityComparer<IntezmenyUid>
|
||||
{
|
||||
public IntezmenyUid(int id)
|
||||
{
|
||||
Id = id;
|
||||
UidRaw = id.ToString();
|
||||
}
|
||||
|
||||
public IntezmenyUid(string uidRaw)
|
||||
{
|
||||
Id = int.Parse(uidRaw);
|
||||
UidRaw = uidRaw;
|
||||
}
|
||||
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string UidRaw { get; private set; }
|
||||
|
||||
public bool Equals(IntezmenyUid x, IntezmenyUid y) => x == y || x.UidRaw == y.UidRaw;
|
||||
|
||||
public int GetHashCode(IntezmenyUid obj) => obj.UidRaw.GetHashCode();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Naplo.Domain.V3.Interfaces;
|
||||
using Kreta.Naplo.Domain.V3.Logic;
|
||||
|
||||
namespace Kreta.Naplo.Domain.V3.UniqueIdentifier
|
||||
{
|
||||
public class OrarendElemUid : IReadonlyUidRaw, IEqualityComparer<OrarendElemUid>
|
||||
{
|
||||
public OrarendElemUid()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public OrarendElemUid(int id, CalendarOraTypeEnum tipus, DateTime datum)
|
||||
{
|
||||
Id = id;
|
||||
Tipus = tipus;
|
||||
Datum = datum;
|
||||
UidRaw = UidLogic.Concat(id, tipus, datum);
|
||||
}
|
||||
|
||||
public OrarendElemUid(string uidRaw)
|
||||
{
|
||||
var compositeKeyElements = UidLogic.GetCompositeKeyElements(uidRaw);
|
||||
Id = int.Parse(compositeKeyElements[0]);
|
||||
Tipus = (CalendarOraTypeEnum)System.Enum.Parse(typeof(CalendarOraTypeEnum), compositeKeyElements[1]);
|
||||
Datum = DateTime.Parse(compositeKeyElements[2]).ToLocalTime().Date;
|
||||
UidRaw = uidRaw;
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
public string UidRaw { get; private set; }
|
||||
|
||||
public CalendarOraTypeEnum Tipus { get; set; }
|
||||
|
||||
public DateTime Datum { get; set; }
|
||||
|
||||
public bool Equals(OrarendElemUid x, OrarendElemUid y) => x == y || x.UidRaw == y.UidRaw;
|
||||
|
||||
public int GetHashCode(OrarendElemUid obj) => obj.UidRaw.GetHashCode();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue