unit uPluginAlbaranesCliente;

interface

uses
  uModuleController, uInterfaces, uHostManager, Menus, Classes, ActnList,
  ImgList, Controls, PngImageList;

type
  IMCAlbaranesCliente = interface(IInterface)
  ['{1F0B5F6C-814F-423C-B15A-5C4591626008}']
  end;

  TPluginAlbaranesCliente = class(TModuleController, IMCAlbaranesCliente)
    actAlbaranesCliente: TAction;
    ExtraImages: TPngImageList;
    LargeImages: TPngImageList;
    MainMenu: TMainMenu;
    ModuleActionList: TActionList;
    SmallImages: TPngImageList;
    Compras1: TMenuItem;
    AlbaranesdeCliente1: TMenuItem;
    actAlbaranesDevCliente: TAction;
    Ordenesdedevolucin1: TMenuItem;
    procedure actAlbaranesClienteExecute(Sender: TObject);
    procedure actAlbaranesDevClienteExecute(Sender: TObject);
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{$R *.dfm}

uses
  Forms, Dialogs, SysUtils,
  uAlbaranesClienteController, uBizAlbaranesCliente, uAlbaranesClienteViewRegister;

function GetModule : TModuleController;
begin
  Result := TPluginAlbaranesCliente.Create(NIL);
end;

exports
  GetModule name GET_MODULE_FUNC;

procedure TPluginAlbaranesCliente.actAlbaranesClienteExecute(Sender: TObject);
var
  AAlbaranesClienteController : IAlbaranesClienteController;
  AAlbaranesCliente : IBizAlbaranCliente;

begin
  AAlbaranesClienteController := TAlbaranesClienteController.Create;
  AAlbaranesCliente := (AAlbaranesClienteController.BuscarAlbaranesNormales as IBizAlbaranCliente);
  AAlbaranesClienteController.VerTodosAlbaranes(AAlbaranesCliente);
end;

procedure TPluginAlbaranesCliente.actAlbaranesDevClienteExecute(Sender: TObject);
var
  AAlbaranesClienteController : IAlbaranesClienteController;
  AAlbaranesCliente : IBizAlbaranCliente;

begin
  AAlbaranesClienteController := TAlbaranesClienteController.Create;
  AAlbaranesCliente := (AAlbaranesClienteController.BuscarAlbaranesDevolucion as IBizAlbaranCliente);
  AAlbaranesClienteController.VerTodosAlbaranesDev(AAlbaranesCliente);
end;

constructor TPluginAlbaranesCliente.Create(AOwner: TComponent);
begin
  inherited;
  uAlbaranesClienteViewRegister.RegisterViews;
end;

destructor TPluginAlbaranesCliente.Destroy;
begin
  uAlbaranesClienteViewRegister.UnregisterViews;
  inherited;
end;

initialization
  RegisterModuleClass(TPluginAlbaranesCliente);

finalization
  UnRegisterModuleClass(TPluginAlbaranesCliente);

end.
