Changeset 21 for trunk/Forms
- Timestamp:
- Jun 16, 2011, 10:32:01 AM (13 years ago)
- Location:
- trunk/Forms
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UImportStructureForm.pas
r20 r21 160 160 PropType := Columns[C].Values['DATA_TYPE']; 161 161 if Columns[C].Values['CONSTRAINT_TYPE'] = 'FOREIGN KEY' then begin 162 RefObjectIndex := ObjectIdByName(Columns[C].Values['REFERENCED_TABLE_NAME']); 162 163 PropertyId := Core.System.AddPropertyRelationOne(ObjectId, PropertyName, PropertyName, 163 ObjectIdByName(Columns[C].Values['REFERENCED_TABLE_NAME']));164 True, StrToInt(TSQLTable(SQLTables[RefObjectIndex]).Table.Values['ObjId'])); 164 165 end else 165 166 if PropType = 'int' then 166 PropertyId := Core.System.AddPropertyNumber(ObjectId, PropertyName, PropertyName );167 PropertyId := Core.System.AddPropertyNumber(ObjectId, PropertyName, PropertyName, True); 167 168 if PropType = 'varchar' then 168 PropertyId := Core.System.AddPropertyString(ObjectId, PropertyName, PropertyName );169 PropertyId := Core.System.AddPropertyString(ObjectId, PropertyName, PropertyName, True); 169 170 if PropType = 'float' then 170 PropertyId := Core.System.AddPropertyFloat(ObjectId, PropertyName, PropertyName );171 PropertyId := Core.System.AddPropertyFloat(ObjectId, PropertyName, PropertyName, True); 171 172 if PropType = 'datetime' then 172 PropertyId := Core.System.AddPropertyDateTime(ObjectId, PropertyName, PropertyName );173 PropertyId := Core.System.AddPropertyDateTime(ObjectId, PropertyName, PropertyName, True); 173 174 Columns[C].Add('Id', IntToStr(PropertyId)); 174 175 Memo1.Lines.Add('Create property "' + PropertyName + '" of type ' + PropType + '"'); … … 192 193 RefPropertyId := StrToInt(TSQLTable(SQLTables[T]).Columns[RefPropertyId].Values['Id']); 193 194 PropertyId := Core.System.AddPropertyRelationMany(StrToInt(TSQLTable(SQLTables[RefObjectIndex]).Table.Values['ObjId']), TableName, TableName, 194 RefPropertyId);195 True, RefPropertyId); 195 196 end; 196 197 end; -
trunk/Forms/UItemAdd.pas
r18 r21 129 129 130 130 DataType := TReportColumn(Report.Columns[I]).CustomType; 131 DataType.LoadDef(TReportColumn(Report.Columns[I]).CustomType.CustomType); 131 132 if not (DataType is TDataTypeRelationMany) then begin 132 133 NewControl := DataType.CreateControl(Panel1); -
trunk/Forms/UItemEdit.pas
r18 r21 132 132 133 133 DataType := TReportColumn(Report.Columns[I]).CustomType; 134 DataType.LoadDef(TReportColumn(Report.Columns[I]).CustomType.CustomType); 134 135 if not (DataType is TDataTypeRelationMany) then begin 135 136 NewControl := DataType.CreateControl(Panel1); -
trunk/Forms/UItemView.pas
r17 r21 174 174 175 175 procedure TItemViewForm.LoadSubList; 176 var177 NewColumn: TListColumn;178 I: Integer;179 176 begin 180 177 //SelectedObjectId := 0; … … 186 183 Report.Load(SubListObject, '`' + PropertyName + '`=' + IntToStr(TabObjectList[TabControl1.TabIndex])); 187 184 188 Columns.Clear; 189 for I := 0 to Report.Columns.Count - 1 do 190 if not TReportColumn(Report.Columns[I]).VirtualItem then begin 191 NewColumn := Columns.Add; 192 NewColumn.Caption := TReportColumn(Report.Columns[I]).Caption; 193 end; 185 Report.FillListColumns(Columns); 194 186 Items.Count := Report.Count; 195 187 Refresh; -
trunk/Forms/UMainForm.lfm
r20 r21 6 6 ActiveControl = Panel1 7 7 Caption = 'ChronIS' 8 ClientHeight = 43 08 ClientHeight = 431 9 9 ClientWidth = 644 10 10 Menu = MainMenu1 … … 16 16 object Panel1: TPanel 17 17 Left = 0 18 Height = 43 018 Height = 431 19 19 Top = 0 20 20 Width = 184 21 21 Align = alLeft 22 22 BevelOuter = bvNone 23 ClientHeight = 43 023 ClientHeight = 431 24 24 ClientWidth = 184 25 25 TabOrder = 0 … … 34 34 object TreeView1: TTreeView 35 35 Left = 4 36 Height = 40 636 Height = 407 37 37 Top = 19 38 38 Width = 180 … … 48 48 object Panel2: TPanel 49 49 Left = 189 50 Height = 43 050 Height = 431 51 51 Top = 0 52 52 Width = 455 53 53 Align = alClient 54 54 BevelOuter = bvNone 55 ClientHeight = 43 055 ClientHeight = 431 56 56 ClientWidth = 455 57 57 TabOrder = 1 … … 66 66 object ListView1: TListView 67 67 Left = 2 68 Height = 37 468 Height = 375 69 69 Top = 19 70 70 Width = 451 … … 86 86 Left = 3 87 87 Height = 25 88 Top = 40 188 Top = 402 89 89 Width = 75 90 90 Action = AItemAdd … … 95 95 Left = 83 96 96 Height = 25 97 Top = 40 197 Top = 402 98 98 Width = 75 99 99 Action = AItemDelete … … 104 104 object Splitter1: TSplitter 105 105 Left = 184 106 Height = 43 0106 Height = 431 107 107 Top = 0 108 108 Width = 5 -
trunk/Forms/UMainForm.pas
r20 r21 445 445 446 446 ObjectGroupId := AddObject('Object groups', 'ObjectGroup', Core.System.Database.Database, GroupId); 447 AddPropertyString(ObjectGroupId, 'Name', 'Name'); 448 ObjectGroupParentId := AddPropertyRelationOne(ObjectGroupId, 'Parent', 'Parent', ObjectGroupId); 447 AddPropertyNumber(ObjectGroupId, 'Id', 'Id', False); 448 AddPropertyString(ObjectGroupId, 'Name', 'Name', True); 449 ObjectGroupParentId := AddPropertyRelationOne(ObjectGroupId, 'Parent', 'Parent', True, ObjectGroupId); 449 450 450 451 ObjectId := AddObject('Objects', 'Object', Core.System.Database.Database, GroupId); 451 AddPropertyString(ObjectId, 'Name', 'Name'); 452 ObjectIdGroupId := AddPropertyRelationOne(ObjectId, 'Group', 'Group', ObjectGroupId); 453 AddPropertyString(ObjectId, 'Schema', 'Schema'); 454 AddPropertyString(ObjectId, 'Table', 'Table'); 455 AddPropertyString(ObjectId, 'Primary key', 'PrimaryKey'); 456 AddPropertyNumber(ObjectId, 'Sequence', 'Sequence'); 452 AddPropertyNumber(ObjectId, 'Id', 'Id', False); 453 AddPropertyString(ObjectId, 'Name', 'Name', True); 454 ObjectIdGroupId := AddPropertyRelationOne(ObjectId, 'Group', 'Group', True, ObjectGroupId); 455 AddPropertyString(ObjectId, 'Schema', 'Schema', True); 456 AddPropertyString(ObjectId, 'Table', 'Table', True); 457 AddPropertyString(ObjectId, 'Primary key', 'PrimaryKey', True); 458 AddPropertyNumber(ObjectId, 'Sequence', 'Sequence', True); 457 459 458 460 PropertyTypeId := AddObject('Property types', 'Type', Core.System.Database.Database, GroupId); 459 AddPropertyString(PropertyTypeId, 'Name', 'Name'); 460 AddPropertyString(PropertyTypeId, 'Type', 'DbType'); 461 AddPropertyNumber(PropertyTypeId, 'Id', 'Id', False); 462 AddPropertyString(PropertyTypeId, 'Name', 'Name', True); 463 AddPropertyString(PropertyTypeId, 'Type', 'DbType', True); 461 464 //AddPropertyNumber(ObjectId, 'Parent', 'Parent'); 462 465 463 466 CustomTypeId := AddObject('Custom types', 'TypeCustom', Core.System.Database.Database, GroupId); 464 CustomTypeIdType := AddPropertyRelationOne(CustomTypeId, 'Type', 'Type', PropertyTypeId); 467 AddPropertyNumber(CustomTypeId, 'Id', 'Id', False); 468 CustomTypeIdType := AddPropertyRelationOne(CustomTypeId, 'Type', 'Type', True, PropertyTypeId); 465 469 466 470 ObjectPropertyGroupId := AddObject('Property groups', 'PropertyGroup', Core.System.Database.Database, GroupId); 471 AddPropertyNumber(ObjectPropertyGroupId, 'Id', 'Id', False); 467 472 468 473 ObjectPropertyId := AddObject('Properties', 'Property', Core.System.Database.Database, GroupId); 469 AddPropertyString(ObjectPropertyId, 'Name', 'Name'); 470 PropertyParentId := AddPropertyRelationOne(ObjectPropertyId, 'Object', 'Object', ObjectId); 471 ObjectPropertyIdGroup := AddPropertyRelationOne(ObjectPropertyId, 'Property group', 'PropertyGroup', ObjectPropertyGroupId); 472 AddPropertyNumber(ObjectPropertyId, 'Custom type', 'CustomType'); 473 AddProperty(ObjectPropertyId, 'Editable', 'Editable', TypeBoolean); 474 AddPropertyString(ObjectPropertyId, 'Column name', 'ColumnName'); 475 476 AddPropertyRelationMany(ObjectGroupId, 'Childs', 'Childs', PropertyParentId); 477 AddPropertyRelationMany(ObjectGroupId, 'Objects', 'Objects', ObjectIdGroupId); 478 AddPropertyRelationMany(ObjectId, 'Properties', 'Properties', PropertyParentId); 479 AddPropertyRelationMany(ObjectPropertyGroupId, 'Properties', 'Properties', ObjectPropertyIdGroup); 480 AddPropertyRelationMany(PropertyTypeId, 'Custom types', 'CustomTypes', CustomTypeIdType); 474 AddPropertyNumber(ObjectPropertyId, 'Id', 'Id', False); 475 AddPropertyString(ObjectPropertyId, 'Name', 'Name', True); 476 PropertyParentId := AddPropertyRelationOne(ObjectPropertyId, 'Object', 'Object', True, ObjectId); 477 ObjectPropertyIdGroup := AddPropertyRelationOne(ObjectPropertyId, 'Property group', 'PropertyGroup', True, ObjectPropertyGroupId); 478 AddPropertyNumber(ObjectPropertyId, 'Custom type', 'CustomType', True); 479 AddProperty(ObjectPropertyId, 'Editable', 'Editable', TypeBoolean, True); 480 AddPropertyString(ObjectPropertyId, 'Column name', 'ColumnName', True); 481 482 AddPropertyRelationMany(ObjectGroupId, 'Childs', 'Childs', True, PropertyParentId); 483 AddPropertyRelationMany(ObjectGroupId, 'Objects', 'Objects', True, ObjectIdGroupId); 484 AddPropertyRelationMany(ObjectId, 'Properties', 'Properties', True, PropertyParentId); 485 AddPropertyRelationMany(ObjectPropertyGroupId, 'Properties', 'Properties', True, ObjectPropertyIdGroup); 486 AddPropertyRelationMany(PropertyTypeId, 'Custom types', 'CustomTypes', True, CustomTypeIdType); 481 487 end; 482 488 end; … … 739 745 Report.Load(SelectedObject); 740 746 741 Columns.Clear; 742 for I := 0 to Report.Columns.Count - 1 do 743 if not TReportColumn(Report.Columns[I]).VirtualItem then begin 744 NewColumn := Columns.Add; 745 NewColumn.Caption := TReportColumn(Report.Columns[I]).Caption; 746 end; 747 Report.FillListColumns(Columns); 747 748 Items.Count := Report.Count; 748 749 Refresh;
Note:
See TracChangeset
for help on using the changeset viewer.