unit uEditorVendedor;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  uEditorContacto, JvAppStorage, JvAppRegistryStorage, JvComponentBase,
  JvFormPlacement, DB, uDADataTable, ImgList, PngImageList, StdActns, ActnList,
  ComCtrls, TBX, TB2Item, TB2Dock, TB2Toolbar, ExtCtrls, JvExControls,
  JvComponent, JvNavigationPane, uCustomView, uViewBase, uViewContacto,
  uViewVendedor, uBizContactos,
  uIEditorVendedor, pngimage, TBXStatusBars, JvExComCtrls, JvStatusBar,
  uViewDetallesGenerico, uViewContactoDatosBancarios, dxLayoutLookAndFeels,
  dxLayoutControl, cxContainer, cxEdit, cxTextEdit, cxMemo, cxDBEdit, cxControls,
  uDAInterfaces;

type
  TfEditorVendedor = class(TfEditorContacto, IEditorVendedor)
    frViewVendedor1: TfrViewVendedor;
   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
  uEditorDBItem, uDialogUtils;

{$R *.dfm}

{ TfEditorVendedor }

constructor TfEditorVendedor.Create(AOwner: TComponent);
begin
  inherited;
  ViewContacto := frViewVendedor1;
end;

procedure TfEditorVendedor.EliminarInterno;
begin
  if (ShowConfirmMessage('¿Desea borrar este vendedor?', '') = IDYES) then
    inherited;
end;

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

  inherited PonerTitulos(FTitulo);
end;

procedure TfEditorVendedor.SetContacto(const Value: IBizContacto);
begin
  inherited;
end;

end.
