unit uViewAgenteComisiones;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, uViewBase, uViewDetallesGenerico, cxStyles, cxCustomData, cxGraphics,
  cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ActnList, ImgList,
  PngImageList, uDADataTable, ComCtrls, ToolWin, cxGridLevel,
  cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
  cxControls, cxGridCustomView, cxGrid, uBizContactos, uProveedoresController,
  cxDBLookupComboBox, cxSpinEdit;

type
  TfrAgenteComisiones = class(TfrViewDetallesGenerico)
    dsProveedores: TDADataSource;
    cxGridViewPROVEEDOR: TcxGridDBColumn;
    cxGridViewCOMISION: TcxGridDBColumn;
  protected
    FProvController : IProveedoresController;
    FProveedores : IBizProveedor;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{$R *.dfm}

{ TfrAgenteComisiones }

constructor TfrAgenteComisiones.Create(AOwner: TComponent);
begin
  inherited;
  FProvController := TProveedoresController.Create;
  FProveedores := (FProvController.BuscarTodos as IBizProveedor);
  dsProveedores.DataTable := FProveedores.DataTable;

  if not dsProveedores.DataTable.Active then
    dsProveedores.DataTable.Active := True;
end;

destructor TfrAgenteComisiones.Destroy;
begin
  if dsProveedores.DataTable.Active then
    dsProveedores.DataTable.Active := False;

  FProveedores := NIL;
  FProvController := NIL;
  inherited;
end;

end.
