- Timestamp:
- 12/19/17 13:22:47 (7 years ago)
- Location:
- branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs
r15540 r15546 37 37 } 38 38 39 public void DeleteByProject AndGrantedUserId(Guid projectId, IEnumerable<Guid> resourceIds) {39 public void DeleteByProjectIdAndResourceIds(Guid projectId, IEnumerable<Guid> resourceIds) { 40 40 string paramIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x))); 41 41 if (!string.IsNullOrWhiteSpace(paramIds)) { 42 string query = string.Format(DeleteByGrantedUserQuery, projectId, paramIds); 42 string query = string.Format(DeleteByProjectIdAndResourceIdsQueryString, projectId, paramIds); 43 DataContext.ExecuteCommand(query); 44 } 45 } 46 47 public void DeleteByProjectIdsAndResourceIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> resourceIds) { 48 string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x))); 49 string paramResourceIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x))); 50 if (!string.IsNullOrWhiteSpace(paramResourceIds)) { 51 string query = string.Format(DeleteByProjectIdsAndResourceIdsQueryString, paramProjectIds, paramResourceIds); 43 52 DataContext.ExecuteCommand(query); 44 53 } … … 76 85 77 86 #region String queries 78 private const string DeleteBy GrantedUserQuery=87 private const string DeleteByProjectIdAndResourceIdsQueryString = 79 88 @"DELETE FROM [AssignedProjectResource] 80 89 WHERE ProjectId = '{0}' 81 90 AND ResourceId IN ({1});"; 91 private const string DeleteByProjectIdsAndResourceIdsQueryString = 92 @"DELETE FROM [AssignedProjectResource] 93 WHERE ProjectId IN ({0}) 94 AND ResourceId IN ({1});"; 82 95 private const string CheckProjectGrantedForResourcesQueryString = @" 83 96 WITH rtree AS -
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs
r15497 r15546 43 43 RequiredPluginDao RequiredPluginDao { get; } 44 44 ResourceDao ResourceDao { get; } 45 ResourcePermissionDao ResourcePermissionDao { get; }46 45 SlaveDao SlaveDao { get; } 47 46 SlaveGroupDao SlaveGroupDao { get; } -
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs
r15497 r15546 96 96 public ResourceDao ResourceDao { 97 97 get { return resourceDao ?? (resourceDao = new ResourceDao(dataContext)); } 98 }99 100 private ResourcePermissionDao resourcePermissionDao;101 public ResourcePermissionDao ResourcePermissionDao {102 get { return resourcePermissionDao ?? (resourcePermissionDao = new ResourcePermissionDao(dataContext)); }103 98 } 104 99
Note: See TracChangeset
for help on using the changeset viewer.