Changeset 21 for trunk/Forms


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.
Location:
trunk/Forms
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UImportStructureForm.pas

    r20 r21  
    160160        PropType := Columns[C].Values['DATA_TYPE'];
    161161        if Columns[C].Values['CONSTRAINT_TYPE'] = 'FOREIGN KEY' then begin
     162          RefObjectIndex := ObjectIdByName(Columns[C].Values['REFERENCED_TABLE_NAME']);
    162163          PropertyId := Core.System.AddPropertyRelationOne(ObjectId, PropertyName, PropertyName,
    163             ObjectIdByName(Columns[C].Values['REFERENCED_TABLE_NAME']));
     164            True, StrToInt(TSQLTable(SQLTables[RefObjectIndex]).Table.Values['ObjId']));
    164165        end else
    165166        if PropType = 'int' then
    166           PropertyId := Core.System.AddPropertyNumber(ObjectId, PropertyName, PropertyName);
     167          PropertyId := Core.System.AddPropertyNumber(ObjectId, PropertyName, PropertyName, True);
    167168        if PropType = 'varchar' then
    168           PropertyId := Core.System.AddPropertyString(ObjectId, PropertyName, PropertyName);
     169          PropertyId := Core.System.AddPropertyString(ObjectId, PropertyName, PropertyName, True);
    169170        if PropType = 'float' then
    170           PropertyId := Core.System.AddPropertyFloat(ObjectId, PropertyName, PropertyName);
     171          PropertyId := Core.System.AddPropertyFloat(ObjectId, PropertyName, PropertyName, True);
    171172        if PropType = 'datetime' then
    172           PropertyId := Core.System.AddPropertyDateTime(ObjectId, PropertyName, PropertyName);
     173          PropertyId := Core.System.AddPropertyDateTime(ObjectId, PropertyName, PropertyName, True);
    173174        Columns[C].Add('Id', IntToStr(PropertyId));
    174175        Memo1.Lines.Add('Create property "' + PropertyName + '" of type ' + PropType + '"');
     
    192193          RefPropertyId := StrToInt(TSQLTable(SQLTables[T]).Columns[RefPropertyId].Values['Id']);
    193194          PropertyId := Core.System.AddPropertyRelationMany(StrToInt(TSQLTable(SQLTables[RefObjectIndex]).Table.Values['ObjId']), TableName, TableName,
    194             RefPropertyId);
     195            True, RefPropertyId);
    195196        end;
    196197      end;
  • trunk/Forms/UItemAdd.pas

    r18 r21  
    129129
    130130      DataType := TReportColumn(Report.Columns[I]).CustomType;
     131      DataType.LoadDef(TReportColumn(Report.Columns[I]).CustomType.CustomType);
    131132      if not (DataType is TDataTypeRelationMany) then begin
    132133        NewControl := DataType.CreateControl(Panel1);
  • trunk/Forms/UItemEdit.pas

    r18 r21  
    132132
    133133      DataType := TReportColumn(Report.Columns[I]).CustomType;
     134      DataType.LoadDef(TReportColumn(Report.Columns[I]).CustomType.CustomType);
    134135      if not (DataType is TDataTypeRelationMany) then begin
    135136        NewControl := DataType.CreateControl(Panel1);
  • trunk/Forms/UItemView.pas

    r17 r21  
    174174
    175175procedure TItemViewForm.LoadSubList;
    176 var
    177   NewColumn: TListColumn;
    178   I: Integer;
    179176begin
    180177  //SelectedObjectId := 0;
     
    186183    Report.Load(SubListObject, '`' + PropertyName + '`=' + IntToStr(TabObjectList[TabControl1.TabIndex]));
    187184
    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);
    194186    Items.Count := Report.Count;
    195187    Refresh;
  • trunk/Forms/UMainForm.lfm

    r20 r21  
    66  ActiveControl = Panel1
    77  Caption = 'ChronIS'
    8   ClientHeight = 430
     8  ClientHeight = 431
    99  ClientWidth = 644
    1010  Menu = MainMenu1
     
    1616  object Panel1: TPanel
    1717    Left = 0
    18     Height = 430
     18    Height = 431
    1919    Top = 0
    2020    Width = 184
    2121    Align = alLeft
    2222    BevelOuter = bvNone
    23     ClientHeight = 430
     23    ClientHeight = 431
    2424    ClientWidth = 184
    2525    TabOrder = 0
     
    3434    object TreeView1: TTreeView
    3535      Left = 4
    36       Height = 406
     36      Height = 407
    3737      Top = 19
    3838      Width = 180
     
    4848  object Panel2: TPanel
    4949    Left = 189
    50     Height = 430
     50    Height = 431
    5151    Top = 0
    5252    Width = 455
    5353    Align = alClient
    5454    BevelOuter = bvNone
    55     ClientHeight = 430
     55    ClientHeight = 431
    5656    ClientWidth = 455
    5757    TabOrder = 1
     
    6666    object ListView1: TListView
    6767      Left = 2
    68       Height = 374
     68      Height = 375
    6969      Top = 19
    7070      Width = 451
     
    8686      Left = 3
    8787      Height = 25
    88       Top = 401
     88      Top = 402
    8989      Width = 75
    9090      Action = AItemAdd
     
    9595      Left = 83
    9696      Height = 25
    97       Top = 401
     97      Top = 402
    9898      Width = 75
    9999      Action = AItemDelete
     
    104104  object Splitter1: TSplitter
    105105    Left = 184
    106     Height = 430
     106    Height = 431
    107107    Top = 0
    108108    Width = 5
  • 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.