Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/11 14:37:52 (13 years ago)
Author:
ascheibe
Message:

#1233 Review comments: renamed HiveEperiment to Job

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/Convert.cs

    r6721 r6723  
    4848        Command = Convert.ToDto(source.Command),
    4949        LastJobDataUpdate = (source.JobData == null ? DateTime.MinValue : source.JobData.LastUpdate),
    50         HiveExperimentId = source.HiveExperimentId,
     50        JobId = source.JobId,
    5151        IsPrivileged = source.IsPrivileged
    5252      };
     
    7676        target.Command = Convert.ToEntity(source.Command);
    7777        // RequiredPlugins are added by Dao
    78         target.HiveExperimentId = source.HiveExperimentId;
     78        target.JobId = source.JobId;
    7979        target.IsPrivileged = source.IsPrivileged;
    8080      }
     
    134134
    135135    #region HiveExperiment
    136     public static DT.HiveExperiment ToDto(DB.HiveExperiment source) {
    137       if (source == null) return null;
    138       return new DT.HiveExperiment { Id = source.HiveExperimentId, Description = source.Description, Name = source.Name, OwnerUserId = source.OwnerUserId, DateCreated = source.DateCreated, ResourceNames = source.ResourceIds, LastAccessed = source.LastAccessed };
    139     }
    140     public static DB.HiveExperiment ToEntity(DT.HiveExperiment source) {
    141       if (source == null) return null;
    142       var entity = new DB.HiveExperiment(); ToEntity(source, entity);
    143       return entity;
    144     }
    145     public static void ToEntity(DT.HiveExperiment source, DB.HiveExperiment target) {
    146       if ((source != null) && (target != null)) {
    147         target.HiveExperimentId = source.Id; target.Description = source.Description; target.Name = source.Name; target.OwnerUserId = source.OwnerUserId; target.DateCreated = source.DateCreated; target.ResourceIds = source.ResourceNames; target.LastAccessed = source.LastAccessed;
     136    public static DT.Job ToDto(DB.Job source) {
     137      if (source == null) return null;
     138      return new DT.Job { Id = source.JobId, Description = source.Description, Name = source.Name, OwnerUserId = source.OwnerUserId, DateCreated = source.DateCreated, ResourceNames = source.ResourceIds, LastAccessed = source.LastAccessed };
     139    }
     140    public static DB.Job ToEntity(DT.Job source) {
     141      if (source == null) return null;
     142      var entity = new DB.Job(); ToEntity(source, entity);
     143      return entity;
     144    }
     145    public static void ToEntity(DT.Job source, DB.Job target) {
     146      if ((source != null) && (target != null)) {
     147        target.JobId = source.Id; target.Description = source.Description; target.Name = source.Name; target.OwnerUserId = source.OwnerUserId; target.DateCreated = source.DateCreated; target.ResourceIds = source.ResourceNames; target.LastAccessed = source.LastAccessed;
    148148      }
    149149    }
     
    151151
    152152    #region HiveExperimentPermission
    153     public static DT.HiveExperimentPermission ToDto(DB.HiveExperimentPermission source) {
    154       if (source == null) return null;
    155       return new DT.HiveExperimentPermission { HiveExperimentId = source.HiveExperimentId, GrantedUserId = source.GrantedUserId, GrantedByUserId = source.GrantedByUserId, Permission = Convert.ToDto(source.Permission) };
    156     }
    157     public static DB.HiveExperimentPermission ToEntity(DT.HiveExperimentPermission source) {
    158       if (source == null) return null;
    159       var entity = new DB.HiveExperimentPermission(); ToEntity(source, entity);
    160       return entity;
    161     }
    162     public static void ToEntity(DT.HiveExperimentPermission source, DB.HiveExperimentPermission target) {
    163       if ((source != null) && (target != null)) {
    164         target.HiveExperimentId = source.HiveExperimentId; target.GrantedUserId = source.GrantedUserId; target.GrantedByUserId = source.GrantedByUserId; target.Permission = Convert.ToEntity(source.Permission);
     153    public static DT.JobPermission ToDto(DB.JobPermission source) {
     154      if (source == null) return null;
     155      return new DT.JobPermission { JobId = source.JobId, GrantedUserId = source.GrantedUserId, GrantedByUserId = source.GrantedByUserId, Permission = Convert.ToDto(source.Permission) };
     156    }
     157    public static DB.JobPermission ToEntity(DT.JobPermission source) {
     158      if (source == null) return null;
     159      var entity = new DB.JobPermission(); ToEntity(source, entity);
     160      return entity;
     161    }
     162    public static void ToEntity(DT.JobPermission source, DB.JobPermission target) {
     163      if ((source != null) && (target != null)) {
     164        target.JobId = source.JobId; target.GrantedUserId = source.GrantedUserId; target.GrantedByUserId = source.GrantedByUserId; target.Permission = Convert.ToEntity(source.Permission);
    165165      }
    166166    }
Note: See TracChangeset for help on using the changeset viewer.