- Timestamp:
- 04/17/09 14:03:06 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/ResourceAdapter.cs
r1580 r1597 49 49 50 50 return clientAdapter; 51 } 52 } 53 54 private IClientGroupAdapter clientGroupAdapter = null; 55 56 private IClientGroupAdapter ClientGroupAdapter { 57 get { 58 if (clientGroupAdapter == null) 59 clientGroupAdapter = 60 this.Session.GetDataAdapter<ClientGroup, IClientGroupAdapter>(); 61 62 return clientGroupAdapter; 51 63 } 52 64 } … … 108 120 109 121 #endregion 122 123 #region IPolymorphicDataAdapter<Resource> Members 124 125 public void UpdatePolymorphic(Resource res) { 126 if (res is ClientInfo) { 127 ClientAdapter.Update(res as ClientInfo); 128 } else if (res is ClientGroup) { 129 ClientGroupAdapter.Update(res as ClientGroup); 130 } else { 131 this.Update(res); 132 } 133 } 134 135 public Resource GetByIdPolymorphic(Guid id) { 136 ClientGroup group = 137 ClientGroupAdapter.GetById(id); 138 139 if (group != null) 140 return group; 141 else { 142 ClientInfo client = 143 ClientAdapter.GetById(id); 144 145 if (client != null) 146 return client; 147 else { 148 return this.GetById(id); 149 } 150 } 151 } 152 153 public bool DeletePolymorphic(Resource res) { 154 if (res is ClientInfo) { 155 return ClientAdapter.Delete(res as ClientInfo); 156 } else if (res is ClientGroup) { 157 return ClientGroupAdapter.Delete(res as ClientGroup); 158 } else { 159 return this.Delete(res); 160 } 161 } 162 163 #endregion 110 164 } 111 165 }
Note: See TracChangeset
for help on using the changeset viewer.