This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
Noviseda_FactuGES2/Source/Modulos/Pedidos de cliente/Views/uEditorArticulosPendientes.pas

95 lines
3.0 KiB
ObjectPascal

unit uEditorArticulosPendientes;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uEditorGridBase, Menus, JvAppStorage, JvAppRegistryStorage, DB,
uDAInterfaces, uDADataTable, JvComponentBase, JvFormPlacement, ImgList,
PngImageList, StdActns, ActnList, ComCtrls, JvExComCtrls, JvStatusBar,
SpTBXItem, StdCtrls, TntStdCtrls, SpTBXEditors, TB2Item, TB2Dock, TB2Toolbar,
pngimage, ExtCtrls, JvExControls, JvNavigationPane, uCustomView, uViewBase,
uViewGridBase, uViewGrid, uViewArticulosPendientes, uIEditorArticulosPendientes,
uBizPedidosCliente, dxGDIPlusClasses;
type
TfEditorArticulosPendientes = class(TfEditorGridBase, IEditorArticulosPendientes)
procedure FormShow(Sender: TObject);
protected
FArticulosPendientes: IBizArticulosPendientes;
function GetArticulosPendientes: IBizArticulosPendientes;
procedure SetArticulosPendientes(const Value: IBizArticulosPendientes);
published
public
property ArticulosPendientes : IBizArticulosPendientes read GetArticulosPendientes write SetArticulosPendientes;
procedure PonerTitulos(const ATitulo: string = ''); override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
implementation
{$R *.dfm}
{ TfEditorArticulosPendientes }
constructor TfEditorArticulosPendientes.Create(AOwner: TComponent);
begin
inherited;
ViewGrid := CreateView(TfrViewArticulosPendientes) as IViewarticulosPendientes;
end;
destructor TfEditorArticulosPendientes.Destroy;
begin
FArticulosPendientes := NIL;
inherited;
end;
procedure TfEditorArticulosPendientes.FormShow(Sender: TObject);
begin
inherited;
if not Assigned(ViewGrid) then
raise Exception.Create('No hay ninguna vista asignada');
if not Assigned(ArticulosPendientes) then
raise Exception.Create('No hay ningún articulo pendiente asignado');
ArticulosPendientes.DataTable.Active := True;
ViewGrid.GotoFirst;
end;
function TfEditorArticulosPendientes.GetArticulosPendientes: IBizArticulosPendientes;
begin
Result := FArticulosPendientes;
end;
procedure TfEditorArticulosPendientes.PonerTitulos(const ATitulo: string);
var
FTitulo : String;
begin
FTitulo := 'Lista de artículos pendientes de ser enviados a los clientes'; // - ' + AppFactuGES.EmpresaActiva.NOMBRE;
inherited PonerTitulos(FTitulo);
end;
procedure TfEditorArticulosPendientes.SetArticulosPendientes(const Value: IBizArticulosPendientes);
begin
FArticulosPendientes := Value;
if Assigned(FArticulosPendientes) then
begin
//Se guarda el where de la sentencia origen, por si el editor tiene filtros que
//afecten a este where y en un futuro se desea volver al where origen (filtro de año))
DynWhereDataTable := FArticulosPendientes.DataTable.DynamicWhere.Xml;
dsDataTable.DataTable := FArticulosPendientes.DataTable;
if Assigned(ViewGrid) then
(ViewGrid as IViewArticulosPendientes).ArticulosPendientes := ArticulosPendientes;
end;
end;
end.