unit uArticulosFacturaClienteController;

interface

uses
  uDADataTable, uArticulosController, uBizArticulos;

type
  IArticulosFacturaClienteController = interface(IArticulosController)
  ['{64370F32-8C18-47F5-BD21-0902D64BE798}']
  end;

  TArticulosFacturaClienteController = class(TArticulosController, IArticulosFacturaClienteController)
  public
    function ElegirArticulos(AArticulos : IBizArticulo; AMensaje: String; AMultiSelect: Boolean): IBizArticulo; override;
  end;

implementation

{ TArticulosFacturaClienteController }

uses Controls, uIEditorElegirArticulosFacturasCliente, uIEditorElegirArticulos;

function TArticulosFacturaClienteController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
  AMultiSelect: Boolean): IBizArticulo;
var
  AEditor : IEditorElegirArticulosFacturasCliente;
begin
  Result := NIL;
  CreateEditor('EditorElegirArticulosFacturaCliente', IEditorElegirArticulosFacturasCliente, AEditor);
  try
    with AEditor do
    begin
      Controller := Self;
      Articulos := AArticulos;
      MultiSelect := AMultiSelect;
      Mensaje := AMensaje; 
      if IsPositiveResult(ShowModal) then
        Result := ArticulosSeleccionados;
	  Release;	
    end;
  finally
    AEditor := NIL;
  end;
end;

end.
