init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using Kreta.Ellenorzo.Domain.VN.Interfaces;
|
||||
|
||||
namespace Kreta.Ellenorzo.Domain.VN.Faliujsag
|
||||
{
|
||||
public class FaliujsagListRequest : IValidatableObject, IModelValidacio<FaliujsagListRequest>
|
||||
{
|
||||
public DateTime? DatumIg { get; set; }
|
||||
|
||||
public DateTime? DatumTol { get; set; }
|
||||
|
||||
public Dictionary<Predicate<FaliujsagListRequest>, string> ModelValidaciok => new Dictionary<Predicate<FaliujsagListRequest>, 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 IEnumerable<ValidationResult> Validate(ValidationContext validationContext) => ModelValidaciok.Where(x => x.Key.Invoke(this)).AsEnumerable().Select(x => new ValidationResult(x.Value));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Ellenorzo.Domain.VN.UniqueIdentifier;
|
||||
|
||||
namespace Kreta.Ellenorzo.Domain.VN.Faliujsag
|
||||
{
|
||||
public class FaliujsagListResponse : IEqualityComparer<FaliujsagListResponse>
|
||||
{
|
||||
public DateTime ErvenyessegKezdete { get; set; }
|
||||
|
||||
public DateTime ErvenyessegVege { get; set; }
|
||||
|
||||
public FaliujsagUid Uid { get; set; }
|
||||
|
||||
public string RogzitoNeve { get; set; }
|
||||
|
||||
public string Cim { get; set; }
|
||||
|
||||
public string Tartalom { get; set; }
|
||||
|
||||
public bool Equals(FaliujsagListResponse x, FaliujsagListResponse y) => x.Uid.Equals(x.Uid, y.Uid);
|
||||
|
||||
public int GetHashCode(FaliujsagListResponse obj) => obj.Uid.UidRaw.GetHashCode();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue