Ticket #91 -> En las obras, poner la dirección del cliente como dirección de la obra.

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@550 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
David Arranz 2008-09-02 16:49:55 +00:00
parent 063d4b09df
commit ee6ba1a7c8
7 changed files with 239 additions and 96 deletions

View File

@ -35,7 +35,7 @@ requires
TiposIVA_model,
TiposIVA_controller,
Contactos_model,
Contactos_controller,
Contactos_controller,
JvGlobusD11R,
dbrtl,
DataAbstract_Core_D11,

View File

@ -49,52 +49,38 @@
<DelphiCompile Include="Contactos_view.dpk">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\..\Presupuestos de cliente\Controller\adortl.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\ApplicationBase.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\Base.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\CJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\CoJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\ConJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\ContacJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\ContactJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\ContactoJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\ContactosJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\Contactos_controller.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\Contactos_JvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\Contactos_model.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\Contactos_vieJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\Contactos_viewJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\Contactos_viJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\Contactos_vJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\ContaJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\ContJvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\cxDataD11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\cxEditorsD11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\cxExportD11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\cxExtEditorsD11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\cxGridD11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\cxLibraryD11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\cxPageControlD11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\DataAbstract_Core_D11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\dbrtl.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\dsnap.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\dxGDIPlusD11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\dxThemeD11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\FormasPago_controller.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\FormasPago_model.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\GUIBase.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\JvGlobusD11R.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\PngComponentsD10.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\PNG_D10.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\RemObjects_Core_D11.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\rtl.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\TiposIVA_controller.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\TiposIVA_model.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\vcl.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\vclactnband.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\vcldb.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\vcljpg.dcp" />
<DCCReference Include="..\..\Presupuestos de cliente\Controller\vclx.dcp" />
<DCCReference Include="..\..\..\Cliente\adortl.dcp" />
<DCCReference Include="..\..\..\Cliente\ApplicationBase.dcp" />
<DCCReference Include="..\..\..\Cliente\Base.dcp" />
<DCCReference Include="..\..\..\Cliente\Contactos_controller.dcp" />
<DCCReference Include="..\..\..\Cliente\Contactos_model.dcp" />
<DCCReference Include="..\..\..\Cliente\cxDataD11.dcp" />
<DCCReference Include="..\..\..\Cliente\cxEditorsD11.dcp" />
<DCCReference Include="..\..\..\Cliente\cxExportD11.dcp" />
<DCCReference Include="..\..\..\Cliente\cxExtEditorsD11.dcp" />
<DCCReference Include="..\..\..\Cliente\cxGridD11.dcp" />
<DCCReference Include="..\..\..\Cliente\cxLibraryD11.dcp" />
<DCCReference Include="..\..\..\Cliente\cxPageControlD11.dcp" />
<DCCReference Include="..\..\..\Cliente\DataAbstract_Core_D11.dcp" />
<DCCReference Include="..\..\..\Cliente\dbrtl.dcp" />
<DCCReference Include="..\..\..\Cliente\dsnap.dcp" />
<DCCReference Include="..\..\..\Cliente\dxGDIPlusD11.dcp" />
<DCCReference Include="..\..\..\Cliente\dxThemeD11.dcp" />
<DCCReference Include="..\..\..\Cliente\FormasPago_controller.dcp" />
<DCCReference Include="..\..\..\Cliente\FormasPago_model.dcp" />
<DCCReference Include="..\..\..\Cliente\GUIBase.dcp" />
<DCCReference Include="..\..\..\Cliente\JvGlobusD11R.dcp" />
<DCCReference Include="..\..\..\Cliente\PngComponentsD10.dcp" />
<DCCReference Include="..\..\..\Cliente\PNG_D10.dcp" />
<DCCReference Include="..\..\..\Cliente\RemObjects_Core_D11.dcp" />
<DCCReference Include="..\..\..\Cliente\rtl.dcp" />
<DCCReference Include="..\..\..\Cliente\TiposIVA_controller.dcp" />
<DCCReference Include="..\..\..\Cliente\TiposIVA_model.dcp" />
<DCCReference Include="..\..\..\Cliente\vcl.dcp" />
<DCCReference Include="..\..\..\Cliente\vclactnband.dcp" />
<DCCReference Include="..\..\..\Cliente\vcldb.dcp" />
<DCCReference Include="..\..\..\Cliente\vcljpg.dcp" />
<DCCReference Include="..\..\..\Cliente\vclx.dcp" />
<DCCReference Include="uContactosViewRegister.pas" />
<DCCReference Include="uEditorCliente.pas">
<Form>fEditorCliente</Form>

View File

