84 lines
2.1 KiB
ObjectPascal
84 lines
2.1 KiB
ObjectPascal
|
|
unit uDataModuleInstaladores;
|
||
|
|
|
||
|
|
interface
|
||
|
|
|
||
|
|
uses
|
||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||
|
|
Dialogs, uDataModuleContactos, DB, uDADataTable, uDAScriptingProvider,
|
||
|
|
uDACDSDataTable, uDABINAdapter, uRORemoteService,
|
||
|
|
uROClient, uROBinMessage, uROWinInetHttpChannel, uROTypes,
|
||
|
|
uIDataModuleInstaladores, uBizContactos, uDADesigntimeCall,
|
||
|
|
uDAInterfaces, uDAMemDataTable, uDADataStreamer, uDABin2DataStreamer,
|
||
|
|
uDARemoteDataAdapter;
|
||
|
|
|
||
|
|
type
|
||
|
|
TDataModuleInstaladores = class(TDataModuleContactos, IDataModuleInstaladores)
|
||
|
|
tbl_Instaladores: TDAMemDataTable;
|
||
|
|
ds_Instaladores: TDADataSource;
|
||
|
|
public
|
||
|
|
function GetItem(const ID : Integer) : IBizInstalador;
|
||
|
|
function NewItem : IBizInstalador;
|
||
|
|
function GetItems : IBizInstalador;
|
||
|
|
end;
|
||
|
|
|
||
|
|
|
||
|
|
implementation
|
||
|
|
|
||
|
|
{$R *.dfm}
|
||
|
|
|
||
|
|
uses
|
||
|
|
FactuGES_Intf, cxControls, schContactosClient_Intf, uDataTableUtils;
|
||
|
|
|
||
|
|
{ TDataModuleInstaladores }
|
||
|
|
|
||
|
|
function TDataModuleInstaladores.GetItem(const ID: Integer): IBizInstalador;
|
||
|
|
var
|
||
|
|
Condicion: TDAWhereExpression;
|
||
|
|
begin
|
||
|
|
ShowHourglassCursor;
|
||
|
|
try
|
||
|
|
Result := Self.GetItems;
|
||
|
|
|
||
|
|
with Result.DataTable.DynamicWhere do
|
||
|
|
begin
|
||
|
|
// (ID = :ID)
|
||
|
|
Condicion := NewBinaryExpression(NewField('', fld_ContactosID), NewConstant(ID, datInteger), dboEqual);
|
||
|
|
|
||
|
|
if IsEmpty then
|
||
|
|
Expression := Condicion
|
||
|
|
else
|
||
|
|
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
|
||
|
|
end;
|
||
|
|
|
||
|
|
finally
|
||
|
|
HideHourglassCursor;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
|
||
|
|
function TDataModuleInstaladores.GetItems: IBizInstalador;
|
||
|
|
var
|
||
|
|
AContacto : TDAMemDataTable;
|
||
|
|
begin
|
||
|
|
ShowHourglassCursor;
|
||
|
|
try
|
||
|
|
AContacto := CloneDataTable(tbl_Instaladores);
|
||
|
|
AContacto.BusinessRulesID := BIZ_CLIENT_Instalador;
|
||
|
|
|
||
|
|
with TBizInstalador(AContacto.BusinessEventsObj) do
|
||
|
|
begin
|
||
|
|
DatosBancarios := _GetDatosBancarios;
|
||
|
|
end;
|
||
|
|
|
||
|
|
Result := (AContacto as IBizInstalador);
|
||
|
|
finally
|
||
|
|
HideHourglassCursor;
|
||
|
|
end;
|
||
|
|
end;
|
||
|
|
|
||
|
|
function TDataModuleInstaladores.NewItem: IBizInstalador;
|
||
|
|
begin
|
||
|
|
Result := GetItem(ID_NULO)
|
||
|
|
end;
|
||
|
|
|
||
|
|
end.
|