This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,34 @@
using System.Linq;
using Kreta.DataAccessManual;
using Kreta.Enums;
using Kreta.Job.Tasks.Core;
namespace Kreta.Job.Tasks
{
public class SzakkepzesiJuttatasUpdateJob : ISzakkepzesiJuttatasUpdateJob
{
public void UpdateSzakkepzesiJuttatasok()
{
foreach (var azonosito in KretaServer.KretaServer.Instance.GetOsszesIntezmeny())
{
var connectionString = KretaServer.KretaServer.Instance.GetIntezmenyConnectionString(azonosito);
Dal.ServiceSystemConnection.Run(connectionString, h =>
{
var intezmenyId = h.IntezmenyDal().GetIntezmenyIdByAzonosito(azonosito);
if (intezmenyId.HasValue)
{
var intezmeny = h.IntezmenyDal().Get(intezmenyId.Value);
var intezmenyAdatok = intezmeny.IntezmenyAdatok.SingleOrDefault(x => x.Tanev.Aktiv.HasValue && x.Tanev.Aktiv.Value);
var isSzakkepzoJuttatas = intezmenyAdatok?.IsSzakkepzoJuttatas ?? false;
if (isSzakkepzoJuttatas)
{
var dal = h.JuttatasDAL();
dal.UpdateTanulokSzakkepzesiJuttatasok(intezmenyAdatok.TanevId, 0, (int)JuttatasTipusEnum.szakkepzesi_juttatas);
dal.UpdateTanulokSzakkepzesiJuttatasok(intezmenyAdatok.TanevId, 0, (int)JuttatasTipusEnum.apaczaiosztondij);
}
}
});
}
}
}
}