@ -5,7 +5,7 @@ interface
uses
Classes, SysUtils, uDADataTable, uControllerBase, uEditorDBItem,
uIDataModuleObras, uBizObras, uBizDireccionesContacto;
uIDataModuleObras, uBizObras, uBizDireccionesContacto, uBizContactos;
type
IObrasController = interface(IControllerBase)
@ -27,7 +27,8 @@ type
procedure Print(AObra : IBizObra);
procedure QuitarDireccion(AObra: IBizObra);
procedure CopiarDireccion (const ADireccionEnvio: IBizDireccionesContacto; AObra: IBizObra);
procedure CopiarDireccion (const ADireccionEnvio: IBizDireccionesContacto; AObra: IBizObra); overload;
procedure CopiarDireccion (const ACliente: IBizCliente; AObra: IBizObra); overload;
end;
TObrasController = class(TControllerBase, IObrasController)
@ -71,7 +72,8 @@ type
procedure Print(AObra : IBizObra);
procedure QuitarDireccion(AObra: IBizObra);
procedure CopiarDireccion (const ADireccionEnvio: IBizDireccionesContacto; AObra: IBizObra);
procedure CopiarDireccion (const ADireccionEnvio: IBizDireccionesContacto; AObra: IBizObra); overload;
procedure CopiarDireccion (const ACliente: IBizCliente; AObra: IBizObra); overload;
end;
implementation
@ -164,6 +166,45 @@ begin
end;
end;
procedure TObrasController.CopiarDireccion(const ACliente: IBizCliente;
AObra: IBizObra);
var
bEnEdicion : Boolean;
begin
if not Assigned(AObra) then
raise Exception.Create ('Obra no asignada (CopiarDireccion)');
if not Assigned(ACliente) then
raise Exception.Create ('No se ha indicado el cliente (CopiarDireccionEnvio)');
if AObra.DataTable.Active then
AObra.DataTable.Active := True;
if ACliente.DataTable.Active then
ACliente.DataTable.Active := True;
bEnEdicion := (AObra.DataTable.State in dsEditModes);
if not bEnEdicion then
AObra.Edit;
ShowHourglassCursor;
AObra.Edit;
try
AObra.CALLE := ACliente.CALLE;
AObra.POBLACION := ACliente.POBLACION;
AObra.CODIGO_POSTAL := ACliente.CODIGO_POSTAL;
AObra.PROVINCIA := ACliente.PROVINCIA;
AObra.TELEFONO := ACliente.TELEFONO_1;
AObra.PERSONA_CONTACTO := ACliente.PERSONA_CONTACTO;
if not bEnEdicion then
AObra.Post;
finally
HideHourglassCursor;
end;
end;
constructor TObrasController.Create;
begin
inherited;
@ -221,8 +262,6 @@ end;
function TObrasController.ValidarObra(AObra: IBizObra): Boolean;
begin
Result := False;
if not Assigned(AObra) then
raise Exception.Create ('Obra no asignada');

View File

@ -6,6 +6,7 @@
<ItemGroup>
<Projects Include="..\..\ApplicationBase\ApplicationBase.dproj" />
<Projects Include="..\..\Base\Base.dproj" />
<Projects Include="..\..\Cliente\FactuGES.dproj" />
<Projects Include="..\..\GUIBase\GUIBase.dproj" />
<Projects Include="..\..\Servidor\FactuGES_Server.dproj" />
<Projects Include="..\Contactos\Views\Contactos_view.dproj" />
@ -103,6 +104,15 @@
<Target Name="Obras_plugin:Make">
<MSBuild Projects="Plugin\Obras_plugin.dproj" Targets="Make" />
</Target>
<Target Name="FactuGES">
<MSBuild Projects="..\..\Cliente\FactuGES.dproj" Targets="" />
</Target>
<Target Name="FactuGES:Clean">
<MSBuild Projects="..\..\Cliente\FactuGES.dproj" Targets="Clean" />
</Target>
<Target Name="FactuGES:Make">
<MSBuild Projects="..\..\Cliente\FactuGES.dproj" Targets="Make" />
</Target>
<Target Name="FactuGES_Server">
<MSBuild Projects="..\..\Servidor\FactuGES_Server.dproj" Targets="" />
</Target>
@ -122,13 +132,13 @@
<MSBuild Projects="..\Presupuestos de cliente\Views\PresupuestosCliente_view.dproj" Targets="Make" />
</Target>
<Target Name="Build">
<CallTarget Targets="Base;GUIBase;ApplicationBase;Contactos_view;Obras_model;Obras_data;Obras_controller;Obras_view;Obras_plugin;FactuGES_Server;PresupuestosCliente_view" />
<CallTarget Targets="Base;GUIBase;ApplicationBase;Contactos_view;Obras_model;Obras_data;Obras_controller;Obras_view;Obras_plugin;FactuGES;FactuGES_Server;PresupuestosCliente_view" />
</Target>
<Target Name="Clean">
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;Contactos_view:Clean;Obras_model:Clean;Obras_data:Clean;Obras_controller:Clean;Obras_view:Clean;Obras_plugin:Clean;FactuGES_Server:Clean;PresupuestosCliente_view:Clean" />
<CallTarget Targets="Base:Clean;GUIBase:Clean;ApplicationBase:Clean;Contactos_view:Clean;Obras_model:Clean;Obras_data:Clean;Obras_controller:Clean;Obras_view:Clean;Obras_plugin:Clean;FactuGES:Clean;FactuGES_Server:Clean;PresupuestosCliente_view:Clean" />
</Target>
<Target Name="Make">
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;Contactos_view:Make;Obras_model:Make;Obras_data:Make;Obras_controller:Make;Obras_view:Make;Obras_plugin:Make;FactuGES_Server:Make;PresupuestosCliente_view:Make" />
<CallTarget Targets="Base:Make;GUIBase:Make;ApplicationBase:Make;Contactos_view:Make;Obras_model:Make;Obras_data:Make;Obras_controller:Make;Obras_view:Make;Obras_plugin:Make;FactuGES:Make;FactuGES_Server:Make;PresupuestosCliente_view:Make" />
</Target>
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
</Project>

