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, cxControls, uIEditorElegirArticulosFacturasCliente, uIEditorElegirArticulos;

function TArticulosFacturaClienteController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
  AMultiSelect: Boolean): IBizArticulo;
var
  AEditor : IEditorElegirArticulosFacturasCliente;
begin
  Result := NIL;

  CreateEditor('EditorElegirArticulosFacturaCliente', IEditorElegirArticulosFacturasCliente, AEditor);
  if Assigned(AEditor) then
    try
       AEditor.Controller := Self;
       AEditor.Articulos := AArticulos;
       AEditor.MultiSelect := AMultiSelect;
       AEditor.Mensaje := AMensaje;
       if IsPositiveResult(AEditor.ShowModal) then
          Result := AEditor.ArticulosSeleccionados;
    finally
      AEditor.Release;
      AEditor := NIL;
    end;
end;

end.
