unit DataModule;

interface

uses
  SysUtils, Classes, DBXpress, FMTBcd, DB, DBClient, Provider, SqlExpr,
  WideStrings;

type
  TDM = class(TDataModule)
    SQLDataSet1: TSQLDataSet;
    DataSetProvider1: TDataSetProvider;
    ClientDataSet1: TClientDataSet;
    DataSource1: TDataSource;
    ClientDataSet1idosoby: TIntegerField;
    ClientDataSet1nazwisko: TStringField;
    ClientDataSet1imie: TStringField;
    ClientDataSet1dataur: TDateField;
    ClientDataSet1mcowosc: TStringField;
    ClientDataSet1ulicainr: TStringField;
    ClientDataSet1kodp: TStringField;
    ClientDataSet1miasto: TStringField;
    ClientDataSet1pesel: TStringField;
    SQLConnection1: TSQLConnection;
    procedure ClientDataSet1AfterPost(DataSet: TDataSet);
    procedure DataModuleCreate(Sender: TObject);
    procedure DataModuleDestroy(Sender: TObject);

  private

  public

  end;

var
  DM: TDM;

implementation
{$R *.dfm}

procedure TDM.ClientDataSet1AfterPost(DataSet: TDataSet);
begin
   DM.ClientDataSet1.ApplyUpdates(-1);
end;

procedure TDM.DataModuleCreate(Sender: TObject);
begin
  SQLConnection1.Open();
  SQLDataSet1.Open();
  ClientDataSet1.Open();
end;

procedure TDM.DataModuleDestroy(Sender: TObject);
begin
  ClientDataSet1.Close();
  SQLDataSet1.Close();
  SQLConnection1.Close();
end;

end.


