Example #1
0
        public override void Execute(IJobExecutionContext context)
        {
            Log.LogTrace("[Enter]" + JobName);

            try
            {
                var auditsBatch = DataProvider.GetNextHourlyAuditBatch(null);

                Log.LogTrace("Audit batch count: " + auditsBatch.Count);

                foreach (var hourlyAudit in auditsBatch)
                {
                    var submitter = Container.Resolve <IHourlyAuditSubmitter>(new ParameterOverride("_dataProvider", DataProvider));
                    submitter.Submit(hourlyAudit);
                }

                DataProvider.Save();
            }
            catch (Exception ex)
            {
                Log.LogException(ex);
                Log.LogTrace(ex.Message + ". Check error log for more details.");
            }

            Log.LogTrace("[Exit]" + JobName);
        }
Example #2
0
        public override void Execute(IJobExecutionContext context)
        {
            Log.LogTrace("[Enter]" + JobName);

            try
            {
                var paramOverride = new ParameterOverride("_dataProvider", DataProvider);

                var unSentStaffLogins = DataProvider.GetUnsentStaffLogins();

                if (unSentStaffLogins.Any())
                {
                    Log.LogInfoMessage("Unsent staff login batch count: " + unSentStaffLogins.Count);
                }

                foreach (var unsent in unSentStaffLogins)
                {
                    var submitter = Container.Resolve <IStaffLoginSubmitter>(paramOverride);
                    submitter.Submit(unsent);
                }

                var unSentSessions = DataProvider.GetUnsentSessions();

                if (unSentSessions.Any())
                {
                    Log.LogInfoMessage("Unsent session batch count: " + unSentSessions.Count);
                }

                foreach (var session in unSentSessions)
                {
                    var submitter = Container.Resolve <ISessionSubmitter>(paramOverride);
                    submitter.Submit(session);
                }

                DataProvider.Save();
            }
            catch (Exception ex)
            {
                Log.LogException(ex);
                Log.LogTrace(ex.Message + ". Check error log for more details.");
            }

            Log.LogTrace("[Exit]" + JobName);
        }