View File

@ -1,23 +1,24 @@
inherited frViewObra: TfrViewObra
Width = 924
Height = 548
Width = 841
Height = 487
Align = alClient
ExplicitWidth = 451
ExplicitHeight = 304
object dxLayoutControlObra: TdxLayoutControl
Left = 0
Top = 0
Width = 924
Height = 548
Width = 841
Height = 487
Align = alClient
ParentBackground = True
TabOrder = 0
TabStop = False
AutoContentSizes = [acsWidth, acsHeight]
ExplicitHeight = 497
ExplicitWidth = 451
ExplicitHeight = 304
DesignSize = (
924
548)
841
487)
object eNombre: TcxDBTextEdit
Left = 130
Top = 34
@ -30,9 +31,13 @@ inherited frViewObra: TfrViewObra
Style.Color = 14745599
Style.HotTrack = False
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 0
Width = 116
end
@ -46,9 +51,13 @@ inherited frViewObra: TfrViewObra
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 1
Width = 116
end
@ -61,9 +70,13 @@ inherited frViewObra: TfrViewObra
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 6
Width = 116
end
@ -76,9 +89,13 @@ inherited frViewObra: TfrViewObra
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 7
Width = 116
end
@ -91,9 +108,13 @@ inherited frViewObra: TfrViewObra
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 8
Width = 116
end
@ -107,12 +128,16 @@ inherited frViewObra: TfrViewObra
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 2
Width = 116
end
@ -130,19 +155,23 @@ inherited frViewObra: TfrViewObra
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
Style.ButtonStyle = bts3D
Style.PopupBorderStyle = epbsFrame3D
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 5
Width = 203
end
object eCodigoPostal: TcxDBTextEdit
Left = 351
Left = 310
Top = 145
DataBinding.DataField = 'CODIGO_POSTAL'
DataBinding.DataSource = DADataSource
@ -151,12 +180,16 @@ inherited frViewObra: TfrViewObra
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 4
Width = 91
end
@ -174,14 +207,18 @@ inherited frViewObra: TfrViewObra
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
Style.ButtonStyle = bts3D
Style.PopupBorderStyle = epbsFrame3D
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 3
Width = 253
end
@ -195,19 +232,23 @@ inherited frViewObra: TfrViewObra
Style.BorderStyle = ebs3D
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.SkinName = ''
TabOrder = 9
Height = 246
Width = 224
end
inline frViewSubcontrataObra1: TfrViewSubcontrataObra
Left = 472
Top = 34
Left = 431
Top = 283
Width = 503
Height = 159
Font.Charset = DEFAULT_CHARSET
@ -216,10 +257,10 @@ inherited frViewObra: TfrViewObra
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 10
TabOrder = 11
ReadOnly = False
ExplicitLeft = 472
ExplicitTop = 34
ExplicitLeft = 431
ExplicitTop = 283
ExplicitWidth = 503
ExplicitHeight = 159
inherited dxLayoutControl1: TdxLayoutControl
@ -231,42 +272,78 @@ inherited frViewObra: TfrViewObra
503
265)
inherited edtlNombre: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 375
Width = 375
end
inherited edtNIFCIF: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 375
Width = 375
end
inherited edtCalle: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 375
Width = 375
end
inherited edtPoblacion: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 257
Width = 257
end
inherited edtProvincia: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 375
Width = 375
end
inherited edtCodigoPostal: TcxDBTextEdit
Left = 338
ExplicitLeft = 338
Left = 296
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 296
end
inherited Button3: TBitBtn
Left = 197
ExplicitLeft = 197
Left = 155
ExplicitLeft = 155
end
inherited edtPersonaContacto: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 375
Width = 375
end
inherited edtReferenciaAsignada: TcxDBTextEdit
Left = 299
ExplicitLeft = 299
Left = 257
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 257
end
inherited edtTlf: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 182
Width = 182
end
@ -285,8 +362,8 @@ inherited frViewObra: TfrViewObra
end
end
inline frViewClienteAsociadoObra1: TfrViewClienteAsociadoObra
Left = 472
Top = 229
Left = 431
Top = 34
Width = 503
Height = 213
Font.Charset = DEFAULT_CHARSET
@ -295,10 +372,10 @@ inherited frViewObra: TfrViewObra
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 11
TabOrder = 10
ReadOnly = False
ExplicitLeft = 472
ExplicitTop = 229
ExplicitLeft = 431
ExplicitTop = 34
ExplicitWidth = 503
ExplicitHeight = 213
inherited dxLayoutControl1: TdxLayoutControl
@ -307,32 +384,56 @@ inherited frViewObra: TfrViewObra
ExplicitWidth = 503
ExplicitHeight = 213
inherited edtlNombre: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 429
Width = 429
end
inherited edtNIFCIF: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 429
Width = 429
end
inherited edtCalle: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 429
Width = 429
end
inherited edtPoblacion: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 311
Width = 311
end
inherited edtProvincia: TcxDBTextEdit
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitWidth = 429
Width = 429
end
inherited edtCodigoPostal: TcxDBTextEdit
Left = 338
ExplicitLeft = 338
Left = 296
Style.LookAndFeel.SkinName = ''
StyleDisabled.LookAndFeel.SkinName = ''
StyleFocused.LookAndFeel.SkinName = ''
StyleHot.LookAndFeel.SkinName = ''
ExplicitLeft = 296
end
inherited Button3: TBitBtn
Left = 228
ExplicitLeft = 228
Left = 186
ExplicitLeft = 186
end
end
end
@ -448,16 +549,6 @@ inherited frViewObra: TfrViewObra
ShowCaption = False
Hidden = True
ShowBorder = False
object dxLayoutControlObraGroup9: TdxLayoutGroup
AutoAligns = [aaVertical]
AlignHorz = ahClient
Caption = 'Subcontrata'
object dxLayoutControlObraItem8: TdxLayoutItem
Control = frViewSubcontrataObra1
ControlOptions.AutoColor = True
ControlOptions.ShowBorder = False
end
end
object dxLayoutControlObraGroup7: TdxLayoutGroup
AutoAligns = []
AlignHorz = ahClient
@ -470,6 +561,16 @@ inherited frViewObra: TfrViewObra
ControlOptions.ShowBorder = False
end
end
object dxLayoutControlObraGroup9: TdxLayoutGroup
AutoAligns = [aaVertical]
AlignHorz = ahClient
Caption = 'Subcontrata'
object dxLayoutControlObraItem8: TdxLayoutItem
Control = frViewSubcontrataObra1
ControlOptions.AutoColor = True
ControlOptions.ShowBorder = False
end
end
end
end
end

