Changeset 6006 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs
- Timestamp:
- 04/12/11 13:43:05 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources
- Property svn:ignore
-
old new 4 4 PrecompiledWeb 5 5 CreateEventLogSources 6 WindowsFormsTestProject
-
- Property svn:ignore
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs
r5955 r6006 237 237 238 238 private DT.HiveExperiment AddStatsToExperiment(HiveDataContext db, DT.HiveExperiment exp) { 239 var jobs = new List<Job>(); 240 CollectChildJobs(db, exp.RootJobId, jobs); 241 exp.JobCount = jobs.Count; 239 if (exp == null) 240 return null; 241 242 var jobs = db.Jobs.Where(j => j.HiveExperimentId == exp.Id); 243 exp.JobCount = jobs.Count(); 242 244 exp.CalculatingCount = jobs.Count(j => j.State == JobState.Calculating); 243 245 exp.FinishedCount = jobs.Count(j => j.State == JobState.Finished); … … 575 577 public Guid GetExperimentForJob(Guid jobId) { 576 578 using (var db = CreateContext()) { 577 var job = db.Jobs.SingleOrDefault(j => j.JobId == jobId); 578 if (job.ParentJobId.HasValue) { 579 return GetExperimentForJob(job.ParentJobId.Value); 580 } else { 581 return db.HiveExperiments.SingleOrDefault(he => he.RootJobId == jobId).HiveExperimentId; 582 } 579 return db.Jobs.Single(j => j.JobId == jobId).HiveExperimentId; 583 580 } 584 581 }
Note: See TracChangeset
for help on using the changeset viewer.