Changeset 40 for trunk/Forms/UItemView.pas
- Timestamp:
- Mar 9, 2012, 8:11:13 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemView.pas
r36 r40 56 56 {$R *.lfm} 57 57 58 resourcestring 59 SExpectedOneRow = 'Expected one row'; 60 58 61 { TItemViewForm } 59 62 … … 106 109 NewItemEditForm: TItemEditForm; 107 110 begin 108 Close; 109 NewItemEditForm := TItemEditForm.Create(nil); 110 NewItemEditForm.SelectedObject.Assign(SelectedObject); 111 NewItemEditForm.SelectedItemId := SelectedItemId; 112 NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name; 113 MainForm.SetMainPanelForm(NewItemEditForm); 111 try 112 NewItemEditForm := TItemEditForm.Create(nil); 113 NewItemEditForm.SelectedObject.Assign(SelectedObject); 114 NewItemEditForm.SelectedItemId := SelectedItemId; 115 NewItemEditForm.Caption := NewItemEditForm.Caption + ' ' + SelectedObject.Name; 116 NewItemEditForm.ShowModal; 117 finally 118 NewItemEditForm.Free; 119 end; 114 120 end; 115 121 … … 156 162 // Load column names 157 163 158 if Report.Count = 1 then 164 if Report.Count > 1 then raise Exception.Create(SExpectedOneRow); 165 if Report.Count > 0 then 159 166 for I := 0 to Report.Columns.Count - 1 do begin 160 167 DataType := TReportColumn(Report.Columns[I]).CustomType;
Note:
See TracChangeset
for help on using the changeset viewer.