init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,39 @@
|
|||
namespace Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Logic
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Co.Get.Felmentes;
|
||||
using Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Enum;
|
||||
using Kreta.Core.Exceptions;
|
||||
|
||||
public static class TanuloLogic
|
||||
{
|
||||
public static bool CalculateIsNowFelmentett(List<FelmentesGetResponseCo> felmentesek, DateTime examinedDate, int intezmenyId, string intezmenyAzonosito, int tanevId, FelmentesType felmentesTypeFilter = FelmentesType.None)
|
||||
{
|
||||
foreach (var felmentes in felmentesek)
|
||||
{
|
||||
if (FelmentesLogic.CalculateIsNowFelmentettByDatum(examinedDate, felmentes.KezdetDatuma, felmentes.VegDatuma))
|
||||
{
|
||||
switch (felmentesTypeFilter)
|
||||
{
|
||||
case FelmentesType.None:
|
||||
return felmentes.IsOralatogatasAlolFelmentett || felmentes.IsErtekelesAlolFelmentett;
|
||||
case FelmentesType.OralatogatasAlol:
|
||||
return felmentes.IsOralatogatasAlolFelmentett;
|
||||
case FelmentesType.ErtekelesAlol:
|
||||
return felmentes.IsErtekelesAlolFelmentett;
|
||||
case FelmentesType.OralatogatasEsErtekelesAlol:
|
||||
return felmentes.IsOralatogatasAlolFelmentett && felmentes.IsErtekelesAlolFelmentett;
|
||||
default:
|
||||
throw new BlException($"{nameof(FelmentesType)} does not exist!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool CalculateIsNowMagantanulo(bool isMagantanulo, DateTime? maganTanulosagKezdetDatuma, DateTime? maganTanulosagVegeDatuma, DateTime oraDatuma)
|
||||
=> isMagantanulo && (!maganTanulosagKezdetDatuma.HasValue || maganTanulosagKezdetDatuma.Value <= oraDatuma) && (!maganTanulosagVegeDatuma.HasValue || maganTanulosagVegeDatuma.Value >= oraDatuma);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue