Varela_PuntosVenta/Source/Modulos/VentasTerminadas/Reglas/uBizInformesVentas.pas
2008-04-15 09:28:58 +00:00

83 lines
1.9 KiB
ObjectPascal
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

unit uBizInformesVentas;
interface
uses
Classes, DB, SysUtils, uROClasses, schInformesVentasClient_Intf, uDADataTable;
const
BIZ_INFORMESVENTAS = 'Client.InformesVentas';
VALOR_CATEGORIA = 'VENTAS';
type
IBizInformesVentas = interface(IListaInformesPorCategoria)
['{78F747A5-9A35-44D6-8C73-8682A41FE573}']
procedure Show;
procedure VerPropiedades;
end;
TBizInformesVentasDataTableRules = class(TListaInformesPorCategoriaDataTableRules, IBizInformesVentas)
protected
function GetVISTAValue: IROStrings; override;
procedure BeforePost(Sender: TDADataTable); override;
public
procedure Show;
procedure VerPropiedades;
end;
implementation
uses
Windows, Dialogs, uDACDSDataTable, uDMBase,
uEditorUtils, Variants, uFormPropiedadesInforme, Forms, Controls;
{ TBizInformesVentasDataTableRules }
procedure TBizInformesVentasDataTableRules.BeforePost(
Sender: TDADataTable);
begin
inherited;
if Length(CATEGORIA) = 0 then
begin
Edit;
CATEGORIA := VALOR_CATEGORIA;
end;
if Length(NOMBRE) = 0 then
VerPropiedades;
end;
function TBizInformesVentasDataTableRules.GetVISTAValue: IROStrings;
begin
result := NewROStrings();
result.Add(DataTable.Fields[idx_ListaInformesPorCategoriaVISTA].AsString);
end;
procedure TBizInformesVentasDataTableRules.Show;
begin
ShowEditor(IBizInformesVentas, Self, etItem);
end;
procedure TBizInformesVentasDataTableRules.VerPropiedades;
begin
with TfrPropiedadesInforme.Create(NIL) do
try
Nombre := Self.NOMBRE;
Descripcion := Self.DESCRIPCION;
if (ShowModal = mrOK) then
begin
DataTable.Edit;
Self.NOMBRE := Nombre;
Self.DESCRIPCION := Descripcion;
Self.ICONO := 2;
end;
finally
Free;
end;
end;
initialization
RegisterDataTableRules(BIZ_INFORMESVENTAS, TBizInformesVentasDataTableRules);
end.