Beispiel #1
0
        public static EnovaService Initialize(string enovaPath, ILogger logger)
        {
            Logger = logger;
            try
            {
                Logger.Info("Initializing EnovaApi");

                if (string.IsNullOrEmpty(enovaPath) || !Directory.Exists(enovaPath) || !File.Exists(Path.Combine(enovaPath, "Soneta.Business.dll")))
                {
                    throw new Exception("Nieprawidłowa ścieżka do programu enova.");
                }

                var service = new EnovaService();
                service.enovaPath = enovaPath;
                service.init();

                Logger.Info("EnovaApi initialized");
                return(service);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw;
            }
        }
Beispiel #2
0
        public static EnovaService Initialize(string enovaPath)
        {
            if (string.IsNullOrEmpty(enovaPath) || !Directory.Exists(enovaPath) || !File.Exists(Path.Combine(enovaPath, "Soneta.Business.dll")))
            {
                throw new Exception("Nieprawidłowa ścieżka do programu enova.");
            }

            var service = new EnovaService();

            service.enovaPath = enovaPath;
            service.init();
            return(service);
        }