Varela_PuntosVenta/Source/Servidor/EDI_Log_Impl.pas

76 lines
2.2 KiB
ObjectPascal

unit EDI_Log_Impl;
{----------------------------------------------------------------------------}
{ This unit was automatically generated by the RemObjects SDK after reading }
{ the RODL file associated with this project . }
{ }
{ This is where you are supposed to code the implementation of your objects. }
{----------------------------------------------------------------------------}
{$I Remobjects.inc}
interface
uses
{vcl:} Classes, SysUtils,
{RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions,
{Required:} uRORemoteDataModule,
{Ancestor Implementation:} DARemoteService_Impl,
{Used RODLs:} DataAbstract3_Intf,
{Generated:} VARELA_Intf, uDADataStreamer, uDABinAdapter, uDAClasses, uDAInterfaces;
type
{ TEDI_Log }
TEDI_Log = class(TDARemoteService, IEDI_Log)
DABINAdapter: TDABINAdapter;
schEDILog: TDASchema;
private
protected
{ IEDI_Log methods }
procedure InsertarLog(const Fecha: DateTime; const Report: String; const OK: Boolean; const Error_msg: String);
end;
implementation
{$R *.dfm}
uses
{Generated:} VARELA_Invk,
uDataModuleServer, Dialogs;
procedure Create_EDI_Log(out anInstance : IUnknown);
begin
anInstance := TEDI_Log.Create(NIL);
end;
{ EDI_Log }
procedure TEDI_Log.InsertarLog(const Fecha: DateTime; const Report: String; const OK: Boolean; const Error_msg: String);
var
cmd : IDASQLCommand;
conn : IDAConnection;
begin
conn := dmServer.ConnectionManager.NewConnection(ConnectionName);
conn.BeginTransaction;
cmd := schEDILog.NewCommand(conn, 'Insert_EDILog');
try
cmd.ParamByName('FECHA').AsDateTime := Fecha;
cmd.ParamByName('REPORT').AsString := Report;
if OK then
cmd.ParamByName('OK').AsInteger := 1
else
cmd.ParamByName('OK').AsInteger := 0;
cmd.ParamByName('ERROR_MSG').AsString := Error_msg;
cmd.Execute;
finally
conn.CommitTransaction;
conn := nil;
end;
end;
initialization
TROClassFactory.Create('EDI_Log', Create_EDI_Log, TEDI_Log_Invoker);
finalization
end.