unit uEditorProveedor;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uEditorContacto, uCustomView, uViewBase, uViewContacto,
  uViewProveedor, JvAppStorage, JvAppRegistryStorage, JvComponentBase,
  JvFormPlacement, DB, uDADataTable, ImgList, PngImageList, StdActns, ActnList,
  ComCtrls, TBX, TB2Item, TB2Dock, TB2Toolbar, ExtCtrls, JvExControls,
  JvComponent, JvNavigationPane,

  uIEditorProveedor, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
  cxSpinEdit, cxDBEdit, pngimage, TBXStatusBars, JvExComCtrls, JvStatusBar;

type
  TfEditorProveedor = class(TfEditorContacto, IEditorProveedor)
    frViewProveedor1: TfrViewProveedor;
  protected
    procedure EliminarInterno; override;
  public
    constructor Create(AOwner: TComponent); override;
    procedure PonerTitulos(const ATitulo: string = ''); override;    
  end;

implementation

{$R *.dfm}

{ TfEditorProveedor }

constructor TfEditorProveedor.Create(AOwner: TComponent);
begin
  inherited;
  ViewContacto := frViewProveedor1;
end;

procedure TfEditorProveedor.EliminarInterno;
begin
  if (Application.MessageBox('¿Desea borrar este proveedor?', 'Atención', MB_YESNO) = IDYES) then
    inherited;
end;

procedure TfEditorProveedor.PonerTitulos(const ATitulo: string);
var
  FTitulo : String;
begin
  if Assigned(Contacto) then
  begin
    if Contacto.EsNuevo then
      FTitulo := 'Nuevo proveedor'
    else
      FTitulo := 'Proveedor';
  end;

  inherited PonerTitulos(FTitulo);
end;

end.
