- Timestamp:
- 07/01/15 14:59:47 (9 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 12146,12428-12430,12435,12442-12443,12445,12457,12514,12517,12519-12521,12523,12532,12542,12546,12552-12553,12556-12557,12559,12561 -
Property
svn:global-ignores
set to
*.nuget
packages
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Services.Hive merged: 12146
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive/3.3/OptimizedHiveDao.cs
r12009 r12563 245 245 ); 246 246 #endregion 247 248 249 #region Website Methods 250 private const string GetAllResourceIdsString = @"SELECT ResourceId FROM [Resource]"; 251 public IEnumerable<Guid> GetAllResourceIds() { 252 return Db.ExecuteQuery<Guid>(GetAllResourceIdsString); 253 } 254 255 private const string GetNumberOfWaitingTasksString = @"SELECT COUNT(TaskId) 256 FROM [Task] 257 WHERE TaskState LIKE 'Waiting'"; 258 public int GetNumberOfWaitingTasks() { 259 return Db.ExecuteQuery<int>(GetNumberOfWaitingTasksString).Single(); 260 } 261 262 private class UserTasks { 263 public Guid OwnerUserId; 264 public int Count; 265 } 266 267 private const string GetCalculatingTasksByUserString = @"SELECT Job.OwnerUserId, COUNT(Task.TaskId) as Count 268 FROM Task, Job 269 WHERE TaskState LIKE 'Calculating' AND Task.JobId = Job.JobId 270 GROUP BY Job.OwnerUserId"; 271 272 public Dictionary<Guid, int> GetCalculatingTasksByUser() { 273 var result = Db.ExecuteQuery<UserTasks>(GetCalculatingTasksByUserString); 274 Dictionary<Guid, int> lst = new Dictionary<Guid, int>(); 275 276 foreach (var userTask in result) { 277 lst.Add(userTask.OwnerUserId, userTask.Count); 278 } 279 return lst; 280 } 281 282 private const string GetWaitingTasksByUserString = @"SELECT Job.OwnerUserId, COUNT(Task.TaskId) as Count 283 FROM Task, Job 284 WHERE TaskState LIKE 'Waiting' AND Task.JobId = Job.JobId 285 GROUP BY Job.OwnerUserId"; 286 287 public Dictionary<Guid, int> GetWaitingTasksByUser() { 288 var result = Db.ExecuteQuery<UserTasks>(GetWaitingTasksByUserString); 289 Dictionary<Guid, int> lst = new Dictionary<Guid, int>(); 290 291 foreach (var userTask in result) { 292 lst.Add(userTask.OwnerUserId, userTask.Count); 293 } 294 return lst; 295 } 296 #endregion 247 297 } 248 298 }
Note: See TracChangeset
for help on using the changeset viewer.