unit uArticulosAlbaranClienteController;

interface

uses
  uDADataTable, uArticulosController, uBizArticulos;

type
  IArticulosAlbaranClienteController = interface(IArticulosController)
  ['{727F03DE-C408-4F40-A603-2889F386BDD0}']
  end;

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

implementation

{ TArticulosAlbaranClienteController }

uses Controls, uIEditorElegirArticulosAlbaranesCliente, uIEditorElegirArticulos;

function TArticulosAlbaranClienteController.ElegirArticulos(AArticulos: IBizArticulo; AMensaje: String;
  AMultiSelect: Boolean): IBizArticulo;
var
  AEditor : IEditorElegirArticulosAlbaranesCliente;
begin
  Result := NIL;
  CreateEditor('EditorElegirArticulosAlbaranesCliente', IEditorElegirArticulosAlbaranesCliente, 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.
