示例#1
0
        public void FillJobSchdules(JobBase job)
        {
            JobScheduleWithJobIDCollection allSchedules = LoadByJobID(job.JobID);

            job.Schedules.Clear();
            job.Schedules.CopyFrom(allSchedules.FindAll(s => s.JobID == job.JobID));
        }
        public StartWorkflowJobCollection LoadValidData()
        {
            var result = new StartWorkflowJobCollection();
            var ds     = DbHelper.RunSqlReturnDS(LOAD_VALID_JOB_SQL_CLAUSE, this.GetConnectionName());

            ORMapping.DataViewToCollection(result, ds.Tables[0].DefaultView);

            List <string> jobIDs = new List <string>();

            result.ForEach(d => jobIDs.Add(d.JobID));

            JobScheduleWithJobIDCollection schedules = JobScheduleAdapter.Instance.LoadByJobID(jobIDs.ToArray());

            foreach (JobBase job in result)
            {
                IList <JobScheduleWithJobID> list = schedules.FindAll(s => s.JobID == job.JobID);

                foreach (JobScheduleWithJobID schdule in list)
                {
                    job.Schedules.Add(schdule);
                }
            }

            return(result);
        }
示例#3
0
        public void FillJobsSchdules(IEnumerable <JobBase> jobs)
        {
            List <string> jobIDs = new List <string>();

            jobs.ForEach(job => jobIDs.Add(job.JobID));

            JobScheduleWithJobIDCollection allSchedules = LoadByJobID(jobIDs.ToArray());

            foreach (JobBase job in jobs)
            {
                job.Schedules.Clear();
                job.Schedules.CopyFrom(allSchedules.FindAll(s => s.JobID == job.JobID));
            }
        }
示例#4
0
        protected override void AfterLoad(JobCollection data)
        {
            List <string> jobIDs = new List <string>();

            data.ForEach(d => jobIDs.Add(d.JobID));

            JobScheduleWithJobIDCollection schedules = JobScheduleAdapter.Instance.LoadByJobID(jobIDs.ToArray());

            foreach (JobBase job in data)
            {
                IList <JobScheduleWithJobID> list = schedules.FindAll(s => s.JobID == job.JobID);

                foreach (JobScheduleWithJobID schdule in list)
                {
                    job.Schedules.Add(schdule);
                }
            }
        }