init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using Kreta.Ellenorzo.Domain.VN.Indexers;
|
||||
using Kreta.Ellenorzo.Domain.VN.Interfaces;
|
||||
using Kreta.Ellenorzo.Domain.VN.UniqueIdentifier;
|
||||
|
||||
namespace Kreta.Ellenorzo.Domain.VN.BejelentettSzamonkeres
|
||||
{
|
||||
public class BejelentettSzamonkeresListRequest : IValidatableObject, IRequestUidsFilter<BejelentettSzamonkeresUid>, IModelValidacio<BejelentettSzamonkeresListRequest>
|
||||
{
|
||||
public BejelentettSzamonkeresListRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public BejelentettSzamonkeresListRequest(string uidsRaw)
|
||||
{
|
||||
Uids = string.IsNullOrWhiteSpace(uidsRaw) ? null : new UidsCollection<BejelentettSzamonkeresUid>(uidsRaw, UidConverter);
|
||||
}
|
||||
|
||||
public DateTime? DatumIg { get; set; }
|
||||
|
||||
public DateTime? DatumTol { get; set; }
|
||||
|
||||
public Dictionary<Predicate<BejelentettSzamonkeresListRequest>, string> ModelValidaciok => new Dictionary<Predicate<BejelentettSzamonkeresListRequest>, string>
|
||||
{
|
||||
{
|
||||
x => x.DatumIg.HasValue && x.DatumTol.HasValue && (x.DatumIg < x.DatumTol),
|
||||
$"A {nameof(DatumTol)} és a {nameof(DatumIg)} paraméterek meg vannak adva, de a {nameof(DatumTol)} nagyobb, mint a {nameof(DatumIg)} értek!"
|
||||
},
|
||||
{
|
||||
x => x.DatumIg.HasValue && x.DatumTol.HasValue && (((TimeSpan)(x.DatumIg - x.DatumTol)).Days > 31),
|
||||
$"A {nameof(DatumTol)} és a {nameof(DatumIg)} paraméterek meg vannak adva, de maximum 1 hónap intervallum kérdezhető le!"
|
||||
}
|
||||
};
|
||||
|
||||
public UidsCollection<BejelentettSzamonkeresUid> Uids { get; private set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) => ModelValidaciok.Where(x => x.Key.Invoke(this)).AsEnumerable().Select(x => new ValidationResult(x.Value));
|
||||
|
||||
public static readonly Converter<string[], BejelentettSzamonkeresUid> UidConverter = uidRaw => new BejelentettSzamonkeresUid(uidRaw[0]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Ellenorzo.Domain.VN.Adatszotar;
|
||||
using Kreta.Ellenorzo.Domain.VN.Felhasznalo.Alkalmazott.Tanar;
|
||||
using Kreta.Ellenorzo.Domain.VN.OsztalyCsoport;
|
||||
using Kreta.Ellenorzo.Domain.VN.Tantargy;
|
||||
using Kreta.Ellenorzo.Domain.VN.UniqueIdentifier;
|
||||
using Kreta.Enums;
|
||||
|
||||
namespace Kreta.Ellenorzo.Domain.VN.BejelentettSzamonkeres
|
||||
{
|
||||
public class BejelentettSzamonkeresListResponse : IEqualityComparer<BejelentettSzamonkeresListResponse>
|
||||
{
|
||||
public DateTime BejelentesDatuma { get; set; }
|
||||
|
||||
public DateTime Datum { get; set; }
|
||||
|
||||
public Adatszotar<HetNapjaTipusEnum> HetNapja { get; set; }
|
||||
|
||||
public int OrarendiOraOraszama { get; set; }
|
||||
|
||||
public TanarSimplifiedResponse RogzitoTanar { get; set; }
|
||||
|
||||
public Adatszotar<ErtekelesModEnum> SzamonkeresModja { get; set; }
|
||||
|
||||
public string SzamonkeresTemaja { get; set; }
|
||||
|
||||
public TantargyResponse Tantargy { get; set; }
|
||||
|
||||
public OsztalyCsoportSimplifiedResponse OsztalyCsoport { get; set; }
|
||||
|
||||
public BejelentettSzamonkeresUid Uid { get; set; }
|
||||
|
||||
public bool Equals(BejelentettSzamonkeresListResponse x, BejelentettSzamonkeresListResponse y) => x.Uid.Equals(x.Uid, y.Uid) && x.OrarendiOraOraszama == y.OrarendiOraOraszama;
|
||||
|
||||
public int GetHashCode(BejelentettSzamonkeresListResponse obj) => obj.Uid.UidRaw.GetHashCode();
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue