Changeset 31 for trunk/Forms/UItemAdd.pas
- Timestamp:
- Nov 24, 2011, 10:03:48 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemAdd.pas
r22 r31 28 28 { private declarations } 29 29 public 30 SelectedObject: TChronisObject; 31 SelectedItemId: Integer; 30 32 Report: TReport; 31 33 end; … … 59 61 for I := 0 to Report.Columns.Count - 1 do 60 62 if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then 61 if TReportColumn(Report.Columns[I]).ColumnName <> MainForm.SelectedObject.PrimaryKey then begin63 if TReportColumn(Report.Columns[I]).ColumnName <> SelectedObject.PrimaryKey then begin 62 64 DataType := TReportColumn(Report.Columns[I]).CustomType; 63 65 Data.Add(TReportColumn(Report.Columns[I]).ColumnName, 64 66 DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control))); 65 67 end; 66 Database.Insert( MainForm.SelectedObject.Table, Data, MainForm.SelectedObject.Schema);68 Database.Insert(SelectedObject.Table, Data, SelectedObject.Schema); 67 69 finally 68 70 Data.Free; 69 71 end; 70 MainForm.LoadItemList;72 //MainForm.LoadItemList; 71 73 Close; 72 74 end; … … 82 84 Report := TReport.Create; 83 85 Report.Base := Core.System; 86 SelectedObject := TChronisObject.Create; 87 SelectedObject.Base := Core.System; 84 88 end; 85 89 … … 87 91 begin 88 92 Report.Free; 93 SelectedObject.Free; 89 94 end; 90 95 … … 113 118 Panel1.Controls[I].Free; 114 119 115 Report.Load( MainForm.SelectedObject, MainForm.SelectedObject.PrimaryKey + ' = ' +116 IntToStr( MainForm.SelectedItem));120 Report.Load(SelectedObject, SelectedObject.PrimaryKey + ' = ' + 121 IntToStr(SelectedItemId)); 117 122 118 123 // Load column names
Note:
See TracChangeset
for help on using the changeset viewer.