unit uDataModuleInstaladores;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uDataModuleContactos, DB, uDADataTable, uDAScriptingProvider,
  uDACDSDataTable, uDABINAdapter, uROServiceComponent, uRORemoteService,
  uROClient, uROBinMessage, uROWinInetHttpChannel,

  uIDataModuleInstaladores, uBizContactos, uDADesigntimeCall;

type
  TDataModuleInstaladores = class(TDataModuleContactos, IDataModuleInstaladores)
  public
    function GetItem(const ID : Integer) : IBizInstalador;
    function NewItem : IBizInstalador;
    function GetItems : IBizInstalador;
  end;

implementation

{$R *.dfm}

uses
  cxControls, schContactosClient_Intf, uDAInterfaces, uDataTableUtils;


{ TDataModuleInstaladores }

function TDataModuleInstaladores.GetItem(const ID: Integer): IBizInstalador;
begin
  ShowHourglassCursor;
  try
    Result := Self.GetItems;
    with Result.DataTable.Where do
    begin
      if NotEmpty then
         AddOperator(opAND);
      OpenBraket;
      AddText('CONTACTOS.' + fld_ContactosID + ' = ' + IntToStr(ID));
      CloseBraket;
    end;
  finally
    HideHourglassCursor;
  end;
end;

function TDataModuleInstaladores.GetItems: IBizInstalador;
begin
  ShowHourglassCursor;
  try
    Result := (_GetItems(CATEGORIA_INSTALADOR) as IBizInstalador);
    Result.DataTable.ParamByName('ID_CATEGORIA').AsInteger := CATEGORIA_INSTALADOR;
  finally
    HideHourglassCursor;
  end;
end;

function TDataModuleInstaladores.NewItem: IBizInstalador;
begin
  Result := GetItem(ID_NULO)
end;

end.
