git-svn-id: https://192.168.0.254/svn/Proyectos.LuisLeon_FactuGES/trunk@83 c93665c3-c93d-084d-9b98-7d5f4a9c3376
81 lines
2.0 KiB
ObjectPascal
81 lines
2.0 KiB
ObjectPascal
unit uBizControlesBase;
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, DB, SysUtils, uROClasses, uDADataTable, schControlesClient_Intf;
|
|
|
|
type
|
|
IBizControlBase = interface(IListaControlesPorCategoria)
|
|
['{203A654A-16DF-404B-ACD4-CCCA796091C6}']
|
|
procedure Show;
|
|
procedure VerPropiedades;
|
|
function EsModificable : Boolean;
|
|
end;
|
|
|
|
TBizControlBaseDataTableRules = class(TListaControlesPorCategoriaDataTableRules, IBizControlBase)
|
|
protected
|
|
function GetVISTAValue: IROStrings; override;
|
|
procedure BeforePost(Sender: TDADataTable); override;
|
|
public
|
|
procedure Show; virtual; abstract;
|
|
procedure VerPropiedades;
|
|
function EsModificable : Boolean;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
Windows, Dialogs, uDACDSDataTable, uDataModuleBase,
|
|
uEditorUtils, Variants, uFormPropiedadesControl, Forms, Controls;
|
|
|
|
{ TBizInformesVentasDataTableRules }
|
|
|
|
procedure TBizControlBaseDataTableRules.BeforePost(
|
|
Sender: TDADataTable);
|
|
begin
|
|
inherited;
|
|
if Length(CATEGORIA) = 0 then
|
|
raise Exception.Create('Categoría no asignada');
|
|
|
|
if Length(NOMBRE) = 0 then
|
|
VerPropiedades;
|
|
end;
|
|
|
|
function TBizControlBaseDataTableRules.EsModificable: Boolean;
|
|
begin
|
|
Result := (MODIFICABLE = 'S');
|
|
end;
|
|
|
|
function TBizControlBaseDataTableRules.GetVISTAValue: IROStrings;
|
|
begin
|
|
Result := NewROStrings();
|
|
Result.Add(DataTable.Fields[idx_ListaControlesPorCategoriaVISTA].AsString);
|
|
end;
|
|
|
|
procedure TBizControlBaseDataTableRules.VerPropiedades;
|
|
begin
|
|
with TfrPropiedadesControl.Create(NIL) do
|
|
try
|
|
Nombre := Self.NOMBRE;
|
|
Descripcion := Self.DESCRIPCION;
|
|
Modificable := Self.EsModificable;
|
|
Icono := Self.ICONO;
|
|
if (ShowModal = mrOK) then
|
|
begin
|
|
DataTable.Edit;
|
|
Self.NOMBRE := Nombre;
|
|
Self.DESCRIPCION := Descripcion;
|
|
Self.ICONO := Icono;
|
|
if Modificable then
|
|
Self.MODIFICABLE := 'S'
|
|
else
|
|
Self.MODIFICABLE := 'N';
|
|
end;
|
|
finally
|
|
Free;
|
|
end;
|
|
end;
|
|
|
|
end.
|