コード例 #1
0
        private static DataSet GetJobDetails(string sqlsPath, string eodDate, IJobDetailRepository jobDetailRepository)
        {
            var xdoc   = XDocument.Load(sqlsPath);
            var result = from item in xdoc.Element("sqls")?.Elements("category")
                         select new
            {
                Category = item.Attribute("Name")?.Value,
                Sqls     = (from sql in item.Elements("sql")
                            select new
                {
                    Priority = sql.Attribute("priority")?.Value,
                    Description = sql.Attribute("description")?.Value,
                    SqlStatement = sql.Value
                }).OrderBy(x => x.Priority).ToList()
            };
            DataSet dataSet = new DataSet();

            foreach (var category in result)
            {
                DataTable jobDeatils = new DataTable(category.Category);
                foreach (var sql in category.Sqls)
                {
                    var table = jobDetailRepository.GetJobDetail(sql.SqlStatement.Replace("{eodDate}", eodDate), category.Category);

                    if (table.Rows.Count != 0)
                    {
                        break;
                    }
                }
                dataSet.Tables.Add(jobDeatils);
            }
            return(dataSet);
        }
コード例 #2
0
        public JobDetail GetJobDetail(string jobName, string jobGroup)
        {
            var jobDetail = _jobDetailRepository.GetJobDetail(jobName, jobGroup);

            return(jobDetail != null
                ? new JobDetail {
                Id = jobDetail.Id,
                InstanceId = jobDetail.InstanceId,
                JobName = jobDetail.JobName,
                JobGroup = jobDetail.JobGroup,
                JobDescription = jobDetail.JobDescription,
                JobSchedule = jobDetail.JobSchedule,
                JobLastRunTime = jobDetail.JobLastRunTime,
                JobNextRunTime = jobDetail.JobNextRunTime,
                StatusId = jobDetail.StatusId
            }
                : null);
        }