git-svn-id: https://192.168.0.254/svn/Proyectos.Noviseda_FactuGES2/trunk@8 f33bb606-9f5c-448d-9c99-757f00063c96
119 lines
3.0 KiB
ObjectPascal
119 lines
3.0 KiB
ObjectPascal
unit uBizVendedoresServer;
|
|
|
|
interface
|
|
|
|
uses
|
|
schContactosServer_Intf, uDAInterfaces, uDADelta,
|
|
uDADataTable, uDABusinessProcessor, uBizContactosServer;
|
|
|
|
const
|
|
BIZ_SERVER_VENDEDOR = 'Server.Vendedor';
|
|
|
|
type
|
|
TBizVendedorServer = class(TBizContactosServer)
|
|
protected
|
|
function DarReferenciaContacto : String; override;
|
|
function IncrementarReferenciaContacto : Boolean; override;
|
|
|
|
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,
|
|
schContactosClient_Intf, uBusinessUtils;
|
|
|
|
const
|
|
REF_VENDEDORES = 'REF_VENDEDORES';
|
|
|
|
{ TBizVendedorServer }
|
|
|
|
function TBizVendedorServer.DarReferenciaContacto: String;
|
|
begin
|
|
Result := _DarReferenciaInterna(REF_VENDEDORES);
|
|
end;
|
|
|
|
procedure TBizVendedorServer.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_VendedoresDatos');
|
|
try
|
|
with ACommand do
|
|
begin
|
|
ParamByName('OLD_ID_VENDEDOR').Value := aChange.OldValueByName[fld_VendedoresID];
|
|
Execute;
|
|
end;
|
|
finally
|
|
ACommand := NIL;
|
|
end;
|
|
end;
|
|
|
|
function TBizVendedorServer.IncrementarReferenciaContacto: Boolean;
|
|
begin
|
|
Result := _IncrementarReferenciaInterna(REF_VENDEDORES)
|
|
end;
|
|
|
|
procedure TBizVendedorServer.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_VendedoresDatos');
|
|
try
|
|
with ACommand do
|
|
begin
|
|
ParamByName('ID_VENDEDOR').Value := aChange.NewValueByName[fld_VendedoresID];
|
|
ParamByName('COMISION').Value := aChange.NewValueByName[fld_VendedoresCOMISION];
|
|
Execute;
|
|
end;
|
|
finally
|
|
ACommand := NIL;
|
|
end;
|
|
end;
|
|
|
|
procedure TBizVendedorServer.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_VendedoresDatos');
|
|
try
|
|
with ACommand do
|
|
begin
|
|
ParamByName('OLD_ID_VENDEDOR').Value := aChange.OldValueByName[fld_VendedoresID];
|
|
ParamByName('COMISION').Value := aChange.NewValueByName[fld_VendedoresCOMISION];
|
|
Execute;
|
|
end;
|
|
finally
|
|
ACommand := NIL;
|
|
end;
|
|
end;
|
|
|
|
initialization
|
|
RegisterBusinessProcessorRules(BIZ_SERVER_VENDEDOR, TBizVendedorServer);
|
|
|
|
end.
|