/// <summary>
        /// Entrance into processing the HR File
        /// </summary>
        /// <param name="args"></param>
        private static void Main(string[] args)
        {
            //Start timer
            timeForApp.Start();

            //Log start of application
            log.Info("Application Started: " + DateTime.Now);

            CreateMaps();

            Lookup lookups = createLookups();

            ProcessHR         processHR         = new ProcessHR(dataMapper, ref emailData, lookups);
            ProcessSeparation processSeparation = new ProcessSeparation(ref emailData);
            SendSummary       sendSummary       = new SendSummary(ref emailData);

            //Log action
            log.Info("Processing HR Files:" + DateTime.Now);

            //HR File
            if (File.Exists(hrFilePath))
            {
                log.Info("Starting Processing HR File: " + DateTime.Now);

                timeForProcess.Start();
                processHR.ProcessHRFile(hrFilePath);
                timeForProcess.Stop();

                log.Info("Done Processing HR File: " + DateTime.Now);
                log.Info("HR File Processing Time: " + timeForProcess.ElapsedMilliseconds);
            }
            else
            {
                log.Error("HR Links File Not Found");
            }

            //Separation File
            if (File.Exists(separationFilePath))
            {
                log.Info("Starting Processing Separation File: " + DateTime.Now);

                timeForProcess.Start();
                processSeparation.ProcessSeparationFile(separationFilePath);
                timeForProcess.Stop();

                log.Info("Done Processing Separation File: " + DateTime.Now);
                log.Info("Separation File Processing Time: " + timeForProcess.ElapsedMilliseconds);
            }
            else
            {
                log.Error("Separation File Not Found");
            }

            log.Info("Done Processing HR Links File(s):" + DateTime.Now);

            log.Info("Sending Summary File");
            sendSummary.SendSummaryEMail();
            log.Info("Summary file sent");

            //Stop second timer
            timeForApp.Stop();

            //Log total time
            log.Info(string.Format("Application Completed in {0} milliseconds", timeForApp.ElapsedMilliseconds));

            //Log application end
            log.Info("Application Done: " + DateTime.Now);
        }
示例#2
0
        static void Main(string[] args)
        {
            //Start timer
            timeForApp.Start();

            //Log start of application
            log.Info("Application Started: " + DateTime.Now);

            CreateMaps();

            Lookup lookups = createLookups();

            SendSummary      sendSummary      = new SendSummary(ref emailData);
            SendErrorSummary sendErrorSummary = new SendErrorSummary(ref emailData);
            ProcessMonster   processMonster   = new ProcessMonster(dataMapper, ref emailData, lookups);

            //Log action
            log.Info("Processing Monster File:" + DateTime.Now);

            if (File.Exists(MonsterFilePath))
            {
                log.Info("Starting Processing Monster File: " + DateTime.Now);

                timeForProcess.Start();
                processMonster.ProcessMonsterFile(MonsterFilePath);
                File.Delete(MonsterFilePath);
                timeForProcess.Stop();

                log.Info("Done Processing Monster File: " + DateTime.Now);
                log.Info("Monster File Processing Time: " + timeForProcess.ElapsedMilliseconds);
            }
            else
            {
                log.Error("Monster File Not Found");
            }

            log.Info("Done Processing Monster File(s):" + DateTime.Now);

            log.Info("Sending Valiation Error Email");

            if (emailData.ErrorRecord > 0)
            {
                sendErrorSummary.SendErrorSummaryEMail();
            }
            else
            {
                log.Info("No Validation Error Email");
            }

            log.Info("Sending Summary File");
            sendSummary.SendSummaryEMail();
            log.Info("Summary file sent");

            //Stop second timer
            timeForApp.Stop();

            //Log total time
            log.Info(string.Format("Application Completed in {0} milliseconds", timeForApp.ElapsedMilliseconds));

            //Log application end
            log.Info("Application Done: " + DateTime.Now);
        }