unit uViewDireccionEntregaAlbaranCliente; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uViewBase, uBizAlbaranesCliente, cxGraphics, dxLayoutControl, cxMemo, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxLookupEdit, cxDBLookupEdit, cxDBLookupComboBox, StdCtrls, cxControls, DB, uDADataTable, ActnList, uAlbaranesClienteController, Buttons, cxDBEdit, uDAInterfaces; type IViewDireccionEntregaAlbaranCliente = interface(IViewBase) ['{C23A361A-98CA-450C-9F29-2DA7877601EE}'] function GetAlbaranCliente: IBizAlbaranCliente; procedure SetAlbaranCliente(const Value: IBizAlbaranCliente); property AlbaranCliente: IBizAlbaranCliente read GetAlbaranCliente write SetAlbaranCliente; end; TfrViewDireccionEntregaAlbaranCliente = class(TfrViewBase, IViewDireccionEntregaAlbaranCliente) dxLayoutControl1: TdxLayoutControl; dxLayoutGroup1: TdxLayoutGroup; dsAlbaran: TDADataSource; dsAlmacenes: TDADataSource; dxLayoutControl1Item2: TdxLayoutItem; ePoblacion: TcxDBTextEdit; dxLayoutControl1Item3: TdxLayoutItem; eProvincia: TcxDBTextEdit; dxLayoutControl1Item4: TdxLayoutItem; eCodigoPostal: TcxDBTextEdit; dxLayoutControl1Item5: TdxLayoutItem; eTlfTrabajo: TcxDBTextEdit; dxLayoutControl1Item6: TdxLayoutItem; ePersonaContacto: TcxDBTextEdit; dxLayoutControl1Group3: TdxLayoutGroup; dxLayoutControl1Group1: TdxLayoutGroup; dxLayoutControl1Group5: TdxLayoutGroup; dxLayoutControl1Group4: TdxLayoutGroup; dxLayoutControl1Item7: TdxLayoutItem; eCalle: TcxDBMemo; dxLayoutControl1Item1: TdxLayoutItem; cbPais: TcxDBComboBox; procedure cbPaisPropertiesInitPopup(Sender: TObject); private FPaises : TStringList; procedure CargarPaises; protected FAlbaran : IBizAlbaranCliente; FController : IAlbaranesClienteController; function GetAlbaranCliente: IBizAlbaranCliente; procedure SetAlbaranCliente(const Value: IBizAlbaranCliente); public property AlbaranCliente: IBizAlbaranCliente read GetAlbaranCliente write SetAlbaranCliente; constructor Create(AOwner: TComponent); override; destructor Destroy; override; end; implementation {$R *.dfm} uses uEditorRegistryUtils, uProvinciasPoblacionesController; procedure TfrViewDireccionEntregaAlbaranCliente.CargarPaises; var i : integer; begin with TProvinciasPoblacionesController.Create do try FPaises := DarListaPaises; with cbPais.Properties.Items do begin BeginUpdate; try Clear; for i := 0 to FPaises.Count - 1 do Add(FPaises.Names[i]); finally EndUpdate; end; end; finally Free; end; end; procedure TfrViewDireccionEntregaAlbaranCliente.cbPaisPropertiesInitPopup( Sender: TObject); begin ShowHourglassCursor; try if not Assigned(FPaises) then CargarPaises; finally HideHourglassCursor; end; end; constructor TfrViewDireccionEntregaAlbaranCliente.Create(AOwner: TComponent); begin inherited; FAlbaran := NIL; end; destructor TfrViewDireccionEntregaAlbaranCliente.Destroy; begin FAlbaran := NIL; inherited; end; function TfrViewDireccionEntregaAlbaranCliente.GetAlbaranCliente: IBizAlbaranCliente; begin Result := FAlbaran; end; procedure TfrViewDireccionEntregaAlbaranCliente.SetAlbaranCliente(const Value: IBizAlbaranCliente); begin FAlbaran := Value; if Assigned(FAlbaran) then dsAlbaran.DataTable := FAlbaran.DataTable else dsAlbaran.DataTable := NIL; end; end.