- Timestamp:
- 09/08/11 14:37:52 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/Convert.cs
r6721 r6723 48 48 Command = Convert.ToDto(source.Command), 49 49 LastJobDataUpdate = (source.JobData == null ? DateTime.MinValue : source.JobData.LastUpdate), 50 HiveExperimentId = source.HiveExperimentId,50 JobId = source.JobId, 51 51 IsPrivileged = source.IsPrivileged 52 52 }; … … 76 76 target.Command = Convert.ToEntity(source.Command); 77 77 // RequiredPlugins are added by Dao 78 target. HiveExperimentId = source.HiveExperimentId;78 target.JobId = source.JobId; 79 79 target.IsPrivileged = source.IsPrivileged; 80 80 } … … 134 134 135 135 #region HiveExperiment 136 public static DT. HiveExperiment ToDto(DB.HiveExperimentsource) {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.HiveExperimentsource) {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.HiveExperimenttarget) {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; 148 148 } 149 149 } … … 151 151 152 152 #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); 165 165 } 166 166 }
Note: See TracChangeset
for help on using the changeset viewer.