Ignore:
Timestamp:
Nov 24, 2011, 10:03:48 AM (13 years ago)
Author:
chronos
Message:
  • Modified: Item list is separated from MainForm as ItemListForm.
  • Modified: Now it is possible to open multiple forms for same operation as View, Edit, Add, List. Open forms are listed in main windows tab list.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemAdd.pas

    r22 r31  
    2828    { private declarations }
    2929  public
     30    SelectedObject: TChronisObject;
     31    SelectedItemId: Integer;
    3032    Report: TReport;
    3133  end;
     
    5961    for I := 0 to Report.Columns.Count - 1 do
    6062    if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then
    61     if TReportColumn(Report.Columns[I]).ColumnName <> MainForm.SelectedObject.PrimaryKey then begin
     63    if TReportColumn(Report.Columns[I]).ColumnName <> SelectedObject.PrimaryKey then begin
    6264      DataType := TReportColumn(Report.Columns[I]).CustomType;
    6365      Data.Add(TReportColumn(Report.Columns[I]).ColumnName,
    6466        DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control)));
    6567    end;
    66     Database.Insert(MainForm.SelectedObject.Table, Data, MainForm.SelectedObject.Schema);
     68    Database.Insert(SelectedObject.Table, Data, SelectedObject.Schema);
    6769  finally
    6870    Data.Free;
    6971  end;
    70   MainForm.LoadItemList;
     72  //MainForm.LoadItemList;
    7173  Close;
    7274end;
     
    8284  Report := TReport.Create;
    8385  Report.Base := Core.System;
     86  SelectedObject := TChronisObject.Create;
     87  SelectedObject.Base := Core.System;
    8488end;
    8589
     
    8791begin
    8892  Report.Free;
     93  SelectedObject.Free;
    8994end;
    9095
     
    113118    Panel1.Controls[I].Free;
    114119
    115   Report.Load(MainForm.SelectedObject, MainForm.SelectedObject.PrimaryKey + ' = ' +
    116     IntToStr(MainForm.SelectedItem));
     120  Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' +
     121    IntToStr(SelectedItemId));
    117122
    118123  // Load column names
Note: See TracChangeset for help on using the changeset viewer.