Пример #1
0
        private bool PreConnect_check()
        {
            DateTime currTime = DateTime.Now;

            //run Monday to Friday
            if (currTime.DayOfWeek == DayOfWeek.Saturday || currTime.DayOfWeek == DayOfWeek.Sunday)
            {
                return(false);
            }

            //run between 8am to 8pm for Admin
            if (currTime.Hour < 8 || currTime.Hour > 20)
            {
                return(false);
            }


            this.hdj = Hss_DailyJobs_master.GetJob_class_id("Inbound Data", 3);
            if (this.hdj == null)
            {
                return(false);
            }
            else
            {
                this.notes = this.hdj.Notes.Value;
            }

            if (HssDateTime.CompareDateTime_day(currTime, this.hdj.LastRunAt.Value) <= 0)
            {
                Console.WriteLine("---> InboundData3_SPR info 0: Task previous run at " + this.hdj.LastRunAt.Value);
                return(false);
            }

            return(true);
        }
Пример #2
0
        private void RefreshMainGrid()
        {
            List <Hss_DailyJobs> list = Hss_DailyJobs_master.GetAllJobs();

            this.sourceDT.Clear();
            foreach (Hss_DailyJobs hdj in list)
            {
                DataRow row = this.sourceDT.Rows.Add();
                row["ID"]         = hdj.ID;
                row["Job_Class"]  = hdj.Job_Class.Value;
                row["Job_ID"]     = hdj.Job_ID.Value;
                row["LastRunAt"]  = hdj.LastRunAt.GetValue_in_string(1);
                row["LastRunBy"]  = hdj.LastRunBy.Value;
                row["Locked"]     = hdj.Locked.Value;
                row["Notes"]      = hdj.Notes.Value;
                row["LastLockAt"] = hdj.LastLockAt.GetValue_in_string(1);
                row["LastLockBy"] = hdj.LastLockBy.Value;
            }

            UltraGrid_helper.AutoResize(this.main_ultraGrid);
        }