예제 #1
0
        public void GetJobList(Action<JobList, Exception> callback)
        {
            // Use this to connect to the actual data service

            var item = new JobList();
            callback(item, null);
        }
예제 #2
0
        public Dictionary<string, Job> GetJobHistories(JobList jobList)
        {
            Object[] o = BrokerConnection.InstanceOf().Request("GetJobsDetail", null) as Object[];

            if (o == null)
                return null;

            var guiJobStatus = new Dictionary<string, StateEnums.Status>();
            var guiJobHistories =
                new Dictionary<string, Dictionary<DateTime, StateEnums.Status>>();
            guiJobStatus = o[0] as Dictionary<string, StateEnums.Status>;
            guiJobHistories = o[1] as Dictionary<string, Dictionary<DateTime, StateEnums.Status>>;

            Dictionary<string, Job> _jobs = new Dictionary<string, Job>();
            foreach (string j in jobList.Jobs.Keys)
            {
                Job jNew = jobList.Jobs[j];

                foreach (string s in guiJobHistories.Keys)
                {
                    string key = s.Replace("ADHOC_", "").Replace("_Job", "");
                    if (j.Equals(key))
                    {

                        jobList.Jobs[j].History = guiJobHistories[s];

                        foreach (DateTime d in guiJobHistories[s].Keys)
                        {
                            jNew = new Job(
                                d, jobList.Jobs[j].JobGroup, jobList.Jobs[j].JobName, guiJobHistories[s][d]);

                        }
                    }
                }
                _jobs.Add(jNew.JobName, jNew);
            }
            return _jobs;
        }
예제 #3
0
        private void GetJobs(ref JobList jobList)
        {
            try
            {
                #region pull data from database

                //get list from central config
                IList<string> jobNames = DataService.Config.Hierarchy.LevelNames(@"app\BITS_JOB_SPEC");
                //for backward-compatibility
                if (jobNames.Count == 0)
                    jobNames = (List<string>)DataService.Config.Hierarchy.LevelNames(@"appgroup\BITS_JOB_SPEC");
                log.InfoFormat("Obtained {0} jobs from Central Config.", jobNames.Count);
                ArrayList arJobNames = SortList(jobNames);

                List<string> categories = GetCategories(arJobNames);
                log.InfoFormat("Obtained {0} categories from Central Config.", categories.Count);

                #endregion

                jobList.Jobs.Clear();
                foreach (
                    string s in from string s in arJobNames
                                where !s.ToUpper().Contains("DEPR_")
                                where DataService.Config.Entitlements.Contains(s) || DataService.Config.UserRole > Role.USER
                                select s)
                {
                    jobList.Jobs.Add(s, new Job(GetCategory(s), s));
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
        }
예제 #4
0
파일: JobList.cs 프로젝트: BrianGoff/BITS
 public JobList(JobList j1)
 {
     jobs = j1.jobs;
 }