ConstruccionesCNJ_FactuGES/Modulos/Pedidos con montaje/Model/uBizPedidosMontaje.pas
2007-06-21 15:50:59 +00:00

80 lines
1.7 KiB
ObjectPascal

unit uBizPedidosMontaje;
interface
uses
uDADataTable, uBizPedidosProveedor, uBizMontajesDetalles;
const
BIZ_CLIENT_PEDIDO_MONTAJE = 'Client.PedidoMontaje';
type
IBizPedidoMontaje = interface(IBizPedidoProveedor)
['{AD169CCB-1EA5-4E85-AB9C-2AAC6191ECE3}']
procedure SetMontaje(AValue : IBizMontajeDetalles);
function GetMontaje : IBizMontajeDetalles;
property Montaje : IBizMontajeDetalles read GetMontaje write SetMontaje;
end;
TBizPedidoMontaje = class(TBizPedidoProveedor, IBizPedidoMontaje)
protected
FMontaje : IBizMontajeDetalles;
procedure SetMontaje(AValue : IBizMontajeDetalles);
function GetMontaje : IBizMontajeDetalles;
public
property Montaje : IBizMontajeDetalles read GetMontaje write SetMontaje;
constructor Create(aDataTable: TDADataTable); override;
destructor Destroy; override;
end;
implementation
uses
Windows, Forms;
{ TBizPedidoMontaje }
constructor TBizPedidoMontaje.Create(aDataTable: TDADataTable);
begin
inherited;
FMontaje := Nil;
end;
destructor TBizPedidoMontaje.Destroy;
begin
FMontaje := NIL;
inherited;
end;
function TBizPedidoMontaje.GetMontaje: IBizMontajeDetalles;
begin
Result := FMontaje;
end;
procedure TBizPedidoMontaje.SetMontaje(AValue: IBizMontajeDetalles);
begin
FMontaje := AValue;
if Assigned(FMontaje) then
begin
if not FMontaje.DataTable.Active then
FMontaje.DataTable.Active := True;
if ID_MONTAJE <> FMontaje.ID then
begin
DataTable.Edit;
ID_MONTAJE := FMontaje.ID;
REFERENCIA := FMontaje.REFERENCIA;
end;
end;
end;
initialization
RegisterDataTableRules(BIZ_CLIENT_PEDIDO_MONTAJE, TBizPedidoMontaje);
finalization
end.