unit uArticulosAlbaranClienteController;

interface

uses
  uDADataTable, cxControls, 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);
  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.
