unit uViewContactoListaDatosBancarios;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uViewDetallesGenerico, cxStyles, cxCustomData, cxGraphics, cxFilter,
  cxData, cxDataStorage, cxEdit, DB, cxDBData, ActnList, ImgList, PngImageList,
  uDAInterfaces, uDADataTable, ComCtrls, ToolWin, cxGridLevel,
  cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
  cxControls, cxGridCustomView, cxGrid, cxTextEdit;
   
type
  IViewListaDatosBancarios = interface(IViewDetallesGenerico)
    ['{E6489FBE-C472-494A-AA04-7B63B3262521}']
  end;

  TfrViewListaDatosBancarios = class(TfrViewDetallesGenerico, IViewListaDatosBancarios)
    cxGridViewTITULAR: TcxGridDBColumn;
    cxGridViewENTIDAD: TcxGridDBColumn;
    cxGridViewSUCURSAL: TcxGridDBColumn;
    cxGridViewDC: TcxGridDBColumn;
    cxGridViewCUENTA: TcxGridDBColumn;
    procedure cxGridViewCellDblClick(Sender: TcxCustomGridTableView;
      ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
      AShift: TShiftState; var AHandled: Boolean);
    procedure actEliminarExecute(Sender: TObject);
  protected
    procedure AnadirInterno; override;
    procedure ModificarInterno; override;
  end;

implementation

uses
  uDataModuleContactos, uBizContactosDatosBancarios,
  uDatosBancariosContactoController, uDialogUtils;

{$R *.dfm}

{ TfrViewListaDatosBancarios }

procedure TfrViewListaDatosBancarios.actEliminarExecute(Sender: TObject);
begin
  if (ShowConfirmMessage('Eliminar una cuenta bancaria', '¿Desea eliminar esta cuenta bancaria?') = IDYES) then
    inherited;
end;

procedure TfrViewListaDatosBancarios.AnadirInterno;
begin
  inherited;
  try
    with TDatosBancariosContactoController.Create do
      Ver((dsDetalles.DataTable) as IBizContactosDatosBancarios);
  finally
    if (dsDetalles.DataTable.State in dsEditModes) then
      dsDetalles.DataTable.Post;
  end;
end;

procedure TfrViewListaDatosBancarios.cxGridViewCellDblClick(
  Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo;
  AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
  inherited;
  actModificar.Execute;
end;

procedure TfrViewListaDatosBancarios.ModificarInterno;
begin
  inherited;
  with TDatosBancariosContactoController.Create do
    Ver((dsDetalles.DataTable) as IBizContactosDatosBancarios);
end;

end.
