105 lines
2.7 KiB
ObjectPascal
105 lines
2.7 KiB
ObjectPascal
unit uBizAgentesServer;
|
|
|
|
interface
|
|
|
|
uses
|
|
schContactosServer_Intf, uDAInterfaces,
|
|
uDADataTable, uDABusinessProcessor, uBizContactosServer;
|
|
|
|
const
|
|
BIZ_SERVER_AGENTE = 'Server.Agente';
|
|
|
|
type
|
|
TBizAgenteServer = class(TBizContactosServer)
|
|
protected
|
|
procedure Insert_Datos_Contacto(aChange: TDADeltaChange); override;
|
|
procedure Update_Datos_Contacto(aChange: TDADeltaChange); override;
|
|
procedure Delete_Datos_Contacto(aChange: TDADeltaChange); override;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
uDataModuleServer, uDAClasses, DARemoteService_Impl,
|
|
schContactosClient_Intf, uBusinessUtils;
|
|
|
|
{ TBizAgenteServer }
|
|
|
|
procedure TBizAgenteServer.Delete_Datos_Contacto(aChange: TDADeltaChange);
|
|
var
|
|
ASchema : TDASchema;
|
|
ACurrentConn : IDAConnection;
|
|
ACommand : IDASQLCommand;
|
|
begin
|
|
inherited;
|
|
|
|
{ ASchema := BusinessProcessor.Schema;
|
|
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
|
|
|
ACommand := ASchema.NewCommand(ACurrentConn, 'Delete_AgentesDatos');
|
|
try
|
|
with ACommand do
|
|
begin
|
|
ParamByName('OLD_ID_AGENTE').Value := aChange.OldValueByName[fld_AgentesID];
|
|
Execute;
|
|
end;
|
|
finally
|
|
ACommand := NIL;
|
|
end;}
|
|
end;
|
|
|
|
procedure TBizAgenteServer.Insert_Datos_Contacto(aChange: TDADeltaChange);
|
|
var
|
|
ASchema : TDASchema;
|
|
ACurrentConn : IDAConnection;
|
|
ACommand : IDASQLCommand;
|
|
begin
|
|
inherited;
|
|
|
|
{ ASchema := BusinessProcessor.Schema;
|
|
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
|
|
|
ACommand := ASchema.NewCommand(ACurrentConn, 'Insert_AgentesDatos');
|
|
try
|
|
with ACommand do
|
|
begin
|
|
ParamByName('ID_AGENTE').Value := aChange.NewValueByName[fld_AgentesID];
|
|
ParamByName('PORCENTAJE_COMISION').Value := aChange.NewValueByName[fld_AgentesPORCENTAJE_COMISION];
|
|
Execute;
|
|
end;
|
|
finally
|
|
ACommand := NIL;
|
|
end;}
|
|
end;
|
|
|
|
procedure TBizAgenteServer.Update_Datos_Contacto(aChange: TDADeltaChange);
|
|
var
|
|
ASchema : TDASchema;
|
|
ACurrentConn : IDAConnection;
|
|
ACommand : IDASQLCommand;
|
|
begin
|
|
inherited;
|
|
|
|
{ ASchema := BusinessProcessor.Schema;
|
|
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
|
|
|
|
ACommand := ASchema.NewCommand(ACurrentConn, 'Update_AgentesDatos');
|
|
try
|
|
with ACommand do
|
|
begin
|
|
ParamByName('ID_AGENTE').Value := aChange.NewValueByName[fld_AgentesID];
|
|
ParamByName('OLD_ID_AGENTE').Value := aChange.OldValueByName[fld_AgentesID];
|
|
|
|
ParamByName('PORCENTAJE_COMISION').Value := aChange.NewValueByName[fld_AgentesPORCENTAJE_COMISION];
|
|
Execute;
|
|
end;
|
|
finally
|
|
ACommand := NIL;
|
|
end;}
|
|
end;
|
|
|
|
initialization
|
|
RegisterBusinessProcessorRules(BIZ_SERVER_AGENTE, TBizAgenteServer);
|
|
|
|
end.
|