init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using Kreta.Ellenorzo.Domain.VN.Interfaces;
|
||||
using Kreta.Ellenorzo.Domain.VN.Logic;
|
||||
using Kreta.Ellenorzo.Domain.VN.UniqueIdentifier;
|
||||
using Kreta.Ellenorzo.Domain.VN.Utility.ValidationAttributes;
|
||||
|
||||
namespace Kreta.Ellenorzo.Domain.VN.Feljegyzes
|
||||
{
|
||||
public class FeljegyzesListRequest : IValidatableObject, IRequestUidFilter<FeljegyzesUid>, IModelValidacio<FeljegyzesListRequest>
|
||||
{
|
||||
public FeljegyzesListRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public FeljegyzesListRequest(string uidRaw)
|
||||
{
|
||||
Uid = UidLogic.GetUid(uidRaw, UidConverter);
|
||||
}
|
||||
|
||||
[ShortDateTime]
|
||||
public DateTime? DatumIg { get; set; }
|
||||
|
||||
[ShortDateTime]
|
||||
public DateTime? DatumTol { get; set; }
|
||||
|
||||
public bool IsCallerGetOnlyOneItem { get; set; }
|
||||
|
||||
public Dictionary<Predicate<FeljegyzesListRequest>, string> ModelValidaciok => new Dictionary<Predicate<FeljegyzesListRequest>, 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 FeljegyzesUid Uid { get; 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[], FeljegyzesUid> UidConverter = uidRaw => new FeljegyzesUid(uidRaw[0]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
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.UniqueIdentifier;
|
||||
using Kreta.Enums;
|
||||
|
||||
namespace Kreta.Ellenorzo.Domain.VN.Feljegyzes
|
||||
{
|
||||
public class FeljegyzesListResponse : IEqualityComparer<FeljegyzesListResponse>
|
||||
{
|
||||
public string Cim { get; set; }
|
||||
|
||||
public DateTime Datum { get; set; }
|
||||
|
||||
public FeljegyzesUid Uid { get; set; }
|
||||
|
||||
public DateTime KeszitesDatuma { get; set; }
|
||||
|
||||
public DateTime? LattamozasDatuma { get; set; }
|
||||
|
||||
public OsztalyCsoportSimplifiedResponse OsztalyCsoport { get; set; }
|
||||
|
||||
public TanarSimplifiedResponse Tanar { get; set; }
|
||||
|
||||
public string Tartalom { get; set; }
|
||||
|
||||
public Adatszotar<EsemenyTipusEnum> Tipus { get; set; }
|
||||
|
||||
public bool Equals(FeljegyzesListResponse x, FeljegyzesListResponse y) => x.Uid.Equals(x.Uid, y.Uid);
|
||||
|
||||
public int GetHashCode(FeljegyzesListResponse obj) => obj.Uid.UidRaw.GetHashCode();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue