This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
LuisLeon_FactuGES/Source/Modulos/Contactos/Views/uEditorAgente.pas
2007-06-11 15:29:06 +00:00

76 lines
1.9 KiB
ObjectPascal

unit uEditorAgente;
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,
uViewAgente, uBizContactos,
uIEditorAgente, pngimage, TBXStatusBars, JvExComCtrls, JvStatusBar,
uViewDetallesGenerico, uViewAgenteComisiones, uViewContactoDatosBancarios,
dxLayoutLookAndFeels;
type
TfEditorAgente = class(TfEditorContacto, IEditorAgente)
frViewAgente1: TfrViewAgente;
TabSheet1: TTabSheet;
frAgenteComisiones1: TfrAgenteComisiones;
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}
{ TfEditorAgente }
constructor TfEditorAgente.Create(AOwner: TComponent);
begin
inherited;
ViewContacto := frViewAgente1;
end;
procedure TfEditorAgente.EliminarInterno;
begin
if (ShowConfirmMessage('¿Desea borrar este agente?', '') = IDYES) then
inherited;
end;
procedure TfEditorAgente.PonerTitulos(const ATitulo: string);
var
FTitulo : String;
begin
if Assigned(Contacto) then
begin
if Contacto.EsNuevo then
FTitulo := 'Nuevo agente'
else
FTitulo := 'Agente';
end;
inherited PonerTitulos(FTitulo);
end;
procedure TfEditorAgente.SetContacto(const Value: IBizContacto);
begin
inherited;
if Assigned(FContacto) then
begin
frAgenteComisiones1.dsDetalles.DataTable := (FContacto as IBizAgente).Comisiones.DataTable;
end;
end;
end.