using Kreta.BusinessLogic.Security;
using Kreta.Core.ConnectionType;
using Kreta.DataAccessManual;
using Kreta.DataAccessManual.Util;
using Kreta.Enums.ManualEnums;

namespace Kreta.BusinessLogic.Helpers
{
    public class FeltarHelper : LogicBase
    {
        #region Constructors

        public FeltarHelper(IConnectionType connectionType) : base(connectionType)
        {
        }

        #endregion Constructors

        public string FeltarASZFUrl()
        {
            return Dal.CustomConnection.Run(ConnectionType, (h) =>
            {
                var intezmenyConfigHelper = new IntezmenyConfigHelper(new DalHandlerConnectionType(ConnectionType, h));
                var feltarASZFUrl = intezmenyConfigHelper.GetIntezmenyConfig<string>(IntezmenyConfigModulEnum.FeltarASZF, IntezmenyConfigTipusEnum.Url);

                return feltarASZFUrl;
            });
        }

        public string FeltarASZFGondviseloUrl()
        {
            return Dal.CustomConnection.Run(ConnectionType, (h) =>
            {
                var intezmenyConfigHelper = new IntezmenyConfigHelper(new DalHandlerConnectionType(ConnectionType, h));
                var feltarASZFUrl = intezmenyConfigHelper.GetIntezmenyConfig<string>(IntezmenyConfigModulEnum.FeltarASZFGondviselo, IntezmenyConfigTipusEnum.Url);

                return feltarASZFUrl;
            });
        }
    }
}