Changeset 37 for trunk/Application/UDataTypes.pas
- Timestamp:
- Mar 8, 2012, 3:11:10 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UDataTypes.pas
r23 r37 6 6 7 7 uses 8 Classes, SysUtils, Controls, Spin, StdCtrls, ExtCtrls, MaskEdit, EditBtn; 8 Classes, SysUtils, Controls, Spin, StdCtrls, ExtCtrls, MaskEdit, EditBtn, 9 UChronisClient; 9 10 10 11 type … … 147 148 function GetDataType(ACustomType: Integer): TDataType; 148 149 var 149 DbRows: TDbRows;150 Proxy: TListProxy; 150 151 BaseType: Integer; 151 152 begin 152 153 try 153 DbRows := TDbRows.Create; 154 Core.System.Database.Select(DbRows, CustomTypeTableName, '*', 'Id=' + IntToStr(ACustomType)); 155 BaseType := StrToInt(DbRows[0].Values['Type']); 154 Proxy := TListProxy.Create; 155 Proxy.Client := Core.System.Client; 156 Proxy.ObjectName := CustomTypeTableName; 157 Proxy.Condition := 'Id=' + IntToStr(ACustomType); 158 Proxy.Load; 159 BaseType := StrToInt(TObjectProxy(Proxy.Objects[0]).Properties.Values['Type']); 156 160 finally 157 DbRows.Free;161 Proxy.Free; 158 162 end; 159 163 … … 231 235 procedure TDataTypeRelationMany.LoadDef(ACustomType: Integer); 232 236 var 233 DbRows: TDbRows;237 Proxy: TListProxy; 234 238 BaseType: Integer; 235 239 begin 236 240 try 237 DbRows := TDbRows.Create; 238 Core.System.Database.Select(DbRows, TypeRelationMany, '*', 'CustomType=' + IntToStr(ACustomType)); 239 PropertyID := StrToInt(DbRows[0].Values['ObjectProperty']); 241 Proxy := TListProxy.Create; 242 Proxy.Client := Core.System.Client; 243 Proxy.ObjectName := TypeRelationMany; 244 Proxy.Condition := 'CustomType=' + IntToStr(ACustomType); 245 Proxy.Load; 246 PropertyID := StrToInt(TObjectProxy(Proxy.Objects[0]).Properties.Values['ObjectProperty']); 240 247 finally 241 DbRows.Free;248 Proxy.Free; 242 249 end; 243 250 try 244 DbRows := TDbRows.Create; 245 Core.System.Database.Select(DbRows, PropertyTable, '*', 'Id=' + IntToStr(PropertyID)); 246 ObjectId := StrToInt(DbRows[0].Values['Object']); 247 PropertyName := DbRows[0].Values['ColumnName']; 251 Proxy := TListProxy.Create; 252 Proxy.Client := Core.System.Client; 253 Proxy.ObjectName := PropertyTable; 254 Proxy.Condition := 'Id=' + IntToStr(PropertyID); 255 ObjectId := StrToInt(TObjectProxy(Proxy.Objects[0]).Properties.Values['Object']); 256 PropertyName := TObjectProxy(Proxy.Objects[0]).Properties.Values['ColumnName']; 248 257 finally 249 DbRows.Free;258 Proxy.Free; 250 259 end; 251 260 end; … … 286 295 procedure TDataTypeRelationOne.LoadDef(ACustomType: Integer); 287 296 var 288 DbRows: TDbRows;297 Proxy: TListProxy; 289 298 begin 290 299 try 291 DbRows := TDbRows.Create; 292 Core.System.Database.Select(DbRows, TypeRelationOne, '*', 'CustomType=' + IntToStr(ACustomType)); 293 ObjectId := StrToInt(DbRows[0].Values['Object']); 300 Proxy := TListProxy.Create; 301 Proxy.Client := Core.System.Client; 302 Proxy.ObjectName := TypeRelationOne; 303 Proxy.Condition := 'CustomType=' + IntToStr(ACustomType); 304 Proxy.Load; 305 ObjectId := StrToInt(TObjectProxy(Proxy.Objects[0]).Properties.Values['Object']); 294 306 finally 295 DbRows.Free;307 Proxy.Free; 296 308 end; 297 309 end;
Note:
See TracChangeset
for help on using the changeset viewer.