Changeset 23 for trunk/UDatabase.pas
- Timestamp:
- Mar 26, 2018, 12:40:10 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UDatabase.pas
r22 r23 77 77 function SearchByName(Name: string): TField; 78 78 procedure Assign(Source: TFields); 79 function AddNew(Name: string; DataType: TDataType): TField; 79 80 end; 80 81 … … 96 97 procedure Assign(Source: TRecords); 97 98 function SearchByValue(Name, Value: string): TRecord; 99 function AddNew: TRecord; 98 100 end; 99 101 … … 120 122 DbClient: TDbClient; 121 123 function SearchByName(Name: string): TTable; 124 function AddNew(Name: string): TTable; 122 125 end; 123 126 … … 145 148 Name: string; 146 149 Params: TDbConnectParams; 150 DbManager: TDbManager; 147 151 destructor Destroy; override; 148 152 function GetClient: TDbClient; … … 189 193 procedure SetConnectProfile(AValue: TDbConnectProfile); virtual; 190 194 public 195 DbManager: TDbManager; 191 196 procedure Query(Text: string; DbRows: TDbRows = nil); virtual; 192 procedure LoadTables(Tables: TTables); virtual;193 197 constructor Create; virtual; 194 198 procedure Load; virtual; … … 350 354 351 355 ConnectProfile := TDbConnectProfile.Create; 356 ConnectProfile.DbManager := DbManager; 352 357 ConnectProfile.ClientType := ClientType; 353 358 ConnectProfile.Name := GetValue('Name', ''); … … 414 419 Result := ClientType.DatabaseClientClass.Create; 415 420 Result.ConnectProfile := Self; 421 Result.DbManager := DbManager; 416 422 end; 417 423 … … 428 434 end; 429 435 436 function TTables.AddNew(Name: string): TTable; 437 begin 438 Result := TTable.Create; 439 Result.DbClient := DbClient; 440 Result.Name := Name; 441 Add(Result); 442 end; 443 430 444 { TDbClient } 431 445 … … 443 457 procedure TDbClient.Query(Text: string; DbRows: TDbRows = nil); 444 458 begin 445 end;446 447 procedure TDbClient.LoadTables(Tables: TTables);448 begin449 Tables.Clear;450 459 end; 451 460 … … 598 607 end; 599 608 609 function TRecords.AddNew: TRecord; 610 begin 611 Result := TRecord.Create; 612 Result.Parent := Parent; 613 Result.InitValues; 614 Add(Result); 615 end; 616 600 617 { TFields } 601 618 … … 622 639 TField(Items[I]).Assign(TField(Source.Items[I])); 623 640 end; 641 end; 642 643 function TFields.AddNew(Name: string; DataType: TDataType): TField; 644 begin 645 Result := TField.Create; 646 Result.Table := Table; 647 Result.Name := Name; 648 Result.DataType := DataType; 649 Add(Result); 624 650 end; 625 651
Note:
See TracChangeset
for help on using the changeset viewer.