120 lines
3.6 KiB
ObjectPascal
120 lines
3.6 KiB
ObjectPascal
|
|
{
|
|||
|
|
===============================================================================
|
|||
|
|
Copyright (<EFBFBD>) 2001. 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: 01-10-2001
|
|||
|
|
Versi<EFBFBD>n actual: 1.0.3
|
|||
|
|
Fecha versi<EFBFBD>n actual: 26-04-2004
|
|||
|
|
===============================================================================
|
|||
|
|
Modificaciones:
|
|||
|
|
|
|||
|
|
Fecha Comentarios
|
|||
|
|
---------------------------------------------------------------------------
|
|||
|
|
07-04-2002 Se ha adaptado a una unica transacci<EFBFBD>n.
|
|||
|
|
|
|||
|
|
12-05-2002 Adaptaci<EFBFBD>n al grid 'TdxDBGrid'.
|
|||
|
|
|
|||
|
|
26-04-2004 Al hacer doble click sobre el grid, se seleccionar<EFBFBD> la
|
|||
|
|
poblaci<EFBFBD>n autom<EFBFBD>ticamente.
|
|||
|
|
===============================================================================
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
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, dxCntner, dxTL, dxDBCtrl, dxDBGrid;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrPoblaciones = class(TRdxFramePoblaciones)
|
|||
|
|
BarraPoblaciones: TRdxBarraSuperior;
|
|||
|
|
PanelPrincipal: TPanel;
|
|||
|
|
brSeleccion: TRdxBarraInferior;
|
|||
|
|
bSeleccionar: TRdxBoton;
|
|||
|
|
bCancelarGuardar: TRdxBoton;
|
|||
|
|
dsPoblaciones: TDataSource;
|
|||
|
|
gridPoblaciones: TdxDBGrid;
|
|||
|
|
procedure bSeleccionarClick(Sender: TObject);
|
|||
|
|
procedure bCancelarGuardarClick(Sender: TObject);
|
|||
|
|
procedure gridPoblacionesDblClick(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, Configuracion, Tipos, TablaPoblaciones;
|
|||
|
|
|
|||
|
|
constructor TfrPoblaciones.Create (AOwner : TComponent);
|
|||
|
|
begin
|
|||
|
|
inherited Create(AOwner);
|
|||
|
|
Entidad := entPoblaciones;
|
|||
|
|
ConfigurarFrame(Self, Self.Entidad);
|
|||
|
|
|
|||
|
|
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(gridPoblaciones);
|
|||
|
|
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.bCancelarGuardarClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
CloseFrame;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrPoblaciones.gridPoblacionesDblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
bSeleccionar.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|