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.
Miguelo_FactuGES/Datos/Poblaciones.pas

112 lines
3.5 KiB
ObjectPascal
Raw Normal View History

{
===============================================================================
Copyright (<EFBFBD>) 2002. Rodax Software.
===============================================================================
Los contenidos de este fichero son propiedad de Rodax Software titular del
copyright. Este fichero s<EFBFBD>lo podr<EFBFBD> ser copiado, distribuido y utilizado,
en su totalidad o en parte, con el permiso escrito de Rodax Software, o de
acuerdo con los t<EFBFBD>rminos y condiciones establecidas en el acuerdo/contrato
bajo el que se suministra.
-----------------------------------------------------------------------------
Web: www.rodax-software.com
===============================================================================
Fecha primera versi<EFBFBD>n: 03-11-2002
Versi<EFBFBD>n actual: 1.0.0
Fecha versi<EFBFBD>n actual: 03-11-2002
===============================================================================
Modificaciones:
Fecha Comentarios
---------------------------------------------------------------------------
===============================================================================
}
unit Poblaciones;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
RdxFrameProvincias, Db, RdxBotones, RdxBarras, Grids, DBGrids, RXDBCtrl,
ExtCtrls, RdxPaneles, IBCustomDataSet, IBQuery, BaseDatos,
RdxFramePoblaciones, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxEdit, cxDBData,
cxGridLevel, cxClasses, cxControls, cxGridCustomView,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid,
Configuracion, cxDataStorage;
type
TfrPoblaciones = class(TRdxFramePoblaciones)
BarraPoblaciones: TRdxBarraSuperior;
PanelPrincipal: TPanel;
brSeleccion: TRdxBarraInferior;
bSeleccionar: TRdxBoton;
bCancelar: TRdxBoton;
dsPoblaciones: TDataSource;
gridPoblaciones: TcxGrid;
gridPoblacionesDBTableView1: TcxGridDBTableView;
gridPoblacionesLevel1: TcxGridLevel;
procedure bSeleccionarClick(Sender: TObject);
procedure bCancelarClick(Sender: TObject);
public
constructor Create (AOwner : TComponent); override;
destructor Destroy; override;
published
property TablaPoblaciones;
property Entidad;
end;
var
frPoblaciones: TfrPoblaciones;
implementation
{$R *.DFM}
uses
IBDatabase, Entidades, TablaPoblaciones;
constructor TfrPoblaciones.Create (AOwner : TComponent);
begin
inherited Create(AOwner);
Entidad := entPoblaciones;
BaseDatos := dmBaseDatos.BD;
Transaccion := dmBaseDatos.Transaccion;
TablaPoblaciones := TIBDataSet.Create(Self);
dsPoblaciones.DataSet := TablaPoblaciones;
with TablaPoblaciones do
begin
Database := BaseDatos;
Transaction := Transaccion;
SelectSQL.Assign(dmTablaPoblaciones.sqlGrid);
Prepare;
Open;
end;
dmTablaPoblaciones.InicializarGridPoblaciones(gridPoblacionesDBTableView1);
bCancelar.Cancel := True;
end;
procedure TfrPoblaciones.bSeleccionarClick(Sender: TObject);
begin
inherited;
CodigoProvincia := TablaPoblaciones.FieldByName('CODIGOPROVINCIA').Value;
CodigoPoblacion := TablaPoblaciones.FieldByName('CODIGOPOBLACION').Value;
CloseFrame;
end;
destructor TfrPoblaciones.Destroy;
begin
TablaPoblaciones.Close;
TablaPoblaciones.UnPrepare;
TablaPoblaciones.Free;
inherited;
end;
procedure TfrPoblaciones.bCancelarClick(Sender: TObject);
begin
inherited;
CloseFrame;
end;
end.