init
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Ellenorzo.BL.VN.Ellenorzo;
|
||||
using Kreta.Ellenorzo.Domain.VN.BejelentettSzamonkeres;
|
||||
using Kreta.Ellenorzo.Domain.VN.Common;
|
||||
|
||||
namespace Kreta.Ellenorzo.BL.VN.BejelentettSzamonkeres
|
||||
{
|
||||
public class BejelentettSzamonkeresFacade : EllenorzoFacade
|
||||
{
|
||||
public BejelentettSzamonkeresFacade(MobileUser mobileUser) : base(mobileUser)
|
||||
{
|
||||
}
|
||||
|
||||
public HashSet<BejelentettSzamonkeresListResponse> ListBejelentettSzamonkeres(BejelentettSzamonkeresListRequest request)
|
||||
=> RunSubquery(() => BejelentettSzamonkeresSubqueries.ListBejelentettSzamonkeres(DefaultConnectionParameters, request));
|
||||
|
||||
public BejelentettSzamonkeresListResponse GetBejelentettSzamonkeres(string uid)
|
||||
=> RunSubquery(() => BejelentettSzamonkeresSubqueries.GetBejelentettSzamonkeres(DefaultConnectionParameters, new BejelentettSzamonkeresListRequest(uid)));
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Kreta.Core.Enum;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Core.Logic;
|
||||
using Kreta.DataAccessManual.ParameterClasses;
|
||||
using Kreta.Ellenorzo.BL.VN.Adatszotar;
|
||||
using Kreta.Ellenorzo.BL.VN.Logic;
|
||||
using Kreta.Ellenorzo.Dao.VN.BejelentettSzamonkeres;
|
||||
using Kreta.Ellenorzo.Domain.VN.Adatszotar;
|
||||
using Kreta.Ellenorzo.Domain.VN.BejelentettSzamonkeres;
|
||||
using Kreta.Ellenorzo.Domain.VN.Common;
|
||||
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.BL.VN.BejelentettSzamonkeres
|
||||
{
|
||||
internal static class BejelentettSzamonkeresSubqueries
|
||||
{
|
||||
internal static BejelentettSzamonkeresListResponse GetBejelentettSzamonkeres(DefaultConnectionParameters dcp, BejelentettSzamonkeresListRequest request)
|
||||
{
|
||||
return ListBejelentettSzamonkeres(dcp, request).SingleOrDefault() ?? throw new BlException(BlExceptionType.NemLetezoEntitas);
|
||||
}
|
||||
|
||||
internal static HashSet<BejelentettSzamonkeresListResponse> ListBejelentettSzamonkeres(DefaultConnectionParameters dcp, BejelentettSzamonkeresListRequest request)
|
||||
{
|
||||
new ValidatorLogic(request).ThrowExceptionIfModelIsNotvalid();
|
||||
|
||||
var response = new HashSet<BejelentettSzamonkeresListResponse>(new BejelentettSzamonkeresListResponse());
|
||||
|
||||
var tanuloBejelentettSzamonkeresei = dcp.DalHandler.SzamonkeresElorejelzes().GetBejelentettSzamonkeresekGrid(
|
||||
dcp.IntezmenyId,
|
||||
dcp.TanevId,
|
||||
new SzamonkeresElorejelzesSearchPco
|
||||
{
|
||||
SzamonkeresIds = request.Uids?.Select(x => x.Id).ToList(),
|
||||
TanuloId = dcp.TanuloId,
|
||||
DatumTol = request.DatumTol,
|
||||
DatumIg = request.DatumIg
|
||||
}, null).ToDaoList<BejelentettSzamonkeresResponseDao>();
|
||||
|
||||
var targyKategoriaTipusById = AdatszotarSubqueries.GetTipusByIdDictionary((int)GeneratedAdatszotarTipusEnum.TargyKategoriaTipus, dcp.TanevId);
|
||||
|
||||
foreach (var szamonkeres in tanuloBejelentettSzamonkeresei)
|
||||
{
|
||||
var bejelentettSzamonkeres = new BejelentettSzamonkeresListResponse
|
||||
{
|
||||
Datum = szamonkeres.Datum,
|
||||
HetNapja = new Adatszotar<HetNapjaTipusEnum>(szamonkeres.HetNapjaId, szamonkeres.HetNapjaNev),
|
||||
OrarendiOraOraszama = szamonkeres.OrarendiOraOraszama ?? -1,
|
||||
Tantargy = new TantargyResponse(
|
||||
szamonkeres.TantargyId,
|
||||
szamonkeres.TantargyNev,
|
||||
new Adatszotar<TargyKategoriaTipusEnum>(szamonkeres.TantargyKategoriaId, targyKategoriaTipusById[szamonkeres.TantargyKategoriaId].Name)),
|
||||
RogzitoTanar = new TanarSimplifiedResponse
|
||||
{
|
||||
Nev = szamonkeres.RogzitoTanarNev
|
||||
},
|
||||
SzamonkeresTemaja = string.IsNullOrWhiteSpace(szamonkeres.SzamonkeresTemaja) ? null : szamonkeres.SzamonkeresTemaja,
|
||||
SzamonkeresModja = new Adatszotar<ErtekelesModEnum>(szamonkeres.SzamonkeresModjaId, szamonkeres.SzamonkeresModjaNev),
|
||||
BejelentesDatuma = szamonkeres.BejelentesDatuma,
|
||||
OsztalyCsoport = new OsztalyCsoportSimplifiedResponse
|
||||
{
|
||||
Uid = new OsztalyCsoportUid(szamonkeres.OsztalyCsoportId)
|
||||
},
|
||||
Uid = new BejelentettSzamonkeresUid(szamonkeres.Id)
|
||||
};
|
||||
|
||||
_ = response.Add(bejelentettSzamonkeres);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user