using System.Collections.Generic; using Kreta.BusinessLogic.Helpers; using Kreta.Core.ConnectionType; using Kreta.DataAccessManual.Util; using Kreta.Ellenorzo.Domain.VN.Common; using Kreta.Ellenorzo.Domain.VN.Intezmeny.Rendszermodul; using Kreta.Ellenorzo.Enums.VN; using Kreta.Enums; using Kreta.Enums.ManualEnums; using Kreta.KretaServer.SystemSettings; namespace Kreta.Ellenorzo.BL.VN.Intezmeny.Rendszermodul { internal static class RendszermodulSubqueries { internal static HashSet ListRendszermodul(DefaultConnectionParameters dcp) { var helper = new IntezmenyConfigHelper(new DalHandlerConnectionType(new MobileConnectionType(dcp.FelhasznaloId, dcp.IntezmenyId, dcp.IntezmenyAzonosito, dcp.TanevId), dcp.DalHandler)); var isEugyintezesEnabled = helper.GetIntezmenyConfig(IntezmenyConfigModulEnum.Eugyintezes, IntezmenyConfigTipusEnum.IsEnabled); var isLepEnabled = SystemSettingsManager.GetSystemSettingValue(RendszerBeallitasTipusEnum.Lazar_Ervin_Program_kezelese, dcp.IntezmenyAzonosito, dcp.TanevId); var feltarAszfUrl = helper.GetIntezmenyConfig(IntezmenyConfigModulEnum.FeltarASZFGondviselo, IntezmenyConfigTipusEnum.Url); var isFeltarGondviseloEnabled = IsFeltarGondviseloEnabled(dcp, helper); var response = new HashSet(new RendszermodulListResponse()) { new RendszermodulListResponse { Tipus = RendszermodulTipus.Eugyintezes, IsAktiv = isEugyintezesEnabled }, new RendszermodulListResponse { Tipus = RendszermodulTipus.LEP, IsAktiv = isLepEnabled }, new RendszermodulListResponse { Tipus = RendszermodulTipus.FeltarGondviselo, IsAktiv = isFeltarGondviseloEnabled }, new RendszermodulListResponse { Tipus = RendszermodulTipus.FeltarAszf, IsAktiv = isFeltarGondviseloEnabled, Url = feltarAszfUrl //A FeltarGondviselobe kell athelyezni } }; return response; } private static bool IsFeltarGondviseloEnabled(DefaultConnectionParameters dcp, IntezmenyConfigHelper helper) { if (!helper.GetIntezmenyConfig(IntezmenyConfigModulEnum.FeltarGondviselo, IntezmenyConfigTipusEnum.IsEnabled)) { return false; } return dcp.GondviseloId.HasValue ? new GondviseloHelper(new DalHandlerConnectionType(new MobileConnectionType(dcp.FelhasznaloId, dcp.IntezmenyId, dcp.IntezmenyAzonosito, dcp.TanevId), dcp.DalHandler)).IsGondviseloTanuloinakEvfolyamTipusaLetezik(dcp.GondviseloId.Value, Core.Constants.FeltarEvfolyamList) : new TanuloHelper(new DalHandlerConnectionType(new MobileConnectionType(dcp.FelhasznaloId, dcp.IntezmenyId, dcp.IntezmenyAzonosito, dcp.TanevId), dcp.DalHandler)).IsTanuloFeltarEvfolyamos(); } } }