git-svn-id: https://192.168.0.254/svn/Proyectos.AbetoDesign_FactuGES/trunk@174 93f398dd-4eb6-7a46-baf6-13f46f578da2
84 lines
2.0 KiB
ObjectPascal
84 lines
2.0 KiB
ObjectPascal
unit uDataModuleComerciales;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, uDataModuleContactos, DB, uDADataTable, uDAScriptingProvider,
|
|
uDACDSDataTable, uDABINAdapter, uRORemoteService,
|
|
uROClient, uROBinMessage, uROWinInetHttpChannel, uROTypes,
|
|
uIDataModuleComerciales, uBizContactos, uDADesigntimeCall,
|
|
uDAInterfaces, uDAMemDataTable, uDADataStreamer, uDABin2DataStreamer,
|
|
uDARemoteDataAdapter;
|
|
|
|
type
|
|
TDataModuleComerciales = class(TDataModuleContactos, IDataModuleComerciales)
|
|
tbl_Comerciales: TDAMemDataTable;
|
|
ds_Comerciales: TDADataSource;
|
|
public
|
|
function GetItem(const ID : Integer) : IBizComercial;
|
|
function NewItem : IBizComercial;
|
|
function GetItems : IBizComercial;
|
|
end;
|
|
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
uses
|
|
FactuGES_Intf, cxControls, schContactosClient_Intf, uDataTableUtils;
|
|
|
|
{ TDataModuleComerciales }
|
|
|
|
function TDataModuleComerciales.GetItem(const ID: Integer): IBizComercial;
|
|
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 TDataModuleComerciales.GetItems: IBizComercial;
|
|
var
|
|
AContacto : TDAMemDataTable;
|
|
begin
|
|
ShowHourglassCursor;
|
|
try
|
|
AContacto := CloneDataTable(tbl_Comerciales);
|
|
AContacto.BusinessRulesID := BIZ_CLIENT_COMERCIAL;
|
|
|
|
with TBizComercial(AContacto.BusinessEventsObj) do
|
|
begin
|
|
DatosBancarios := _GetDatosBancarios;
|
|
end;
|
|
|
|
Result := (AContacto as IBizComercial);
|
|
finally
|
|
HideHourglassCursor;
|
|
end;
|
|
end;
|
|
|
|
function TDataModuleComerciales.NewItem: IBizComercial;
|
|
begin
|
|
Result := GetItem(ID_NULO)
|
|
end;
|
|
|
|
end.
|