unit uArticulosContratoClienteController;

interface

uses
  uDADataTable, uArticulosController, uBizArticulos;

type
  IArticulosContratoClienteController = interface(IArticulosController)
  ['{C3F1F725-5112-4D32-BEE3-CD0B885EC41F}']
  end;

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

implementation

{ TArticulosContratoClienteController }

uses Controls, cxControls, uIEditorElegirArticulosContratosCliente, uIEditorElegirArticulos;

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

  CreateEditor('EditorElegirArticulosContratosCliente', IEditorElegirArticulosContratosCliente, 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.
