Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/19/17 13:22:47 (7 years ago)
Author:
jzenisek
Message:

#2839 worked on ProjectResource assignment: (cascading) assigning & unassigning

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  
    3737    }
    3838
    39     public void DeleteByProjectAndGrantedUserId(Guid projectId, IEnumerable<Guid> resourceIds) {
     39    public void DeleteByProjectIdAndResourceIds(Guid projectId, IEnumerable<Guid> resourceIds) {
    4040      string paramIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
    4141      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);
    4352        DataContext.ExecuteCommand(query);
    4453      }
     
    7685
    7786    #region String queries
    78     private const string DeleteByGrantedUserQuery =
     87    private const string DeleteByProjectIdAndResourceIdsQueryString =
    7988      @"DELETE FROM [AssignedProjectResource]
    8089         WHERE ProjectId = '{0}'
    8190           AND ResourceId IN ({1});";
     91    private const string DeleteByProjectIdsAndResourceIdsQueryString =
     92      @"DELETE FROM [AssignedProjectResource]
     93             WHERE ProjectId IN ({0})
     94               AND ResourceId IN ({1});";
    8295    private const string CheckProjectGrantedForResourcesQueryString = @"
    8396    WITH rtree AS
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IPersistenceManager.cs

    r15497 r15546  
    4343    RequiredPluginDao RequiredPluginDao { get; }
    4444    ResourceDao ResourceDao { get; }
    45     ResourcePermissionDao ResourcePermissionDao { get; }
    4645    SlaveDao SlaveDao { get; }
    4746    SlaveGroupDao SlaveGroupDao { get; }
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Manager/PersistenceManager.cs

    r15497 r15546  
    9696    public ResourceDao ResourceDao {
    9797      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)); }
    10398    }
    10499
Note: See TracChangeset for help on using the changeset viewer.