Example #1
0
        /// <summary>
        /// Recupera coleccion de eventos vigentes
        /// </summary>
        /// <returns></returns>
        public GI.BR.Eventos.Eventos RecuperarEventosActivos()
        {
            GI.BR.Eventos.Eventos eventos = new GI.BR.Eventos.Eventos();

            eventos.RecuperarEventosPendientes();

            return eventos;
        }
Example #2
0
        private EventosService()
        {
            configuracion = GI.BR.Eventos.Configuracion.RecuperarUltimaConfiguracion();

            mngEventos = new MngEventos();
            eventos = mngEventos.RecuperarEventosActivos();

            timer = new System.Timers.Timer();
            timer.Interval = configuracion.FrecuenciaGeneracion.TotalMilliseconds;
            timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
            timer.Start();
        }
Example #3
0
        private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            configuracion = GI.BR.Eventos.Configuracion.RecuperarUltimaConfiguracion();
            timer.Interval = configuracion.FrecuenciaGeneracion.TotalMilliseconds;

            if (configuracion.Activo)
            {
                //Evaluamos si debemos salir a generar eventos nuevos
                if (configuracion.FechaUltimaGeneracion.AddTicks(configuracion.FrecuenciaGeneracion.Ticks) <= DateTime.Now)
                {
                    mngEventos.GenerarEventos();
                    configuracion.SetFechaGeneracion();
                }
            }

            eventos = mngEventos.RecuperarEventosActivos();

            OnNuevosEventos(eventos);
        }
Example #4
0
 /// <summary>
 /// Revisa y genera eventos pendientes
 /// </summary>
 public void GenerarEventos()
 {
     GI.BR.Eventos.Eventos eventos = new GI.BR.Eventos.Eventos();
     eventos.GenerarEventosPendientes();
 }