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;

type
  TfEditorCliente = class(TfEditorContacto, IEditorCliente)
    frViewCliente1: TfrViewCliente;
  protected
    procedure EliminarInterno; override;
  public
    constructor Create(AOwner: TComponent); override;
    procedure PonerTitulos(const ATitulo: string = ''); override;
  end;

implementation

uses
  uEditorItem, uEditorBase, uDataModuleUsuarios;

{$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.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;

end.
