unit uViewRemesasProveedor;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uViewGrid, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
  cxDataStorage, cxEdit, DB, cxDBData, uDADataTable, cxGridLevel,
  cxClasses, cxControls, cxGridCustomView, cxGridCustomTableView,
  cxGridTableView, cxGridDBTableView, cxGrid, uBizRemesasProveedor, ActnList, Menus,
  cxGridBandedTableView, cxGridDBBandedTableView, JvComponent,
  JvFormAutoSize, PngImageList, ImgList, dxPSGlbl, dxPSUtl, dxPSEngn,
  dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider, dxPSFillPatterns,
  dxPSEdgePatterns, cxIntlPrintSys3, dxPSCore, dxPScxCommon, dxPScxGrid6Lnk,
  cxGridCustomPopupMenu, cxGridPopupMenu, cxCurrencyEdit, cxSpinEdit, cxCheckBox,
  cxCheckComboBox, cxImageComboBox, TB2Item, TBX, TB2Toolbar, TBXDkPanels,
  TB2Dock, uViewFiltroBase, dxPgsDlg, uDAInterfaces;

type
  IViewRemesasProveedor = interface(IViewGrid)
  ['{969B34FC-84E0-4D62-B577-371F71F32FB8}']
    function GetRemesasProveedor: IBizRemesaProveedor;
    procedure SetRemesasProveedor(const Value: IBizRemesaProveedor);
    property RemesasProveedor: IBizRemesaProveedor read GetRemesasProveedor write SetRemesasProveedor;
  end;

  TfrViewRemesasProveedor = class(TfrViewGrid, IViewRemesasProveedor)
    cxGridViewREFERENCIA: TcxGridDBColumn;
    cxGridViewFECHA_REMESA: TcxGridDBColumn;
    cxGridViewDESCRIPCION: TcxGridDBColumn;
    cxGridViewIMPORTE_TOTAL: TcxGridDBColumn;
    cxGridViewNOMBRE: TcxGridDBColumn;
    cxGridViewENTIDAD: TcxGridDBColumn;
    cxGridViewSUCURSAL: TcxGridDBColumn;
    cxGridViewDC: TcxGridDBColumn;
    cxGridViewCUENTA: TcxGridDBColumn;
    cxGridViewTIPO: TcxGridDBColumn;
    procedure cxGridViewDataControllerCompare(
      ADataController: TcxCustomDataController; ARecordIndex1, ARecordIndex2,
      AItemIndex: Integer; const V1, V2: Variant; var Compare: Integer);
  protected
    FRemesasProveedor: IBizRemesaProveedor;
    function GetRemesasProveedor: IBizRemesaProveedor; virtual;
    procedure SetRemesasProveedor(const Value: IBizRemesaProveedor); virtual;
  public
    property RemesasProveedor: IBizRemesaProveedor read GetRemesasProveedor write SetRemesasProveedor;
  end;

implementation

uses
  uDataModuleRemesasProveedor, uReferenciasUtils, cxVariants;


{$R *.dfm}

{ TfrViewRemesasProveedor }

{
******************************* TfrViewRemesasProveedor *******************************
}
procedure TfrViewRemesasProveedor.cxGridViewDataControllerCompare(
  ADataController: TcxCustomDataController; ARecordIndex1, ARecordIndex2,
  AItemIndex: Integer; const V1, V2: Variant; var Compare: Integer);
begin
  inherited;
  if ((AItemIndex = cxGridViewREFERENCIA.Index)) and
     (VarType(V1) = VarType(V2)) and (VarType(V1) = varString) then
    Compare := CompararReferencias(V1, V2)
  else
    Compare := VarCompare(V1, V2);
end;

function TfrViewRemesasProveedor.GetRemesasProveedor: IBizRemesaProveedor;
begin
  Result := FRemesasProveedor;
end;

procedure TfrViewRemesasProveedor.SetRemesasProveedor(const Value: IBizRemesaProveedor);
begin
  FRemesasProveedor := Value;
  if Assigned(FRemesasProveedor) then
    dsDataSource.DataTable := FRemesasProveedor.DataTable;
end;

end.
