init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,17 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Naplo.BusinessLogic.V3.Naplo;
|
||||
using Kreta.Naplo.Domain.V3.Common;
|
||||
using Kreta.Naplo.Domain.V3.Tanmenet;
|
||||
|
||||
namespace Kreta.Naplo.BusinessLogic.V3.Tanmenet
|
||||
{
|
||||
public class TanmenetFacade : NaploFacade
|
||||
{
|
||||
public TanmenetFacade(MobileUser mobileUser) : base(mobileUser)
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerable<TanmenetItemListResponse> ListTanmenet(TanmenetRequest request)
|
||||
=> RunSubquery(() => TanmenetSubqueries.ListTanmenet(DefaultConnectionParameters, request));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Kreta.Core.Enum;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Core.Logic;
|
||||
using Kreta.Naplo.BusinessLogic.V3.Logic;
|
||||
using Kreta.Naplo.Dao.V3.Tanmenet;
|
||||
using Kreta.Naplo.Domain.V3.Common;
|
||||
using Kreta.Naplo.Domain.V3.Tanmenet;
|
||||
|
||||
namespace Kreta.Naplo.BusinessLogic.V3.Tanmenet
|
||||
{
|
||||
internal static class TanmenetSubqueries
|
||||
{
|
||||
public static IEnumerable<TanmenetItemListResponse> ListTanmenet(DefaultConnectionParameters dcp, TanmenetRequest request)
|
||||
{
|
||||
var tanar = new HelyettesitesLogic.Tanar(dcp.FelhasznaloId, dcp.TanevId, dcp.IntezmenyId, dcp.IntezmenyAzonosito, null);
|
||||
|
||||
if (request.TanarUid != dcp.UserIdpUniqueId && !tanar.IsHelyettesito(request.OsztalyCsoportId, request.TantargyId))
|
||||
{
|
||||
throw new BlException("Nincs jogosultsága, csak a saját vagy helyettesítési tanmenet kérdezhető le!", BlExceptionType.NincsJogosultsag);
|
||||
}
|
||||
|
||||
var response = new List<TanmenetListResponse>();
|
||||
|
||||
return dcp.DalHandler.Tanmenet().GetTanmenetek(request.TantargyId, request.OsztalyCsoportId, userIdpUniqueId: request.TanarUid)
|
||||
.ToDaoList<TanmenetResponseDao>()
|
||||
.Select(tanmenet => new TanmenetItemListResponse { Id = tanmenet.Id, EvesOraszam = tanmenet.EvesOraszam, Tema = tanmenet.Tema });
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue