129 lines
3.6 KiB
ObjectPascal
129 lines
3.6 KiB
ObjectPascal
|
|
{
|
|||
|
|
===============================================================================
|
|||
|
|
Copyright (<EFBFBD>) 2007. Rodax Software.
|
|||
|
|
===============================================================================
|
|||
|
|
Los contenidos de este fichero son propiedad de Rodax Software titular del
|
|||
|
|
copyright. Este fichero s<EFBFBD>lo podr<EFBFBD> ser copiado, distribuido y utilizado,
|
|||
|
|
en su totalidad o en parte, con el permiso escrito de Rodax Software, o de
|
|||
|
|
acuerdo con los t<EFBFBD>rminos y condiciones establecidas en el acuerdo/contrato
|
|||
|
|
bajo el que se suministra.
|
|||
|
|
-----------------------------------------------------------------------------
|
|||
|
|
Web: www.rodax-software.com
|
|||
|
|
===============================================================================
|
|||
|
|
Fecha primera versi<EFBFBD>n:
|
|||
|
|
Versi<EFBFBD>n actual: 1.0.0
|
|||
|
|
Fecha versi<EFBFBD>n actual:
|
|||
|
|
===============================================================================
|
|||
|
|
Modificaciones:
|
|||
|
|
|
|||
|
|
Fecha Comentarios
|
|||
|
|
---------------------------------------------------------------------------
|
|||
|
|
===============================================================================
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
unit uBizOscCustomers;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
uDAInterfaces, uDADataTable, uDBSelectionListUtils, schTiendaWebClient_Intf,
|
|||
|
|
uBizOscAddressBook;
|
|||
|
|
|
|||
|
|
const
|
|||
|
|
BIZ_CLIENT_OSC_CUSTOMER = 'Client.OSC.Customer';
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
IBizOscCustomer = interface(Iosc_Customers)
|
|||
|
|
['{DF158539-E502-4F38-B382-136A58C44EC7}']
|
|||
|
|
function EsNuevo : Boolean;
|
|||
|
|
|
|||
|
|
procedure SetAddressBook(AValue : IBizOscAddressBook);
|
|||
|
|
function GetAddressBook : IBizOscAddressBook;
|
|||
|
|
property AddressBook : IBizOscAddressBook read GetAddressBook write SetAddressBook;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
TBizOscCustomer = class(Tosc_CustomersDataTableRules, IBizOscCustomer, ISeleccionable)
|
|||
|
|
protected
|
|||
|
|
FSeleccionableInterface : ISeleccionable;
|
|||
|
|
|
|||
|
|
FAddressBook : IBizOscAddressBook;
|
|||
|
|
FAddressBookLink : TDADataSource;
|
|||
|
|
procedure SetAddressBook(AValue : IBizOscAddressBook);
|
|||
|
|
function GetAddressBook : IBizOscAddressBook;
|
|||
|
|
|
|||
|
|
procedure OnNewRecord(Sender: TDADataTable); override;
|
|||
|
|
public
|
|||
|
|
procedure IniciarValoresNuevo;
|
|||
|
|
function EsNuevo : Boolean;
|
|||
|
|
constructor Create(aDataTable: TDADataTable); override;
|
|||
|
|
destructor Destroy; override;
|
|||
|
|
|
|||
|
|
property SeleccionableInterface : ISeleccionable
|
|||
|
|
read FSeleccionableInterface
|
|||
|
|
write FSeleccionableInterface
|
|||
|
|
implements ISeleccionable;
|
|||
|
|
|
|||
|
|
property AddressBook : IBizOscAddressBook read GetAddressBook write SetAddressBook;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{ TBizOscCustomers }
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
SysUtils, uDataTableUtils;
|
|||
|
|
|
|||
|
|
function TBizOscCustomer.GetAddressBook: IBizOscAddressBook;
|
|||
|
|
begin
|
|||
|
|
Result := FAddressBook;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TBizOscCustomer.SetAddressBook(AValue: IBizOscAddressBook);
|
|||
|
|
begin
|
|||
|
|
FAddressBook := AValue;
|
|||
|
|
EnlazarMaestroDetalle(FAddressBookLink, FAddressBook);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
constructor TBizOscCustomer.Create(aDataTable: TDADataTable);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
FAddressBookLink := TDADataSource.Create(NIL);
|
|||
|
|
FAddressBookLink.DataTable := aDataTable;
|
|||
|
|
|
|||
|
|
FSeleccionableInterface := TSeleccionable.Create(aDataTable);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
destructor TBizOscCustomer.Destroy;
|
|||
|
|
begin
|
|||
|
|
FAddressBook := NIL;
|
|||
|
|
FreeAndNIL(FAddressBookLink);
|
|||
|
|
|
|||
|
|
FSeleccionableInterface := NIL;
|
|||
|
|
inherited;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TBizOscCustomer.EsNuevo: Boolean;
|
|||
|
|
begin
|
|||
|
|
Result := (customers_id < 0);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TBizOscCustomer.IniciarValoresNuevo;
|
|||
|
|
begin
|
|||
|
|
//
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TBizOscCustomer.OnNewRecord(Sender: TDADataTable);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
customers_id := GetRecNo; // -1, -2, -3...
|
|||
|
|
IniciarValoresNuevo;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
initialization
|
|||
|
|
RegisterDataTableRules(BIZ_CLIENT_OSC_CUSTOMER, TBizOscCustomer);
|
|||
|
|
|
|||
|
|
finalization
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|