Esempio n. 1
0
        public void OnTimer(object sender, System.Timers.ElapsedEventArgs args)
        {
            timer.Interval = 500;
            // TODO: Insert monitoring activities here.
            string workingStoredProcedure = ConfigurationManager.AppSettings["WorkingStoredProcedure"];
            string connectionString       = ConfigurationManager.AppSettings["ConnectionString"];
            string queue = ConfigurationManager.AppSettings["OnBaseQueue"];

            _onBaseInteractionHandler = new OnBaseInteractionHandler(connectionString)
            {
                LoggerAdapter = new LoggerAdapter(Source, LogName)
            };

            _onBaseInteractionHandler.AssignSolicitudeToAnUser(queue, workingStoredProcedure);
        }
Esempio n. 2
0
        private static void Main(string[] args)
        {
            string onBaseQueue            = ConfigurationManager.AppSettings["OnBaseQueue"];
            string connectionString       = ConfigurationManager.AppSettings["ConnectionString"];
            string workingStoredProcedure = ConfigurationManager.AppSettings["WorkingStoredProcedure"];

            var eventViewerLoggerAdapter = new LoggerAdapter(Source, LogName);
            var onBaseInteractionHandler = new OnBaseInteractionHandler(connectionString)
            {
                LoggerAdapter = new LoggerAdapter(Source, LogName)
            };

            try
            {
                onBaseInteractionHandler.AssignSolicitudeToAnUser(onBaseQueue, workingStoredProcedure);
            }
            catch (Exception e)
            {
                eventViewerLoggerAdapter.LogError($"{e.Message} \n {e.StackTrace}");
            }

            Console.ReadKey();
        }