init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,126 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Helpers;
|
||||
using Kreta.Core.ConnectionType;
|
||||
using Kreta.Core.Enum;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Core.Logic;
|
||||
using Kreta.DataAccessManual.Util;
|
||||
using Kreta.Ellenorzo.BL.VN.Intezmeny.Rendszermodul;
|
||||
using Kreta.Ellenorzo.Dao.VN.Felhasznalo.Gondviselo;
|
||||
using Kreta.Ellenorzo.Domain.VN.Common;
|
||||
using Kreta.Ellenorzo.Domain.VN.Felhasznalo.Gondviselo;
|
||||
using Kreta.Ellenorzo.Domain.VN.UniqueIdentifier;
|
||||
using Kreta.Ellenorzo.Enums;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Ellenorzo.BL.VN.Felhasznalo.Gondviselo
|
||||
{
|
||||
internal static class GondviseloSubqueries
|
||||
{
|
||||
internal static HashSet<GondviseloResponse> ListGondviseloForTanulo(DefaultConnectionParameters dcp)
|
||||
{
|
||||
var response = new HashSet<GondviseloResponse>(new GondviseloResponse());
|
||||
|
||||
foreach (var gondviselo in dcp.DalHandler.Tanulo().GetGondviseloAlapertelmezettAdatok(dcp.TanuloId, dcp.TanevId).ToDaoList<GondviseloResponseDao>())
|
||||
{
|
||||
if (dcp.JogosultsagLista.Contains(FelhasznaloSzerepkor.Tanulo) || (dcp.UserIdpUniqueId == gondviselo.IdpUniqueId))
|
||||
{
|
||||
var responseItem = new GondviseloResponse
|
||||
{
|
||||
Uid = new GondviseloUid(gondviselo.Id),
|
||||
IdpUniqueId = gondviselo.IdpUniqueId,
|
||||
Nev = gondviselo.Nev,
|
||||
EmailCim = !string.IsNullOrWhiteSpace(gondviselo.EmailCim) ? gondviselo.EmailCim : null,
|
||||
Telefonszam = !string.IsNullOrWhiteSpace(gondviselo.Telefonszam) ? gondviselo.Telefonszam : null,
|
||||
IsTorvenyesKepviselo = gondviselo.IsTorvenyesKepviselo
|
||||
};
|
||||
|
||||
if (!response.Add(responseItem))
|
||||
{
|
||||
throw new BlException(BlExceptionType.DuplikaltKulcs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
internal static GondviseloAdatokResponse GetGondviseloAdatlap(DefaultConnectionParameters dcp)
|
||||
{
|
||||
var gondviselo = dcp.DalHandler.Gondviselo().Get(dcp.GondviseloId.Value) ?? throw new BlException(BlExceptionType.NemLetezoEntitas);
|
||||
|
||||
return gondviselo.Torolt
|
||||
? throw new BlException(BlExceptionType.NemLetezoEntitas)
|
||||
: new GondviseloAdatokResponse
|
||||
{
|
||||
Elotag = gondviselo.Elotag,
|
||||
Vezeteknev = gondviselo.Vezeteknev,
|
||||
Utonev = gondviselo.Utonev,
|
||||
SzuletesiVezeteknev = gondviselo.SzuletesiVezeteknev,
|
||||
SzuletesiUtonev = gondviselo.SzuletesiUtonev,
|
||||
AnyjaVezeteknev = gondviselo.AnyjaVezeteknev,
|
||||
AnyjaUtonev = gondviselo.AnyjaUtonev,
|
||||
SzuletesiHely = gondviselo.SzuletesiHely,
|
||||
SzuletesiDatum = gondviselo.SzuletesiDatum
|
||||
};
|
||||
}
|
||||
|
||||
internal static void SaveGondviseloEszkozIgenyles(DefaultConnectionParameters dcp, GondviseloEszkozIgenylesRequest request)
|
||||
{
|
||||
if (RendszermodulSubqueries.ListRendszermodul(dcp).First(r => r.Tipus == Enums.VN.RendszermodulTipus.FeltarGondviselo).IsAktiv && FelhasznaloSubqueries.IsGondviseloTorvenyesKepviselo(dcp))
|
||||
{
|
||||
var feltarGondviseloHelper = new FeltarGondviseloHelper(new DalHandlerConnectionType(new MobileConnectionType(dcp.FelhasznaloId, dcp.IntezmenyId, dcp.IntezmenyAzonosito, dcp.TanevId), dcp.DalHandler));
|
||||
|
||||
if (feltarGondviseloHelper.IsEszkozIgenyelheto(dcp.TanuloId))
|
||||
{
|
||||
UpdateGondviseloAdatlapData(dcp, request);
|
||||
feltarGondviseloHelper.EszkozIgenyles(dcp.TanuloId, dcp.GondviseloId.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BlException(AdminisztracioResource.ATanulonakMarVanBenyujtottRegisztracioja, HttpStatusCode.Forbidden);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BlException(BlExceptionType.NincsJogosultsag);
|
||||
}
|
||||
}
|
||||
internal static void UpdateGondviseloAdatlap(DefaultConnectionParameters dcp, GondviseloBaseAdatlapRequest request)
|
||||
{
|
||||
var intezmenyConfigHelper = new IntezmenyConfigHelper(new MobileConnectionType(dcp.FelhasznaloId, dcp.IntezmenyId, dcp.IntezmenyAzonosito, dcp.TanevId));
|
||||
bool gondviseloSzemelyesAdatokSzerkeszteseEnabled = intezmenyConfigHelper.GetIntezmenyConfig<bool>(IntezmenyConfigModulEnum.FeltarGondviselo, IntezmenyConfigTipusEnum.IsEnabled);
|
||||
if (gondviseloSzemelyesAdatokSzerkeszteseEnabled)
|
||||
{
|
||||
UpdateGondviseloAdatlapData(dcp, request);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BlException(BlExceptionType.NincsJogosultsag);
|
||||
}
|
||||
}
|
||||
|
||||
private static void UpdateGondviseloAdatlapData(DefaultConnectionParameters dcp, GondviseloBaseAdatlapRequest request)
|
||||
{
|
||||
new GondviseloHelper(new DalHandlerConnectionType(new MobileConnectionType(dcp.FelhasznaloId, dcp.IntezmenyId, dcp.IntezmenyAzonosito, dcp.TanevId), dcp.DalHandler))
|
||||
.SaveGondviselo4TAdatok(dcp.GondviseloId.Value,
|
||||
new Felhasznalo4TAdatokCo
|
||||
{
|
||||
Elotag = request.Elotag,
|
||||
Vezeteknev = request.Vezeteknev,
|
||||
Utonev = request.Utonev,
|
||||
SzuletesiVezeteknev = request.SzuletesiVezeteknev,
|
||||
SzuletesiUtonev = request.SzuletesiUtonev,
|
||||
SzuletesiHely = request.SzuletesiHely,
|
||||
SzuletesiDatum = request.SzuletesiDatum,
|
||||
AnyjaVezeteknev = request.AnyjaVezeteknev,
|
||||
AnyjaUtonev = request.AnyjaUtonev
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue