135 lines
4.2 KiB
ObjectPascal
135 lines
4.2 KiB
ObjectPascal
|
|
unit uViewPedidoCliente;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, uViewBase, uBizPedidosCliente, DB, uDADataTable, uCustomView,
|
|||
|
|
AppEvnts, StdCtrls, Mask, DBCtrls,
|
|||
|
|
|
|||
|
|
uViewObservaciones, uViewDatosPedidoCliente, uViewDatosYSeleccionCliente,
|
|||
|
|
cxGraphics, cxDropDownEdit, cxImageComboBox, cxDBEdit, cxContainer, cxEdit,
|
|||
|
|
cxTextEdit, cxMaskEdit, cxCalendar, dxLayoutControl, cxControls, cxMemo;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
IViewPedidoCliente = interface(IViewBase)
|
|||
|
|
['{C5385699-C1A4-4AEB-B3D0-EE3BDB322FE2}']
|
|||
|
|
function GetPedido: IBizPedidoCliente;
|
|||
|
|
procedure SetPedido(const Value: IBizPedidoCliente);
|
|||
|
|
property Pedido: IBizPedidoCliente read GetPedido write SetPedido;
|
|||
|
|
|
|||
|
|
function GetViewClientePedido: TfrViewDatosYSeleccionCliente;
|
|||
|
|
procedure SetViewClientePedido(const Value: TfrViewDatosYSeleccionCliente);
|
|||
|
|
property ViewClientePedido: TfrViewDatosYSeleccionCliente read GetViewClientePedido write SetViewClientePedido;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
TfrViewPedidoCliente = class(TfrViewBase, IViewPedidoCliente)
|
|||
|
|
DADataSource: TDADataSource;
|
|||
|
|
dxLayoutControl1Group_Root: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1: TdxLayoutControl;
|
|||
|
|
dxLayoutControl1Item2: TdxLayoutItem;
|
|||
|
|
edtFechaPedido: TcxDBDateEdit;
|
|||
|
|
dxLayoutControl1Item4: TdxLayoutItem;
|
|||
|
|
edtFechaConfirmacion: TcxDBDateEdit;
|
|||
|
|
dxLayoutControl1Item5: TdxLayoutItem;
|
|||
|
|
edtFechaEntrega: TcxDBDateEdit;
|
|||
|
|
dxLayoutControl1Group1: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Group2: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Item6: TdxLayoutItem;
|
|||
|
|
memObservaciones: TcxDBMemo;
|
|||
|
|
cbSituacion: TcxDBComboBox;
|
|||
|
|
dxLayoutControl1Item7: TdxLayoutItem;
|
|||
|
|
dxLayoutControl1Item3: TdxLayoutItem;
|
|||
|
|
eReferencia: TcxDBTextEdit;
|
|||
|
|
dxLayoutControl1Group5: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Group6: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Group7: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Group8: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Item8: TdxLayoutItem;
|
|||
|
|
memDireccionEntrega: TcxDBMemo;
|
|||
|
|
dxLayoutControl1Group3: TdxLayoutGroup;
|
|||
|
|
dxLayoutControl1Item1: TdxLayoutItem;
|
|||
|
|
frViewClientePedido: TfrViewDatosYSeleccionCliente;
|
|||
|
|
procedure cbSituacionPropertiesInitPopup(Sender: TObject);
|
|||
|
|
procedure CustomViewCreate(Sender: TObject);
|
|||
|
|
procedure CustomViewDestroy(Sender: TObject);
|
|||
|
|
protected
|
|||
|
|
FPedido : IBizPedidoCliente;
|
|||
|
|
FViewClientePedido : TfrViewDatosYSeleccionCliente;
|
|||
|
|
|
|||
|
|
function GetPedido: IBizPedidoCliente;
|
|||
|
|
procedure SetPedido(const Value: IBizPedidoCliente); virtual;
|
|||
|
|
function GetViewClientePedido: TfrViewDatosYSeleccionCliente;
|
|||
|
|
procedure SetViewClientePedido(const Value: TfrViewDatosYSeleccionCliente);
|
|||
|
|
|
|||
|
|
public
|
|||
|
|
property Pedido: IBizPedidoCliente read GetPedido write SetPedido;
|
|||
|
|
property ViewClientePedido: TfrViewDatosYSeleccionCliente read GetViewClientePedido;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
{ TfrViewPedidoCliente }
|
|||
|
|
|
|||
|
|
procedure TfrViewPedidoCliente.cbSituacionPropertiesInitPopup(
|
|||
|
|
Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
with cbSituacion.Properties.Items do
|
|||
|
|
begin
|
|||
|
|
if Count = 0 then
|
|||
|
|
begin
|
|||
|
|
BeginUpdate;
|
|||
|
|
try
|
|||
|
|
Clear;
|
|||
|
|
AddStrings(Pedido.DarListaSituaciones);
|
|||
|
|
finally
|
|||
|
|
EndUpdate;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewPedidoCliente.CustomViewCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
FViewClientePedido := frViewClientePedido;
|
|||
|
|
FViewClientePedido.MsgElegirCliente := 'Elija el Cliente al que se le realizar<61> el pedido.';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewPedidoCliente.CustomViewDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
FViewClientePedido := Nil;
|
|||
|
|
inherited;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrViewPedidoCliente.GetPedido: IBizPedidoCliente;
|
|||
|
|
begin
|
|||
|
|
Result := FPedido;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrViewPedidoCliente.GetViewClientePedido: TfrViewDatosYSeleccionCliente;
|
|||
|
|
begin
|
|||
|
|
Result := FViewClientePedido;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewPedidoCliente.SetPedido(const Value: IBizPedidoCliente);
|
|||
|
|
begin
|
|||
|
|
FPedido := Value;
|
|||
|
|
if Assigned(FPedido) then
|
|||
|
|
DADataSource.DataTable := FPedido.DataTable
|
|||
|
|
else
|
|||
|
|
DADataSource.DataTable := NIL;
|
|||
|
|
|
|||
|
|
frViewClientePedido.Cliente := FPedido.Cliente;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrViewPedidoCliente.SetViewClientePedido(const Value: TfrViewDatosYSeleccionCliente);
|
|||
|
|
begin
|
|||
|
|
FViewClientePedido := Value;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|