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/UItemAdd.pas

    r31 r37  
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    99  StdCtrls, Spin, EditBtn, MaskEdit, USqlDatabase, USystem,
    10   SpecializedDictionary, SpecializedList;
     10  SpecializedDictionary, SpecializedList, UChronisClient;
    1111
    1212type
     
    5353var
    5454  Data: TDictionaryStringString;
     55  NewProxy: TObjectProxy;
    5556  I: Integer;
    5657  DataType: TDataType;
     
    5960  try
    6061    Data := TDictionaryStringString.Create;
     62    NewProxy := TObjectProxy.Create;
     63    NewProxy.Client := Client;
     64    NewProxy.ObjectName := SelectedObject.Table;
     65    NewProxy.SchemaName := SelectedObject.Schema;
    6166    for I := 0 to Report.Columns.Count - 1 do
    6267    if not (TReportColumn(Report.Columns[I]).CustomType is TDataTypeRelationMany) then
    6368    if TReportColumn(Report.Columns[I]).ColumnName <> SelectedObject.PrimaryKey then begin
    6469      DataType := TReportColumn(Report.Columns[I]).CustomType;
    65       Data.Add(TReportColumn(Report.Columns[I]).ColumnName,
     70      NewProxy.Properties.Add(TReportColumn(Report.Columns[I]).ColumnName,
    6671        DataType.GetControlValue(TWinControl(TReportColumn(Report.Columns[I]).Control)));
    6772    end;
    68     Database.Insert(SelectedObject.Table, Data, SelectedObject.Schema);
     73    NewProxy.Save;
    6974  finally
    7075    Data.Free;
     76    NewProxy.Free;
    7177  end;
    7278  //MainForm.LoadItemList;
Note: See TracChangeset for help on using the changeset viewer.