Ignore:
Timestamp:
Jun 16, 2011, 10:32:01 AM (13 years ago)
Author:
george
Message:
  • Added: Item selection form for TypeRelationOne.
  • Modified: Primary keys have to have their property record for each object.
  • Added: Object propery havet to be initialized with Editable flag.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UMainForm.pas

    r20 r21  
    445445
    446446  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);
    449450
    450451  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);
    457459
    458460  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);
    461464    //AddPropertyNumber(ObjectId, 'Parent', 'Parent');
    462465
    463466  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);
    465469
    466470  ObjectPropertyGroupId := AddObject('Property groups', 'PropertyGroup', Core.System.Database.Database, GroupId);
     471    AddPropertyNumber(ObjectPropertyGroupId, 'Id', 'Id', False);
    467472
    468473  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);
    481487  end;
    482488end;
     
    739745    Report.Load(SelectedObject);
    740746
    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);
    747748    Items.Count := Report.Count;
    748749    Refresh;
Note: See TracChangeset for help on using the changeset viewer.