Se adapta el cargarpoblaciones de toda la aplicación para que si no se cambia de provincia no vuelva a pedir al servidor las poblaciones
git-svn-id: https://192.168.0.254/svn/Proyectos.Noviseda_FactuGES2/trunk@136 f33bb606-9f5c-448d-9c99-757f00063c96
This commit is contained in:
parent
d5a1bb79fa
commit
89a87e5287
BIN
Build/Build.fbl6
BIN
Build/Build.fbl6
Binary file not shown.
@ -113,6 +113,7 @@ type
|
||||
FController : IEmpresasController;
|
||||
FProvincias : TStringList;
|
||||
FPoblaciones : TStringList;
|
||||
FIDProvincia : Integer; //Almacenará la provincia que hay seleccionada para no cargar las poblaciones si no es necesario
|
||||
FFormasPago: TStringList;
|
||||
FTiposIVA: TStringList;
|
||||
procedure CargarProvincias;
|
||||
@ -192,27 +193,29 @@ end;
|
||||
procedure TfrViewEmpresa.CargarPoblaciones;
|
||||
var
|
||||
i : integer;
|
||||
AID : Integer;
|
||||
begin
|
||||
AID := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(AID);
|
||||
if (FIDProvincia <> StrToInt(FProvincias.Values[cbProvincia.Text])) then
|
||||
Begin
|
||||
FIDProvincia := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(FIDProvincia);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
procedure TfrViewEmpresa.CargarProvincias;
|
||||
@ -286,6 +289,7 @@ end;
|
||||
constructor TfrViewEmpresa.Create(AOwner : TComponent);
|
||||
begin
|
||||
inherited;
|
||||
FIDProvincia := 0;
|
||||
FProvincias := NIL;
|
||||
FPoblaciones := NIL;
|
||||
bModificarCatalogo := False;
|
||||
|
||||
@ -137,6 +137,7 @@ type
|
||||
FFormasPago : IBizFormaPago;
|
||||
FFormasPagoController : IFormasPagoController;
|
||||
FProvincias : TStringList;
|
||||
FIDProvincia : Integer; //Almacenará la provincia que hay seleccionada para no cargar las poblaciones si no es necesario
|
||||
FPoblaciones : TStringList;
|
||||
|
||||
procedure CargarProvincias;
|
||||
@ -243,27 +244,29 @@ end;
|
||||
procedure TfrViewAlbaranCliente.CargarPoblaciones;
|
||||
var
|
||||
i : integer;
|
||||
AID : Integer;
|
||||
begin
|
||||
AID := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(AID);
|
||||
if (FIDProvincia <> StrToInt(FProvincias.Values[cbProvincia.Text])) then
|
||||
Begin
|
||||
FIDProvincia := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(FIDProvincia);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
procedure TfrViewAlbaranCliente.CargarProvincias;
|
||||
|
||||
@ -12,8 +12,6 @@ inherited frViewDireccionEntregaAlbaranCliente: TfrViewDireccionEntregaAlbaranCl
|
||||
ParentBackground = True
|
||||
TabOrder = 0
|
||||
TabStop = False
|
||||
AutoContentSizes = [acsWidth, acsHeight]
|
||||
ExplicitHeight = 129
|
||||
object eCalle: TcxDBTextEdit
|
||||
Left = 64
|
||||
Top = 10
|
||||
@ -142,64 +140,67 @@ inherited frViewDireccionEntregaAlbaranCliente: TfrViewDireccionEntregaAlbaranCl
|
||||
Width = 263
|
||||
end
|
||||
object dxLayoutGroup1: TdxLayoutGroup
|
||||
ShowCaption = False
|
||||
AlignHorz = ahParentManaged
|
||||
AlignVert = avParentManaged
|
||||
CaptionOptions.Visible = False
|
||||
ButtonOptions.Buttons = <>
|
||||
Hidden = True
|
||||
ShowBorder = False
|
||||
object dxLayoutControl1Item1: TdxLayoutItem
|
||||
Caption = 'Calle:'
|
||||
CaptionOptions.Text = 'Calle:'
|
||||
Control = eCalle
|
||||
ControlOptions.ShowBorder = False
|
||||
end
|
||||
object dxLayoutControl1Group3: TdxLayoutGroup
|
||||
ShowCaption = False
|
||||
CaptionOptions.Visible = False
|
||||
ButtonOptions.Buttons = <>
|
||||
Hidden = True
|
||||
ShowBorder = False
|
||||
object dxLayoutControl1Group1: TdxLayoutGroup
|
||||
ShowCaption = False
|
||||
CaptionOptions.Visible = False
|
||||
ButtonOptions.Buttons = <>
|
||||
Hidden = True
|
||||
ShowBorder = False
|
||||
object dxLayoutControl1Group2: TdxLayoutGroup
|
||||
ShowCaption = False
|
||||
CaptionOptions.Visible = False
|
||||
ButtonOptions.Buttons = <>
|
||||
Hidden = True
|
||||
LayoutDirection = ldHorizontal
|
||||
ShowBorder = False
|
||||
object dxLayoutControl1Item2: TdxLayoutItem
|
||||
AutoAligns = [aaVertical]
|
||||
AlignHorz = ahClient
|
||||
Caption = 'Provincia:'
|
||||
CaptionOptions.Text = 'Provincia:'
|
||||
Control = cbProvincia
|
||||
ControlOptions.ShowBorder = False
|
||||
end
|
||||
object dxLayoutControl1Item4: TdxLayoutItem
|
||||
AutoAligns = [aaVertical]
|
||||
AlignHorz = ahRight
|
||||
Caption = 'C.P.:'
|
||||
CaptionOptions.Text = 'C.P.:'
|
||||
Control = eCodigoPostal
|
||||
ControlOptions.ShowBorder = False
|
||||
end
|
||||
end
|
||||
object dxLayoutControl1Item3: TdxLayoutItem
|
||||
Caption = 'Poblaci'#243'n:'
|
||||
CaptionOptions.Text = 'Poblaci'#243'n:'
|
||||
Control = cbPoblacion
|
||||
ControlOptions.ShowBorder = False
|
||||
end
|
||||
end
|
||||
object dxLayoutControl1Group4: TdxLayoutGroup
|
||||
ShowCaption = False
|
||||
CaptionOptions.Visible = False
|
||||
ButtonOptions.Buttons = <>
|
||||
Hidden = True
|
||||
LayoutDirection = ldHorizontal
|
||||
ShowBorder = False
|
||||
object dxLayoutControl1Item6: TdxLayoutItem
|
||||
AutoAligns = [aaVertical]
|
||||
AlignHorz = ahClient
|
||||
Caption = 'Contacto:'
|
||||
CaptionOptions.Text = 'Contacto:'
|
||||
Control = ePersonaContacto
|
||||
ControlOptions.ShowBorder = False
|
||||
end
|
||||
object dxLayoutControl1Item5: TdxLayoutItem
|
||||
AutoAligns = [aaVertical]
|
||||
AlignHorz = ahRight
|
||||
Caption = 'Tel'#233'fono:'
|
||||
CaptionOptions.Text = 'Tel'#233'fono:'
|
||||
Control = eTlfTrabajo
|
||||
ControlOptions.ShowBorder = False
|
||||
end
|
||||
|
||||
@ -7,7 +7,8 @@ uses
|
||||
Dialogs, uViewBase, uBizAlbaranesCliente, cxGraphics, dxLayoutControl, cxMemo,
|
||||
cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxLookupEdit,
|
||||
cxDBLookupEdit, cxDBLookupComboBox, StdCtrls, cxControls, DB, uDADataTable,
|
||||
ActnList, uAlbaranesClienteController, Buttons, cxDBEdit, uDAInterfaces;
|
||||
ActnList, uAlbaranesClienteController, Buttons, cxDBEdit, uDAInterfaces,
|
||||
cxLookAndFeels, cxLookAndFeelPainters, dxLayoutcxEditAdapters;
|
||||
|
||||
type
|
||||
IViewDireccionEntregaAlbaranCliente = interface(IViewBase)
|
||||
@ -47,7 +48,9 @@ type
|
||||
FAlbaran : IBizAlbaranCliente;
|
||||
FController : IAlbaranesClienteController;
|
||||
FProvincias : TStringList;
|
||||
FIDProvincia : Integer; //Almacenará la provincia que hay seleccionada para no cargar las poblaciones si no es necesario
|
||||
FPoblaciones : TStringList;
|
||||
|
||||
procedure CargarProvincias;
|
||||
procedure CargarPoblaciones;
|
||||
function GetAlbaranCliente: IBizAlbaranCliente;
|
||||
@ -71,27 +74,29 @@ uses
|
||||
procedure TfrViewDireccionEntregaAlbaranCliente.CargarPoblaciones;
|
||||
var
|
||||
i : integer;
|
||||
AID : Integer;
|
||||
begin
|
||||
AID := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(AID);
|
||||
if (FIDProvincia <> StrToInt(FProvincias.Values[cbProvincia.Text])) then
|
||||
Begin
|
||||
FIDProvincia := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(FIDProvincia);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
procedure TfrViewDireccionEntregaAlbaranCliente.CargarProvincias;
|
||||
@ -168,6 +173,7 @@ end;
|
||||
constructor TfrViewDireccionEntregaAlbaranCliente.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
FIDProvincia := 0;
|
||||
FAlbaran := NIL;
|
||||
FProvincias := NIL;
|
||||
FPoblaciones := NIL;
|
||||
|
||||
@ -6,7 +6,8 @@ uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
|
||||
Buttons, ExtCtrls, Mask, DBCtrls, DB, uDADataTable,
|
||||
cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit,
|
||||
uIEditorDireccionEntregaAlbaranProveedor, uBizAlbaranesProveedor,
|
||||
uDAInterfaces, cxGraphics, cxMaskEdit, cxDropDownEdit;
|
||||
uDAInterfaces, cxGraphics, cxMaskEdit, cxDropDownEdit, cxLookAndFeels,
|
||||
cxLookAndFeelPainters;
|
||||
|
||||
type
|
||||
TfEditorDireccionEntregaAlbaranProveedor = class(TForm, IEditorDireccionEntregaAlbaranProveedor)
|
||||
@ -38,6 +39,7 @@ type
|
||||
pDireccion: String;
|
||||
pPoblacion: String;
|
||||
pProvincia: String;
|
||||
FIDProvincia : Integer; //Almacenará la provincia que hay seleccionada para no cargar las poblaciones si no es necesario
|
||||
pCodigoPostal: String;
|
||||
pPersonaContacto: String;
|
||||
pTelefono: String;
|
||||
@ -63,27 +65,30 @@ uses
|
||||
procedure TfEditorDireccionEntregaAlbaranProveedor.CargarPoblaciones;
|
||||
var
|
||||
i : integer;
|
||||
AID : Integer;
|
||||
begin
|
||||
AID := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(AID);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
begin
|
||||
if (FIDProvincia <> StrToInt(FProvincias.Values[cbProvincia.Text])) then
|
||||
Begin
|
||||
FIDProvincia := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(FIDProvincia);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
procedure TfEditorDireccionEntregaAlbaranProveedor.CargarProvincias;
|
||||
@ -154,6 +159,7 @@ end;
|
||||
|
||||
procedure TfEditorDireccionEntregaAlbaranProveedor.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FIDProvincia := 0;
|
||||
FProvincias := NIL;
|
||||
FPoblaciones := NIL;
|
||||
end;
|
||||
|
||||
@ -51,6 +51,7 @@ type
|
||||
FAlmacen: IBizAlmacen;
|
||||
FProvincias : TStringList;
|
||||
FPoblaciones : TStringList;
|
||||
FIDProvincia : Integer; //Almacenará la provincia que hay seleccionada para no cargar las poblaciones si no es necesario
|
||||
procedure CargarProvincias;
|
||||
procedure CargarPoblaciones;
|
||||
function GetAlmacen: IBizAlmacen;
|
||||
@ -78,27 +79,30 @@ uses
|
||||
procedure TfrViewAlmacen.CargarPoblaciones;
|
||||
var
|
||||
i : integer;
|
||||
AID : Integer;
|
||||
begin
|
||||
AID := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(AID);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
begin
|
||||
if (FIDProvincia <> StrToInt(FProvincias.Values[cbProvincia.Text])) then
|
||||
Begin
|
||||
FIDProvincia := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(FIDProvincia);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
procedure TfrViewAlmacen.CargarProvincias;
|
||||
@ -153,6 +157,7 @@ end;
|
||||
constructor TfrViewAlmacen.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
FIDProvincia := 0;
|
||||
FProvincias := NIL;
|
||||
FPoblaciones := NIL;
|
||||
end;
|
||||
|
||||
@ -156,7 +156,6 @@ inherited frViewContacto: TfrViewContacto
|
||||
Properties.ImmediateUpdateText = True
|
||||
Properties.PostPopupValueOnTab = True
|
||||
Properties.OnInitPopup = cbPoblacionPropertiesInitPopup
|
||||
Style.BorderStyle = ebs3D
|
||||
Style.LookAndFeel.Kind = lfStandard
|
||||
Style.LookAndFeel.NativeStyle = True
|
||||
Style.LookAndFeel.SkinName = ''
|
||||
|
||||
@ -103,6 +103,7 @@ type
|
||||
FContacto: IBizContacto;
|
||||
FController : IContactosController;
|
||||
FProvincias : TStringList;
|
||||
FIDProvincia : Integer; //Almacenará la provincia que hay seleccionada para no cargar las poblaciones si no es necesario
|
||||
FPoblaciones : TStringList;
|
||||
procedure CargarProvincias;
|
||||
procedure CargarPoblaciones;
|
||||
@ -171,27 +172,30 @@ end;
|
||||
procedure TfrViewContacto.CargarPoblaciones;
|
||||
var
|
||||
i : integer;
|
||||
AID : Integer;
|
||||
|
||||
begin
|
||||
AID := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(AID);
|
||||
if (FIDProvincia <> StrToInt(FProvincias.Values[cbProvincia.Text])) then
|
||||
Begin
|
||||
FIDProvincia := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(FIDProvincia);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
procedure TfrViewContacto.CargarProvincias;
|
||||
@ -221,7 +225,7 @@ end;
|
||||
procedure TfrViewContacto.cbPoblacionPropertiesInitPopup(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
{
|
||||
|
||||
ShowHourglassCursor;
|
||||
try
|
||||
FreeANDNIL(FPoblaciones);
|
||||
@ -232,12 +236,12 @@ begin
|
||||
finally
|
||||
HideHourglassCursor;
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
||||
constructor TfrViewContacto.Create(AOwner : TComponent);
|
||||
begin
|
||||
inherited;
|
||||
FIDProvincia := 0;
|
||||
FProvincias := NIL;
|
||||
FPoblaciones := NIL;
|
||||
end;
|
||||
|
||||
@ -11,7 +11,6 @@ inherited frViewDireccionEntrega: TfrViewDireccionEntrega
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
TabStop = False
|
||||
ExplicitHeight = 245
|
||||
object cbPoblacion: TcxDBComboBox
|
||||
Left = 64
|
||||
Top = 64
|
||||
|
||||
@ -32,7 +32,9 @@ type
|
||||
procedure cbProvinciaPropertiesInitPopup(Sender: TObject);
|
||||
protected
|
||||
FProvincias : TStringList;
|
||||
FIDProvincia : Integer; //Almacenará la provincia que hay seleccionada para no cargar las poblaciones si no es necesario
|
||||
FPoblaciones : TStringList;
|
||||
|
||||
procedure CargarProvincias;
|
||||
procedure CargarPoblaciones;
|
||||
|
||||
@ -53,27 +55,30 @@ uses
|
||||
procedure TfrViewDireccionEntrega.CargarPoblaciones;
|
||||
var
|
||||
i : integer;
|
||||
AID : Integer;
|
||||
begin
|
||||
AID := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(AID);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
begin
|
||||
if (FIDProvincia <> StrToInt(FProvincias.Values[cbProvincia.Text])) then
|
||||
Begin
|
||||
FIDProvincia := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(FIDProvincia);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
procedure TfrViewDireccionEntrega.CargarProvincias;
|
||||
@ -132,6 +137,7 @@ end;
|
||||
constructor TfrViewDireccionEntrega.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
FIDProvincia := 0;
|
||||
FProvincias := NIL;
|
||||
FPoblaciones := NIL;
|
||||
end;
|
||||
|
||||
@ -64,6 +64,7 @@ type
|
||||
FObra: IBizObra;
|
||||
FController : IObrasController;
|
||||
FProvincias : TStringList;
|
||||
FIDProvincia : Integer; //Almacenará la provincia que hay seleccionada para no cargar las poblaciones si no es necesario
|
||||
FPoblaciones : TStringList;
|
||||
procedure CargarProvincias;
|
||||
procedure CargarPoblaciones;
|
||||
@ -96,27 +97,31 @@ uses
|
||||
procedure TfrViewObra.CargarPoblaciones;
|
||||
var
|
||||
i : integer;
|
||||
AID : Integer;
|
||||
begin
|
||||
AID := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(AID);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
begin
|
||||
if (FIDProvincia <> StrToInt(FProvincias.Values[cbProvincia.Text])) then
|
||||
Begin
|
||||
FIDProvincia := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(FIDProvincia);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
procedure TfrViewObra.CargarProvincias;
|
||||
@ -171,6 +176,7 @@ end;
|
||||
constructor TfrViewObra.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
FIDProvincia := 0;
|
||||
FProvincias := NIL;
|
||||
FPoblaciones := NIL;
|
||||
end;
|
||||
|
||||
@ -6,7 +6,7 @@ uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
|
||||
Buttons, ExtCtrls, Mask, DBCtrls, DB, uDADataTable,
|
||||
cxControls, cxContainer, cxEdit, cxTextEdit, cxDBEdit,
|
||||
uIEditorDireccionEntregaPedidoProveedor, uBizPedidosProveedor, uDAInterfaces,
|
||||
cxGraphics, cxMaskEdit, cxDropDownEdit;
|
||||
cxGraphics, cxMaskEdit, cxDropDownEdit, cxLookAndFeels, cxLookAndFeelPainters;
|
||||
|
||||
type
|
||||
TfEditorDireccionEntregaPedidoProveedor = class(TForm, IEditorDireccionEntregaPedidoProveedor)
|
||||
@ -34,6 +34,7 @@ type
|
||||
pDireccion: String;
|
||||
pPoblacion: String;
|
||||
pProvincia: String;
|
||||
FIDProvincia : Integer; //Almacenará la provincia que hay seleccionada para no cargar las poblaciones si no es necesario
|
||||
pCodigoPostal: String;
|
||||
FProvincias : TStringList;
|
||||
FPoblaciones : TStringList;
|
||||
@ -57,27 +58,30 @@ uses
|
||||
procedure TfEditorDireccionEntregaPedidoProveedor.CargarPoblaciones;
|
||||
var
|
||||
i : integer;
|
||||
AID : Integer;
|
||||
begin
|
||||
AID := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(AID);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
begin
|
||||
if (FIDProvincia <> StrToInt(FProvincias.Values[cbProvincia.Text])) then
|
||||
Begin
|
||||
FIDProvincia := StrToInt(FProvincias.Values[cbProvincia.Text]);
|
||||
with TProvinciasPoblacionesController.Create do
|
||||
try
|
||||
FPoblaciones := DarListaPoblaciones(FIDProvincia);
|
||||
|
||||
with cbPoblacion.Properties.Items do
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
Clear;
|
||||
for i := 0 to FPoblaciones.Count - 1 do
|
||||
Add(FPoblaciones.Names[i]);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
finally
|
||||
Free;
|
||||
end;
|
||||
End;
|
||||
end;
|
||||
|
||||
procedure TfEditorDireccionEntregaPedidoProveedor.CargarProvincias;
|
||||
@ -146,6 +150,7 @@ end;
|
||||
|
||||
procedure TfEditorDireccionEntregaPedidoProveedor.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FIDProvincia := 0;
|
||||
FProvincias := NIL;
|
||||
FPoblaciones := NIL;
|
||||
end;
|
||||
|
||||
Binary file not shown.
@ -17,7 +17,7 @@ BEGIN
|
||||
VALUE "InternalName", "FactuGES Servidor\0"
|
||||
VALUE "ProductName", "FactuGES Servidor\0"
|
||||
VALUE "ProductVersion", "1.0.8.0\0"
|
||||
VALUE "CompileDate", "lunes, 19 de julio de 2010 18:25\0"
|
||||
VALUE "CompileDate", "martes, 20 de julio de 2010 10:55\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Reference in New Issue
Block a user