Changeset 37 for trunk/Forms/UItemEdit.pas
- Timestamp:
- Mar 8, 2012, 3:11:10 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UItemEdit.pas
r31 r37 1 1 unit UItemEdit; 2 2 3 {$mode objfpc}{$H+}3 {$mode Delphi}{$H+} 4 4 5 5 interface … … 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 9 StdCtrls, Spin, EditBtn, USqlDatabase, MaskEdit, ComCtrls, USystem, 10 SpecializedList, SpecializedDictionary ;10 SpecializedList, SpecializedDictionary, UChronisClient; 11 11 12 12 type … … 119 119 procedure TItemEditForm.ButtonSaveClick(Sender: TObject); 120 120 var 121 Data: TDictionaryStringString;121 Proxy: TObjectProxy; 122 122 I: Integer; 123 123 DataType: TDataType; … … 125 125 with Core.System do 126 126 try 127 Data := TDictionaryStringString.Create; 127 Proxy := TObjectProxy.Create; 128 Proxy.Client := Client; 129 Proxy.ObjectName := SelectedObject.Table; 130 Proxy.SchemaName := SelectedObject.Schema; 131 Proxy.Id := SelectedItemId; 128 132 for I := 0 to Report.Columns.Count - 1 do 129 133 if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then 130 134 if TReportColumn(Report.Columns[I]).ColumnName <> SelectedObject.PrimaryKey then begin 131 135 DataType := TReportColumn(Report.Columns[I]).CustomType; 132 Data.Add(TReportColumn(Report.Columns[I]).ColumnName,136 Proxy.Properties.Add(TReportColumn(Report.Columns[I]).ColumnName, 133 137 DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control))); 134 138 end; 135 Database.Update(SelectedObject.Table, Data, 136 '`' + SelectedObject.PrimaryKey + '` = ' + IntToStr(SelectedItemId), SelectedObject.Schema); 139 Proxy.Save; 137 140 finally 138 Data.Free;141 Proxy.Free; 139 142 end; 140 143 if (SelectedObject.Table = ObjectGroupTable) or
Note:
See TracChangeset
for help on using the changeset viewer.