Changeset 24 for trunk/USystem.pas
- Timestamp:
- Oct 21, 2011, 11:12:09 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/USystem.pas
r22 r24 16 16 PropertyTypeTable = 'Type'; 17 17 PropertyGroupTable = 'PropertyGroup'; 18 ModuleTable = 'Module'; 18 19 TypeEnumeration = 'TypeEnumeration'; 19 20 TypeFile = 'TypeFile'; … … 119 120 function AddPropertyString(ObjectId: Integer; Name, ColumnName: string; 120 121 Editable: Boolean; Default: string = ''; MaxLength: Integer = 255): Integer; 122 function AddPropertyText(ObjectId: Integer; Name, ColumnName: string; 123 Editable: Boolean; Default: string = ''): Integer; 121 124 function AddPropertyRelationOne(ObjectId: Integer; Name, ColumnName: string; 122 125 Editable: Boolean; ReferedObject: Integer): Integer; … … 126 129 function AddEnumeration(Name: string): Integer; 127 130 function AddEnumerationState(Enum: Integer; Name: string): Integer; 131 function AddModule(Name, Author, Website, Version, Description, License: string): Integer; 128 132 procedure LoadTypes; 129 133 constructor Create; … … 435 439 end; 436 440 441 function TChronisBase.AddPropertyText(ObjectId: Integer; Name, 442 ColumnName: string; Editable: Boolean; Default: string): Integer; 443 var 444 DbRows: TDbRows; 445 Data: TDictionaryStringString; 446 CustomTypeId: Integer; 447 begin 448 try 449 DbRows := TDbRows.Create; 450 Data := TDictionaryStringString.Create; 451 452 Data.Clear; 453 Data.Add('Type', IntToStr(Integer(vtText))); 454 Database.Insert(CustomTypeTableName, Data); 455 CustomTypeId := Database.LastInsertId; 456 457 Data.Clear; 458 Data.Add('CustomType', IntToStr(CustomTypeId)); 459 Data.Add('Default', Default); 460 Database.Insert(TypeString, Data); 461 //CustomTypeId := Database.LastInsertId; 462 463 Result := AddProperty(ObjectId, Name, ColumnName, CustomTypeId, Editable); 464 finally 465 Data.Free; 466 DbRows.Free; 467 end; 468 end; 469 437 470 function TChronisBase.AddPropertyRelationOne(ObjectId: Integer; Name, 438 471 ColumnName: string; Editable: Boolean; ReferedObject: Integer): Integer; … … 539 572 Data.Add('Name', Name); 540 573 Database.Insert(EnumerationState, Data); 574 Result := Database.LastInsertId; 575 finally 576 Data.Free; 577 DbRows.Free; 578 end; 579 end; 580 581 function TChronisBase.AddModule(Name, Author, Website, Version, Description, 582 License: string): Integer; 583 var 584 DbRows: TDbRows; 585 Data: TDictionaryStringString; 586 begin 587 try 588 DbRows := TDbRows.Create; 589 Data := TDictionaryStringString.Create; 590 Data.Add('Name', Name); 591 Data.Add('Author', Author); 592 Data.Add('Website', Website); 593 Data.Add('Version', Version); 594 Data.Add('Description', Description); 595 Data.Add('License', License); 596 Database.Insert(ModuleTable, Data); 541 597 Result := Database.LastInsertId; 542 598 finally
Note:
See TracChangeset
for help on using the changeset viewer.