unit uDataModuleRegistroCorreos;

interface

uses
  SysUtils, Classes, DB, uDAInterfaces, uDADataTable,
  uDAScriptingProvider, uDAMemDataTable, uDADataStreamer, uDABin2DataStreamer,
  uDARemoteDataAdapter, uROClient, uRORemoteService, uDataModuleBase, uIntegerListUtils;

type
  TDataModuleRegistroCorreos = class(TDataModuleBase)
    RORemoteService: TRORemoteService;
    Bin2DataStreamer: TDABin2DataStreamer;
    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;

{ TdmFamilias }

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.
