Ejemplo n.º 1
0
        /// <summary>
        /// Process work each time the timer "Awakens" the SQLInformation DataLoadService
        /// </summary>
        public static void TakeSnapShot_Weekly(Object state)
        {
#if TRACE
            long startTicks = PLLog.Trace("Start", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 6);
#endif
            System.Diagnostics.Debug.WriteLine("TakeSnapShot_Weekly");

            // TODO(crhodes): Figure out what we want to do here.   For now just grab something out of Config.

            ExpandMask.DatabaseExpandSetting databaseExpandSetting = new ExpandMask.DatabaseExpandSetting(Data.Config.ExpandSetting_Weekly_Database);
            ExpandMask.InstanceExpandSetting instanceExpandSetting = new ExpandMask.InstanceExpandSetting(Data.Config.ExpandSetting_Weekly_Instance);

            PLLog.Debug(
                string.Format("Start instanceExpandSetting:{0} databaseExpandSetting:{1}", instanceExpandSetting.ExpandMask, databaseExpandSetting.ExpandMask),
                PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 6);

            SMO.Helper.Load_Instances_FromSMO(Common.ApplicationDataSet.Instances, instanceExpandSetting, databaseExpandSetting);

            //// Only do work if a business day, otherwise wait till tomorrow.

            //Predictor predictor = new Predictor(Config.MCRRequestsDBConnection, true, false, true);

            ////Don't run on non-business days

            //if(predictor.IsBusinessDay(Config.CurrentDate))
            //{
            //    PLLog.Info("Business Day", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 7);

            //    try
            //    {
            //        Data.DB.UpdateOffices();
            //        GetUnprocessedRequestsFromDB();
            //    }
            //    catch(Exception ex)
            //    {
            //        // TODO(crhodes): Determine what should happen here.  Seems like we should not continue.
            //        PLLog.Error(ex, PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 8);
            //    }
            //}
            //else
            //{
            //    PLLog.Info("Not a Business Day", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 9);
            //}
#if TRACE
            PLLog.Trace("End", PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 10, startTicks);
#endif
        }