Ignore:
Timestamp:
Mar 8, 2012, 3:11:10 PM (13 years ago)
Author:
chronos
Message:
  • Modified: Direct acces using Database: TSqlDatabase replaced by TChronisClient interface.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemEdit.pas

    r31 r37  
    11unit UItemEdit;
    22
    3 {$mode objfpc}{$H+}
     3{$mode Delphi}{$H+}
    44
    55interface
     
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    99  StdCtrls, Spin, EditBtn, USqlDatabase, MaskEdit, ComCtrls, USystem,
    10   SpecializedList, SpecializedDictionary;
     10  SpecializedList, SpecializedDictionary, UChronisClient;
    1111
    1212type
     
    119119procedure TItemEditForm.ButtonSaveClick(Sender: TObject);
    120120var
    121   Data: TDictionaryStringString;
     121  Proxy: TObjectProxy;
    122122  I: Integer;
    123123  DataType: TDataType;
     
    125125  with Core.System do
    126126  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;
    128132    for I := 0 to Report.Columns.Count - 1 do
    129133    if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then
    130134    if TReportColumn(Report.Columns[I]).ColumnName <> SelectedObject.PrimaryKey then begin
    131135      DataType := TReportColumn(Report.Columns[I]).CustomType;
    132       Data.Add(TReportColumn(Report.Columns[I]).ColumnName,
     136      Proxy.Properties.Add(TReportColumn(Report.Columns[I]).ColumnName,
    133137        DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control)));
    134138    end;
    135     Database.Update(SelectedObject.Table, Data,
    136       '`' + SelectedObject.PrimaryKey + '` = ' + IntToStr(SelectedItemId), SelectedObject.Schema);
     139    Proxy.Save;
    137140  finally
    138     Data.Free;
     141    Proxy.Free;
    139142  end;
    140143  if (SelectedObject.Table = ObjectGroupTable) or
Note: See TracChangeset for help on using the changeset viewer.