示例#1
0
        static void Main(string[] args)
        {
            var log = new SIR.Common.Log.Logger("SIR.Sync", new Common.Log.LoggerConfig()
            {
                Console = new Common.Log.LoggerConfig.ConsoleConfig()
                {
                    ShowInConsole = true
                }
            });

            try
            {
                log.Info("== Inicio de Procesamiento de SIR.Sync ==");
                log.Info($"Version: {System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}");
                log.Info($"Command: {AppDomain.CurrentDomain.FriendlyName} {string.Join(' ', args)}");

                var optionsRes = new ParseArgs().Parse <Arguments>(args);
                if (optionsRes.ExistsErrorMessages)
                {
                    log.Log(optionsRes);
                    Console.ReadLine();
                    return;
                }
                var options = optionsRes.Data;

                if (options.ShowHelp)
                {
                    Console.WriteLine("Listado de Parámetros válidos para la aplicación");
                    Console.WriteLine(new ParseArgs().GetHelpText <Arguments>());
                    return;
                }

                var config = Newtonsoft.Json.JsonConvert.DeserializeObject <Application>(System.IO.File.ReadAllText("SIR.Sync.Config.json"));

                if (options.ProcesarSync)
                {
                    var procesador = new BLL.ProcesadorSync(log, config);

                    procesador.ProcesarNotificaciones(options.FechaDesde, options.FechaHasta);
                    procesador.ProcesarAnulaciones(options.FechaDesde, options.FechaHasta);
                    procesador.ProcesarVencimientos();
                    procesador.ProcesarNotificacionesPE();
                }

                if (options.ProcesarRendicion)
                {
                    var procesador = new BLL.ProcesadorRendiciones(log, config);

                    procesador.ProcesarRendicionDAI(options.FechaRendicion, options.DiasRendicion);
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
            finally
            {
                log.Info("== Fin de Procesamiento de SIR.Sync ==");
            }
        }
        public ProcesadorSync(SIR.Common.Log.Logger logger, DTO.Config.Application config)
        {
            this.Logger = logger;
            this.Config = config;
            this.DAO    = new SIR.Common.DAL.EF.EFDAO(config.ConnectionString, "SYN", Assembly.GetExecutingAssembly());

            this.VEPConnector = new SIR.Common.Connector.VEPConnector(
                new Uri(DAO.Config.Get("VEPUrl", Logger)?.Value),
                DAO.Config.Get("VEPUser", Logger)?.Value,
                DAO.Config.Get("VEPPass", Logger)?.Value
                );
            this.RecaudaConnector = new SIR.Common.Connector.RecaudaConnector(new Uri(DAO.Config.Get("RecaudaUrl", Logger)?.Value));
        }
示例#3
0
 public BcoCiudadService(SIR.Common.Log.Logger log, Common.DTO.Config.Application config)
 {
     this.Logger = log;
     this.Config = config;
     this.DAO    = new DAL.DAO(config.ConnectionString);
 }