diff --git a/Build/Build.fbl6 b/Build/Build.fbl6 index 5cd5fd5..17217b3 100644 Binary files a/Build/Build.fbl6 and b/Build/Build.fbl6 differ diff --git a/Source/ApplicationBase/Empresas/Views/uViewEmpresa.pas b/Source/ApplicationBase/Empresas/Views/uViewEmpresa.pas index 33f8d97..7b8e444 100644 --- a/Source/ApplicationBase/Empresas/Views/uViewEmpresa.pas +++ b/Source/ApplicationBase/Empresas/Views/uViewEmpresa.pas @@ -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; diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.pas index a26aea8..e0496db 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uViewAlbaranCliente.pas @@ -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; diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewDireccionEntregaAlbaranCliente.dfm b/Source/Modulos/Albaranes de cliente/Views/uViewDireccionEntregaAlbaranCliente.dfm index 6ffdb19..edff32d 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewDireccionEntregaAlbaranCliente.dfm +++ b/Source/Modulos/Albaranes de cliente/Views/uViewDireccionEntregaAlbaranCliente.dfm @@ -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 diff --git a/Source/Modulos/Albaranes de cliente/Views/uViewDireccionEntregaAlbaranCliente.pas b/Source/Modulos/Albaranes de cliente/Views/uViewDireccionEntregaAlbaranCliente.pas index 3d35ee2..c08a7b0 100644 --- a/Source/Modulos/Albaranes de cliente/Views/uViewDireccionEntregaAlbaranCliente.pas +++ b/Source/Modulos/Albaranes de cliente/Views/uViewDireccionEntregaAlbaranCliente.pas @@ -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; diff --git a/Source/Modulos/Albaranes de proveedor/Views/uEditorDireccionEntregaAlbaranProveedor.pas b/Source/Modulos/Albaranes de proveedor/Views/uEditorDireccionEntregaAlbaranProveedor.pas index 9ef271c..6c097a8 100644 --- a/Source/Modulos/Albaranes de proveedor/Views/uEditorDireccionEntregaAlbaranProveedor.pas +++ b/Source/Modulos/Albaranes de proveedor/Views/uEditorDireccionEntregaAlbaranProveedor.pas @@ -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; diff --git a/Source/Modulos/Almacenes/Views/uViewAlmacen.pas b/Source/Modulos/Almacenes/Views/uViewAlmacen.pas index c8c5077..c623c8f 100644 --- a/Source/Modulos/Almacenes/Views/uViewAlmacen.pas +++ b/Source/Modulos/Almacenes/Views/uViewAlmacen.pas @@ -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; diff --git a/Source/Modulos/Contactos/Views/uViewContacto.dfm b/Source/Modulos/Contactos/Views/uViewContacto.dfm index e9fa3de..bd62284 100644 --- a/Source/Modulos/Contactos/Views/uViewContacto.dfm +++ b/Source/Modulos/Contactos/Views/uViewContacto.dfm @@ -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 = '' diff --git a/Source/Modulos/Contactos/Views/uViewContacto.pas b/Source/Modulos/Contactos/Views/uViewContacto.pas index 39f59c2..30b8e35 100644 --- a/Source/Modulos/Contactos/Views/uViewContacto.pas +++ b/Source/Modulos/Contactos/Views/uViewContacto.pas @@ -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; diff --git a/Source/Modulos/Contactos/Views/uViewDireccionEntrega.dfm b/Source/Modulos/Contactos/Views/uViewDireccionEntrega.dfm index 26cd76f..c50fa5b 100644 --- a/Source/Modulos/Contactos/Views/uViewDireccionEntrega.dfm +++ b/Source/Modulos/Contactos/Views/uViewDireccionEntrega.dfm @@ -11,7 +11,6 @@ inherited frViewDireccionEntrega: TfrViewDireccionEntrega Align = alClient TabOrder = 0 TabStop = False - ExplicitHeight = 245 object cbPoblacion: TcxDBComboBox Left = 64 Top = 64 diff --git a/Source/Modulos/Contactos/Views/uViewDireccionEntrega.pas b/Source/Modulos/Contactos/Views/uViewDireccionEntrega.pas index 00304d2..4af16fb 100644 --- a/Source/Modulos/Contactos/Views/uViewDireccionEntrega.pas +++ b/Source/Modulos/Contactos/Views/uViewDireccionEntrega.pas @@ -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; diff --git a/Source/Modulos/Obras/Views/uViewObra.pas b/Source/Modulos/Obras/Views/uViewObra.pas index 0240b11..89e1775 100644 --- a/Source/Modulos/Obras/Views/uViewObra.pas +++ b/Source/Modulos/Obras/Views/uViewObra.pas @@ -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; diff --git a/Source/Modulos/Pedidos a proveedor/Views/uEditorDireccionEntregaPedidoProveedor.pas b/Source/Modulos/Pedidos a proveedor/Views/uEditorDireccionEntregaPedidoProveedor.pas index 9318dd3..14d5c8b 100644 --- a/Source/Modulos/Pedidos a proveedor/Views/uEditorDireccionEntregaPedidoProveedor.pas +++ b/Source/Modulos/Pedidos a proveedor/Views/uEditorDireccionEntregaPedidoProveedor.pas @@ -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; diff --git a/Source/Servidor/FactuGES_Server.RES b/Source/Servidor/FactuGES_Server.RES index b000d0f..eb89730 100644 Binary files a/Source/Servidor/FactuGES_Server.RES and b/Source/Servidor/FactuGES_Server.RES differ diff --git a/Source/Servidor/FactuGES_Server.rc b/Source/Servidor/FactuGES_Server.rc index c86f421..3c9388c 100644 --- a/Source/Servidor/FactuGES_Server.rc +++ b/Source/Servidor/FactuGES_Server.rc @@ -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"