This repository has been archived on 2024-12-02. You can view files and clone it, but cannot push or open issues or pull requests.
AlonsoYSal_FactuGES/Modulos/Contactos/Cliente/uEditorVendedores.pas
2007-06-21 16:02:50 +00:00

89 lines
2.1 KiB
ObjectPascal

unit uEditorVendedores;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uEditorContactos, Menus, DB, uDADataTable, JvAppStorage,
JvAppRegistryStorage, JvComponent, JvFormPlacement, ImgList,
PngImageList, StdActns, ActnList, ComCtrls, TB2ExtItems, TBXExtItems,
TBX, TB2Item, TB2Dock, TB2Toolbar, JvExControls, JvNavigationPane,
ExtCtrls, uCustomView, uViewBase, uViewBarraSeleccion, pngimage,
JvComponentBase;
type
IEditorVendedores = interface(IEditorContactos)
['{01A97825-6628-41D3-969F-1B296EE2ECE1}']
end;
TfEditorVendedores = class(TfEditorContactos, IEditorVendedores)
actComisiones: TAction;
TBXSubmenuItem2: TTBXSubmenuItem;
TBXItem36: TTBXItem;
procedure actEliminarExecute(Sender: TObject);
procedure actComisionesExecute(Sender: TObject);
private
protected
public
constructor Create(AOwner: TComponent); override;
end;
var
fEditorVendedores: TfEditorVendedores;
implementation
uses
uEditorUtils, uBizContacto, uViewVendedores, uViewContactos;
{$R *.dfm}
function ShowEditorVendedores (ABizObject : TDADataTableRules) : TModalResult;
var
AEditor: TfEditorVendedores;
begin
AEditor := TfEditorVendedores.Create(Application);
try
AEditor.Contactos := (ABizObject as IBizInstalador);
Result := AEditor.ShowModal;
finally
AEditor.Release;
end;
end;
{ TfEditorVendedores }
constructor TfEditorVendedores.Create(AOwner: TComponent);
begin
inherited;
ViewGrid := CreateView(TfrViewVendedores) as IViewContactos;
end;
procedure TfEditorVendedores.actEliminarExecute(Sender: TObject);
begin
if (Application.MessageBox('¿Desea borrar este vendedor?', 'Atención', MB_YESNO) = IDYES) then
begin
inherited;
ViewGrid.RefreshGrid;
end;
end;
procedure TfEditorVendedores.actComisionesExecute(Sender: TObject);
var
aObj : IBizVendedor;
begin
inherited;
if Supports(Contactos, IBizVendedor, aObj) then
aObj.CalcularComisiones;
end;
initialization
RegisterEditor(IBizVendedor, ShowEditorVendedores, etItems);
finalization
end.