unit uDataModuleRegistroCorreos;

interface

uses
  SysUtils, Classes, DB, uDAClientDataModule, uDADataTable, uDABINAdapter,
  uDAScriptingProvider, uDACDSDataTable, uROWinInetHttpChannel, uROTypes,
  uROServiceComponent, uRORemoteService, uROClient, uROBinMessage,
  uDADesigntimeCall, uIntegerListUtils;

type
  TDataModuleRegistroCorreos = class(TDAClientDataModule)
    RORemoteService: TRORemoteService;
    DABinAdapter: TDABINAdapter;
    DADesigntimeCall1: TDADesigntimeCall;
    LoginRemoteService: TRORemoteService;
    ROWinInetHTTPChannel1: TROWinInetHTTPChannel;
    ROBinMessage1: TROBinMessage;
    procedure DAClientDataModuleCreate(Sender: TObject);
  public
    function AnadirMarcaEnvioCorreo(const Tabla: String; IDTabla: Integer): Boolean; overload;
    function AnadirMarcaEnvioCorreo(const Tabla: String; IDsTabla: TIntegerList): Boolean; overload;
  end;


function AnadirMarcaEnvioCorreo(const Tabla: String; IDTabla: Integer): Boolean; overload;
function AnadirMarcaEnvioCorreo(const Tabla: String; IDsTabla: TIntegerList): Boolean; overload;


implementation

{$R *.DFM}

uses
  FactuGES_Intf, uDataModuleConexion, uDataTableUtils, cxControls, uDAInterfaces,
  Dialogs;


function AnadirMarcaEnvioCorreo(const Tabla: String; IDTabla: Integer): Boolean;
var
  ADM : TDataModuleRegistroCorreos;
begin
  ADM := TDataModuleRegistroCorreos.Create(nil);
  try
    Result := ADM.AnadirMarcaEnvioCorreo(Tabla, IDTabla);
  finally
    FreeANDNIL(ADM);
  end;
end;

function AnadirMarcaEnvioCorreo(const Tabla: String; IDsTabla: TIntegerList): Boolean;
var
  ADM : TDataModuleRegistroCorreos;
begin
  ADM := TDataModuleRegistroCorreos.Create(nil);
  try
    ADM.AnadirMarcaEnvioCorreo(Tabla, IDsTabla);
  finally
    FreeANDNIL(ADM);
  end;
end;

{ TdmImpresiones }

function TDataModuleRegistroCorreos.AnadirMarcaEnvioCorreo(const Tabla: String;
  IDTabla: Integer): Boolean;
var
  AList : TIntegerList;
begin
  AList := TIntegerList.Create;
  try
    AList.Add(IDTabla);
    Result := Self.AnadirMarcaEnvioCorreo(Tabla, AList);
  finally
    FreeANDNIL(AList)
  end;
end;

function TDataModuleRegistroCorreos.AnadirMarcaEnvioCorreo(const Tabla: String;
  IDsTabla: TIntegerList): Boolean;
begin
  Result := (RORemoteService as IsrvRegistroCorreos).AnadirMarcaEnvio(Tabla, IDsTabla.ToIntegerArray);
end;

procedure TDataModuleRegistroCorreos.DAClientDataModuleCreate(Sender: TObject);
begin
  RORemoteService.Channel := dmConexion.Channel;
  RORemoteService.Message := dmConexion.Message;
end;

end.
