git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/tags/1.2.0@6 c93665c3-c93d-084d-9b98-7d5f4a9c3376
80 lines
2.1 KiB
ObjectPascal
80 lines
2.1 KiB
ObjectPascal
unit uEditorCliente;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, uEditorContacto, ImgList, PngImageList, StdActns, ActnList, TBX,
|
|
TB2Item, TB2Dock, TB2Toolbar, ComCtrls, JvExControls, JvComponent,
|
|
JvNavigationPane, uViewCliente, uBizContactos, DB, uDADataTable,
|
|
JvFormAutoSize, uDAScriptingProvider, uDACDSDataTable, uCustomView,
|
|
uViewBase, JvAppStorage, JvAppRegistryStorage,
|
|
JvFormPlacement, ExtCtrls, pngimage, JvComponentBase, uViewContacto, StdCtrls,
|
|
|
|
uIEditorCliente, TBXStatusBars, JvExComCtrls, JvStatusBar, uViewAgente,
|
|
uViewDireccionesEntrega;
|
|
|
|
type
|
|
TfEditorCliente = class(TfEditorContacto, IEditorCliente)
|
|
frViewCliente1: TfrViewCliente;
|
|
pagDirecciones: TTabSheet;
|
|
frViewDireccionesEntrega1: TfrViewDireccionesEntrega;
|
|
procedure FormShow(Sender: TObject);
|
|
protected
|
|
procedure EliminarInterno; override;
|
|
procedure SetContacto(const Value: IBizContacto); override;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
procedure PonerTitulos(const ATitulo: string = ''); override;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
uEditorItem, uEditorBase, uDataModuleUsuarios, uEditorDBItem;
|
|
|
|
{$R *.dfm}
|
|
|
|
constructor TfEditorCliente.Create(AOwner: TComponent);
|
|
begin
|
|
inherited;
|
|
ViewContacto := frViewCliente1;
|
|
end;
|
|
|
|
procedure TfEditorCliente.EliminarInterno;
|
|
begin
|
|
if (Application.MessageBox('¿Desea borrar este cliente?', 'Atención', MB_YESNO) = IDYES) then
|
|
inherited;
|
|
end;
|
|
|
|
procedure TfEditorCliente.FormShow(Sender: TObject);
|
|
begin
|
|
inherited;
|
|
pgPaginas.ActivePageIndex := 0;
|
|
end;
|
|
|
|
procedure TfEditorCliente.PonerTitulos(const ATitulo: string);
|
|
var
|
|
FTitulo : String;
|
|
begin
|
|
if Assigned(Contacto) then
|
|
begin
|
|
if Contacto.EsNuevo then
|
|
FTitulo := 'Nuevo cliente'
|
|
else
|
|
FTitulo := 'Cliente';
|
|
end;
|
|
|
|
inherited PonerTitulos(FTitulo);
|
|
end;
|
|
|
|
procedure TfEditorCliente.SetContacto(const Value: IBizContacto);
|
|
begin
|
|
inherited;
|
|
if Assigned(Contacto) then
|
|
frViewDireccionesEntrega1.dsDirecciones.DataTable := Contacto.Direcciones.DataTable;
|
|
|
|
end;
|
|
|
|
end.
|