View File

@ -88,7 +88,7 @@ implementation
uses
uDataModuleObras, uProvinciasPoblacionesController, uStringsUtils,
uClientesController, uBizDireccionesContacto;
uClientesController, uBizDireccionesContacto, uDialogUtils;
{$R *.dfm}
@ -207,13 +207,14 @@ procedure TfrViewObra.OnClienteChanged(Sender: TObject);
var
AClientesController : IClientesController;
ADireccion : IBizDireccionesContacto;
AVerMensaje : Boolean;
begin
if Assigned(FObra) then
begin
FObra.Edit;
FObra.ID_CLIENTE := frViewClienteAsociadoObra1.ID_Cliente;
AVerMensaje := False;
AClientesController := TClientesController.Create;
try
{ // Esto podría ser configurable en el programa
@ -222,10 +223,12 @@ begin
case frViewClienteAsociadoObra1.Cliente.Direcciones.RecordCount of
0 : begin
FController.QuitarDireccion(FObra);
FController.CopiarDireccion(frViewClienteAsociadoObra1.Cliente, FObra);
AVerMensaje := True;
end;
1 : begin
FController.CopiarDireccion(frViewClienteAsociadoObra1.Cliente.Direcciones, FObra);
AVerMensaje := True;
end
else begin
ADireccion := AClientesController.ElegirDireccionEntrega(frViewClienteAsociadoObra1.Cliente.Direcciones, '');
@ -242,6 +245,10 @@ begin
finally
AClientesController := NIL;
end;
if AVerMensaje then
ShowInfoMessage('Dirección de la obra actualizada.', 'Se ha actualizado los datos de la dirección de la obra con los datos del cliente.');
end;
end;