Se cambia en el modulo todo lo relativo a empleado que viene de tecsitel, y se adapta a vendedor que es propio de acana, con ello se asigna un asuario a cada vendedor para que en el acceso se coja la tienda

git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@233 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
roberto 2008-05-23 14:55:02 +00:00
parent a83937e059
commit f930230d7b
58 changed files with 2165 additions and 5077 deletions

View File

@ -42,7 +42,7 @@
<Borland.Personality>Delphi.Personality</Borland.Personality> <Borland.Personality>Delphi.Personality</Borland.Personality>
<Borland.ProjectType>Package</Borland.ProjectType> <Borland.ProjectType>Package</Borland.ProjectType>
<BorlandProject> <BorlandProject>
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="ImplicitBuild">True</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">False</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Excluded_Packages> <BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="ImplicitBuild">False</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">False</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Excluded_Packages>
@ -59,34 +59,34 @@
<DelphiCompile Include="Contactos_controller.dpk"> <DelphiCompile Include="Contactos_controller.dpk">
<MainSource>MainSource</MainSource> <MainSource>MainSource</MainSource>
</DelphiCompile> </DelphiCompile>
<DCCReference Include="..\adortl.dcp" />
<DCCReference Include="..\ApplicationBase.dcp" />
<DCCReference Include="..\Base.dcp" />
<DCCReference Include="..\Contabilidad_controller.dcp" />
<DCCReference Include="..\Contactos_data.dcp" />
<DCCReference Include="..\Contactos_model.dcp" />
<DCCReference Include="..\cxLibraryD11.dcp" />
<DCCReference Include="..\DataAbstract_Core_D11.dcp" />
<DCCReference Include="..\dbrtl.dcp" />
<DCCReference Include="..\dsnap.dcp" />
<DCCReference Include="..\dxGDIPlusD11.dcp" />
<DCCReference Include="..\dxThemeD11.dcp" />
<DCCReference Include="..\GUIBase.dcp" />
<DCCReference Include="..\RemObjects_Core_D11.dcp" />
<DCCReference Include="..\rtl.dcp" />
<DCCReference Include="..\vcl.dcp" />
<DCCReference Include="..\vcldb.dcp" />
<DCCReference Include="uClientesController.pas" /> <DCCReference Include="uClientesController.pas" />
<DCCReference Include="uContactosController.pas" /> <DCCReference Include="uContactosController.pas" />
<DCCReference Include="uDireccionesContactoController.pas" /> <DCCReference Include="uDireccionesContactoController.pas" />
<DCCReference Include="uEmpleadosController.pas" />
<DCCReference Include="uEtiquetasContactosReportController.pas" /> <DCCReference Include="uEtiquetasContactosReportController.pas" />
<DCCReference Include="uFichasEmpleadoReportController.pas" />
<DCCReference Include="uGruposClienteController.pas" /> <DCCReference Include="uGruposClienteController.pas" />
<DCCReference Include="uGruposEmpleadoController.pas" />
<DCCReference Include="uGruposProveedorController.pas" /> <DCCReference Include="uGruposProveedorController.pas" />
<DCCReference Include="uProcedenciasClienteController.pas" /> <DCCReference Include="uProcedenciasClienteController.pas" />
<DCCReference Include="uProveedoresController.pas" /> <DCCReference Include="uProveedoresController.pas" />
<DCCReference Include="uVendedoresController.pas" />
<DCCReference Include="View\adortl.dcp" />
<DCCReference Include="View\ApplicationBase.dcp" />
<DCCReference Include="View\Base.dcp" />
<DCCReference Include="View\ccpackD11.dcp" />
<DCCReference Include="View\cfpack_d11.dcp" />
<DCCReference Include="View\Contabilidad_controller.dcp" />
<DCCReference Include="View\Contactos_data.dcp" />
<DCCReference Include="View\Contactos_model.dcp" />
<DCCReference Include="View\cxLibraryD11.dcp" />
<DCCReference Include="View\DataAbstract_Core_D11.dcp" />
<DCCReference Include="View\dbrtl.dcp" />
<DCCReference Include="View\designide.dcp" />
<DCCReference Include="View\dsnap.dcp" />
<DCCReference Include="View\dxGDIPlusD11.dcp" />
<DCCReference Include="View\dxThemeD11.dcp" />
<DCCReference Include="View\GUIBase.dcp" />
<DCCReference Include="View\GUISDK_D11.dcp" />
<DCCReference Include="View\RemObjects_Core_D11.dcp" />
<DCCReference Include="View\rtl.dcp" />
<DCCReference Include="View\uIEditorCliente.pas" /> <DCCReference Include="View\uIEditorCliente.pas" />
<DCCReference Include="View\uIEditorClientes.pas" /> <DCCReference Include="View\uIEditorClientes.pas" />
<DCCReference Include="View\uIEditorContacto.pas" /> <DCCReference Include="View\uIEditorContacto.pas" />
@ -95,16 +95,20 @@
<DCCReference Include="View\uIEditorElegirClientes.pas" /> <DCCReference Include="View\uIEditorElegirClientes.pas" />
<DCCReference Include="View\uIEditorElegirContactos.pas" /> <DCCReference Include="View\uIEditorElegirContactos.pas" />
<DCCReference Include="View\uIEditorElegirProveedores.pas" /> <DCCReference Include="View\uIEditorElegirProveedores.pas" />
<DCCReference Include="View\uIEditorEmpleado.pas" /> <DCCReference Include="View\uIEditorElegirVendedores.pas" />
<DCCReference Include="View\uIEditorEmpleados.pas" />
<DCCReference Include="View\uIEditorEtiquetasContactosPreview.pas" /> <DCCReference Include="View\uIEditorEtiquetasContactosPreview.pas" />
<DCCReference Include="View\uIEditorFichasEmpleadoPreview.pas" />
<DCCReference Include="View\uIEditorGruposCliente.pas" /> <DCCReference Include="View\uIEditorGruposCliente.pas" />
<DCCReference Include="View\uIEditorGruposEmpleado.pas" />
<DCCReference Include="View\uIEditorGruposProveedor.pas" /> <DCCReference Include="View\uIEditorGruposProveedor.pas" />
<DCCReference Include="View\uIEditorProcedenciasCliente.pas" /> <DCCReference Include="View\uIEditorProcedenciasCliente.pas" />
<DCCReference Include="View\uIEditorProveedor.pas" /> <DCCReference Include="View\uIEditorProveedor.pas" />
<DCCReference Include="View\uIEditorProveedores.pas" /> <DCCReference Include="View\uIEditorProveedores.pas" />
<DCCReference Include="View\uIEditorVendedor.pas" />
<DCCReference Include="View\uIEditorVendedores.pas" />
<DCCReference Include="View\vcl.dcp" />
<DCCReference Include="View\vclactnband.dcp" />
<DCCReference Include="View\vcldb.dcp" />
<DCCReference Include="View\vclx.dcp" />
<DCCReference Include="View\xmlrtl.dcp" />
<None Include="ModelSupport_Contactos_controller\default.txaPackage" /> <None Include="ModelSupport_Contactos_controller\default.txaPackage" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -0,0 +1,16 @@
unit uIEditorElegirVendedores;
interface
uses
uIEditorContactos, uIEditorElegirContactos, uBizContactos, uGUIBase;
type
IEditorElegirVendedores = interface(IEditorElegirContactos)
['{1CBDF31A-A9C5-43FB-B7D4-09148E0BD071}']
end;
implementation
end.

View File

@ -1,16 +0,0 @@
unit uIEditorFichasEmpleadoPreview;
interface
uses
uEditorPreview, uBizContactos, uFichasEmpleadoReportController;
type
IEditorFichasEmpleadoPreview = interface(IEditorPreview)
['{CED11B0E-2A7E-4CF2-A9CF-60A82BEEE9F2}']
end;
implementation
end.

View File

@ -1,23 +0,0 @@
unit uIEditorGruposEmpleado;
interface
uses
uEditorDBBase, uBizGruposEmpleado, uGruposEmpleadoController;
type
IEditorGruposEmpleado = interface(IEditorDBBase)
['{02981B41-9986-48D8-927C-A08A45168EDE}']
function GetGruposEmpleado: IBizGrupoEmpleado;
procedure SetGruposEmpleado(const Value: IBizGrupoEmpleado);
property GruposEmpleado: IBizGrupoEmpleado read GetGruposEmpleado write SetGruposEmpleado;
function GetController : IGruposEmpleadoController;
procedure SetController (const Value : IGruposEmpleadoController);
property Controller : IGruposEmpleadoController read GetController write SetController;
end;
implementation
end.

View File

@ -1,4 +1,4 @@
unit uIEditorEmpleado; unit uIEditorVendedor;
interface interface
@ -6,7 +6,7 @@ uses
uIEditorContacto; uIEditorContacto;
type type
IEditorEmpleado = interface(IEditorContacto) IEditorVendedor = interface(IEditorContacto)
['{DB41E4F5-1D48-4B13-8370-5D3FEB0586C0}'] ['{DB41E4F5-1D48-4B13-8370-5D3FEB0586C0}']
end; end;

View File

@ -1,4 +1,4 @@
unit uIEditorEmpleados; unit uIEditorVendedores;
interface interface
@ -6,7 +6,7 @@ uses
uIEditorContactos, uBizContactos, uGUIBase; uIEditorContactos, uBizContactos, uGUIBase;
type type
IEditorEmpleados = interface(IEditorContactos) IEditorVendedores = interface(IEditorContactos)
['{982A8AC8-5D43-4C91-9E46-35326CD65C2F}'] ['{982A8AC8-5D43-4C91-9E46-35326CD65C2F}']
end; end;

View File

@ -1,315 +0,0 @@
unit uEmpleadosController;
interface
uses
Classes, uCustomEditor,
uContactosController, uBizContactos,
uIEditorEmpleados, uIEditorEmpleado, uIDataModuleContactos, uIDataModuleEmpleados;
const
CTE_VENDEDOR = 'Vendedor';
type
IEmpleadosController = interface(IContactosController)
['{A3841871-7EF6-4847-9758-EA2B1C521D4A}']
function EsEliminable(AEmpleado: IBizContacto): Boolean;
function Eliminar(AEmpleado: IBizContacto; AllItems: Boolean = false): Boolean; overload;
procedure Preview(AEmpleado : IBizEmpleado; AllItems: Boolean = false);
procedure Print(AEmpleado : IBizEmpleado; AllItems: Boolean = false);
function BuscarVendedores: IBizContacto;
function DarListaVendedores : TStringList;
end;
TEmpleadosController = class(TContactosController, IEmpleadosController)
public
constructor Create; override;
function Duplicar(AContacto: IBizContacto): IBizContacto; override;
function Buscar(const ID: Integer): IBizContacto; override;
function BuscarTodos: IBizContacto; override;
function BuscarVendedores: IBizContacto;
function Nuevo : IBizContacto; override;
procedure Ver(AContacto : IBizContacto); override;
procedure VerTodos(AContactos: IBizContacto); override;
function DarListaVendedores : TStringList;
function Eliminar(AEmpleado: IBizContacto; AllItems: Boolean = false): Boolean; overload;
function EsEliminable(AEmpleado: IBizContacto): Boolean;
procedure Preview(AEmpleado : IBizEmpleado; AllItems: Boolean = false);
procedure Print(AEmpleado : IBizEmpleado; AllItems: Boolean = false);
end;
implementation
uses
Windows, SysUtils, cxControls, Dialogs, uDataModuleEmpleados, uEditorRegistryUtils,
uDataTableUtils, uDADataTable, DB, schContactosClient_Intf, uFichasEmpleadoReportController,
uEditorGridBase, uDAInterfaces;
{ TEmpleadoController }
function TEmpleadosController.Buscar(const ID: Integer): IBizContacto;
begin
Result := (FDataModule as IDataModuleEmpleados).GetItem(ID);
FiltrarEmpresa(Result);
end;
function TEmpleadosController.BuscarTodos: IBizContacto;
begin
Result := (FDataModule as IDataModuleEmpleados).GetItems;
FiltrarEmpresa(Result);
end;
function TEmpleadosController.BuscarVendedores: IBizContacto;
var
Condicion: TDAWhereExpression;
begin
ShowHourglassCursor;
try
Result := BuscarTodos;
// Filtrar los empleados que sean vendedores
with Result.DataTable.DynamicWhere do
begin
// (CATEGORIA <> 'VENDEDOR')
Condicion := NewBinaryExpression(NewField('', fld_EmpleadosCATEGORIA), NewConstant(CTE_VENDEDOR, datString), dboEqual);
if IsEmpty then
Expression := Condicion
else
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
end;
finally
HideHourglassCursor;
end;
end;
constructor TEmpleadosController.Create;
begin
inherited;
FDataModule := TDataModuleEmpleados.Create(Nil);
end;
function TEmpleadosController.DarListaVendedores: TStringList;
var
AVendedores: IBizContacto;
i : integer;
begin
AVendedores := BuscarVendedores;
AVendedores.DataTable.Active := True;
Result := TStringList.Create;
try
with Result do
begin
AVendedores.DataTable.First;
while not AVendedores.DataTable.EOF do
begin
Add(Format('%s=%d', [AVendedores.NOMBRE, AVendedores.ID]));
AVendedores.DataTable.Next;
end;
end;
finally
AVendedores := NIL;
end;
end;
function TEmpleadosController.Duplicar(AContacto: IBizContacto): IBizContacto;
begin
Result := inherited Duplicar(AContacto);
end;
function TEmpleadosController.Eliminar(AEmpleado: IBizContacto; AllItems: Boolean = false): Boolean;
//En el caso de eliminar almenos un elemento del conjunto se devuelve true
var
bEliminado: Boolean;
begin
Result := False;
if not Assigned(AEmpleado) then
raise Exception.Create ('Contacto no asignado');
ShowHourglassCursor;
try
if not AEmpleado.DataTable.Active then
AEmpleado.DataTable.Active := True;
if (AEmpleado.State in dsEditModes) then
AEmpleado.Cancel;
//Siempre eliminaremos el seleccionado
if EsEliminable(AEmpleado) then
begin
AEmpleado.Delete;
bEliminado := True;
end;
//En el caso de querer eliminar todos los items del objeto AEmpleado
if AllItems then
begin
with AEmpleado.DataTable do
begin
First;
while not EOF do
begin
if EsEliminable(AEmpleado) then
begin
AEmpleado.Delete;
bEliminado := True
end
else Next;
end;
end;
end;
if bEliminado then
begin
AEmpleado.DataTable.ApplyUpdates;
Result := True;
end
else
Result := False;
finally
HideHourglassCursor;
end;
end;
function TEmpleadosController.EsEliminable(AEmpleado: IBizContacto): Boolean;
begin
if not Assigned(AEmpleado) then
raise Exception.Create ('Contacto no asignado: EsEliminable');
Result := True;
end;
function TEmpleadosController.Nuevo: IBizContacto;
var
AContacto : IBizEmpleado;
begin
AContacto := (FDataModule as IDataModuleEmpleados).NewItem;
FiltrarEmpresa(AContacto);
AContacto.DataTable.Active := True;
AContacto.Insert;
Result := AContacto;
end;
procedure TEmpleadosController.Preview(AEmpleado: IBizEmpleado; AllItems: Boolean);
var
AReportController : IFichasEmpleadoReportController;
ID_Fichas: TStringList;
begin
AReportController := TFichasEmpleadoReportController.Create;
try
ID_Fichas := TStringList.Create;
//Si deseamos previsualizar todos los items del objeto albaran
if AllItems then
begin
with AEmpleado.DataTable do
begin
First;
while not EOF do
begin
ID_Fichas.Add(IntToStr(AEmpleado.ID));
Next;
end;
end;
end
//Solo previsualizamos el item seleccionado
else
ID_Fichas.Add(IntToStr(AEmpleado.ID));
AReportController.Preview(ID_Fichas.CommaText);
finally
AReportController := NIL;
ID_Fichas.Free;
end;
end;
procedure TEmpleadosController.Print(AEmpleado: IBizEmpleado; AllItems: Boolean);
var
AReportController : IFichasEmpleadoReportController;
ID_Fichas: TStringList;
begin
AReportController := TFichasEmpleadoReportController.Create;
try
ID_Fichas := TStringList.Create;
//Si deseamos previsualizar todos los items del objeto albaran
if AllItems then
begin
with AEmpleado.DataTable do
begin
First;
while not EOF do
begin
ID_Fichas.Add(IntToStr(AEmpleado.ID));
Next;
end;
end;
end
//Solo previsualizamos el item seleccionado
else
ID_Fichas.Add(IntToStr(AEmpleado.ID));
AReportController.Print(ID_Fichas.CommaText);
finally
AReportController := NIL;
ID_Fichas.Free;
end;
end;
procedure TEmpleadosController.Ver(AContacto: IBizContacto);
var
AEditor : IEditorEmpleado;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEmpleado', IEditorEmpleado, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Contacto := AContacto;
Controller := Self;
ShowModal;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
procedure TEmpleadosController.VerTodos(AContactos: IBizContacto);
var
AEditor : IEditorEmpleados;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorEmpleados', IEditorEmpleados, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Contactos := AContactos;
Controller := Self;
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
end.

View File

@ -4,7 +4,7 @@ interface
uses uses
Classes, SysUtils, uDADataTable, uControllerBase, uIDataModuleEtiquetasContactosReport, Classes, SysUtils, uDADataTable, uControllerBase, uIDataModuleEtiquetasContactosReport,
uEmpleadosController; uVendedoresController;
type type
IEtiquetasContactosReportController = interface IEtiquetasContactosReportController = interface

View File

@ -1,109 +0,0 @@
unit uFichasEmpleadoReportController;
interface
uses
Classes, SysUtils, uDADataTable, uControllerBase, uIDataModuleFichasEmpleadoReport,
uEmpleadosController;
type
IFichasEmpleadoReportController = interface
['{8E43F55F-7D5A-4778-8523-7C105EAEB1AB}']
procedure Preview(const AFichaID : String);
procedure Print(const AFichaID : String);
end;
TFichasEmpleadoReportController = class(TInterfacedObject, IFichasEmpleadoReportController)
private
FDataModule : IDataModuleFichasEmpleadoReport;
function CreateEditor(const AName: String; const IID: TGUID; out Intf): Boolean;
public
constructor Create;
destructor Destroy; override;
procedure Preview(const AFichaID : String);
procedure Print(const AFichaID : String);
end;
implementation
uses
uROTypes, uEditorRegistryUtils, uIEditorFichasEmpleadoPreview,
uEditorPreview, uDataModuleEmpleados, uEditorBase, cxControls;
{ TFichasEmpleadoReportController }
constructor TFichasEmpleadoReportController.Create;
begin
FDataModule := TDataModuleEmpleados.Create(Nil);
end;
function TFichasEmpleadoReportController.CreateEditor(const AName: String; const IID: TGUID; out Intf): Boolean;
begin
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
end;
destructor TFichasEmpleadoReportController.Destroy;
begin
FDataModule := NIL;
inherited;
end;
procedure TFichasEmpleadoReportController.Preview(const AFichaID : String);
var
AStream: Binary;
AEditor : IEditorFichasEmpleadoPreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AFichaID);
try
CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Preview;
Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end;
end;
procedure TFichasEmpleadoReportController.Print(const AFichaID : String);
var
AStream: Binary;
AEditor : IEditorFichasEmpleadoPreview;
begin
AEditor := NIL;
ShowHourglassCursor;
try
AStream := FDataModule.GetReport(AFichaID);
try
CreateEditor('EditorFichasEmpleadoPreview', IEditorFichasEmpleadoPreview, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
LoadFromStream(AStream);
Print;
Release;
end;
finally
FreeAndNil(AStream);
AEditor := Nil;
end;
finally
HideHourglassCursor;
end;
end;
end.

View File

@ -1,227 +0,0 @@
unit uGruposEmpleadoController;
interface
uses
Classes, SysUtils, uDADataTable, uControllerBase, uEditorDBItem,
uIDataModuleEmpleados, uBizGruposEmpleado;
type
IGruposEmpleadoController = interface(IObservador)
['{6820BA19-5E5E-459F-9001-FB4A712ACC4C}']
function BuscarTodos: IBizGrupoEmpleado;
procedure VerTodos(AGruposEmpleado: IBizGrupoEmpleado);
procedure Anadir(AGrupoEmpleado : IBizGrupoEmpleado);
function Eliminar(AGrupoEmpleado : IBizGrupoEmpleado): Boolean;
function Guardar(AGrupoEmpleado : IBizGrupoEmpleado): Boolean;
procedure DescartarCambios(AGrupoEmpleado : IBizGrupoEmpleado);
function Localizar(AGruposEmpleado: IBizGrupoEmpleado; ADescripcion:String): Boolean;
function DarListaGruposEmpleado: TStringList;
end;
TGruposEmpleadoController = class(TObservador, IGruposEmpleadoController)
protected
FDataModule : IDataModuleEmpleados;
procedure RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable); override;
function CreateEditor(const AName : String; const IID: TGUID; out Intf): Boolean;
function ValidarGrupoEmpleado(AGrupoEmpleado: IBizGrupoEmpleado): Boolean;
procedure AsignarDataModule; virtual;
public
constructor Create; override;
destructor Destroy; override;
function Eliminar(AGrupoEmpleado : IBizGrupoEmpleado): Boolean;
function Guardar(AGrupoEmpleado : IBizGrupoEmpleado): Boolean;
procedure DescartarCambios(AGrupoEmpleado : IBizGrupoEmpleado); virtual;
procedure Anadir(AGrupoEmpleado : IBizGrupoEmpleado);
function BuscarTodos: IBizGrupoEmpleado;
procedure VerTodos(AGruposEmpleado: IBizGrupoEmpleado);
function Localizar(AGruposEmpleado: IBizGrupoEmpleado; ADescripcion:String): Boolean;
function DarListaGruposEmpleado: TStringList;
end;
implementation
uses
cxControls, DB, uEditorRegistryUtils,
uIEditorGruposEmpleado, uDataModuleEmpleados,
uDAInterfaces, uDataTableUtils,
uDateUtils, uROTypes, DateUtils, Controls, Windows, schContactosClient_Intf;
{ TGruposEmpleadoController }
procedure TGruposEmpleadoController.Anadir(AGrupoEmpleado: IBizGrupoEmpleado);
begin
AGrupoEmpleado.Insert;
end;
procedure TGruposEmpleadoController.AsignarDataModule;
begin
FDataModule := TDataModuleEmpleados.Create(Nil);
end;
function TGruposEmpleadoController.BuscarTodos: IBizGrupoEmpleado;
begin
Result := FDataModule.GetGruposEmpleado;
end;
constructor TGruposEmpleadoController.Create;
begin
inherited;
AsignarDataModule;
end;
function TGruposEmpleadoController.CreateEditor(const AName: String; const IID: TGUID; out Intf): Boolean;
begin
Result := Supports(EditorRegistry.CreateEditor(AName), IID, Intf);
end;
function TGruposEmpleadoController.DarListaGruposEmpleado: TStringList;
var
AGruposEmpleado: IBizGrupoEmpleado;
begin
AGruposEmpleado := BuscarTodos;
AGruposEmpleado.DataTable.Active := True;
Result := TStringList.Create;
try
with Result do
begin
AGruposEmpleado.DataTable.First;
while not AGruposEmpleado.DataTable.EOF do
begin
Add(AGruposEmpleado.DESCRIPCION);
AGruposEmpleado.DataTable.Next;
end;
end;
finally
AGruposEmpleado := NIL;
end;
end;
procedure TGruposEmpleadoController.DescartarCambios(AGrupoEmpleado: IBizGrupoEmpleado);
begin
if not Assigned(AGrupoEmpleado) then
raise Exception.Create ('GrupoEmpleado no asignado');
ShowHourglassCursor;
try
if (AGrupoEmpleado.State in dsEditModes) then
AGrupoEmpleado.Cancel;
AGrupoEmpleado.DataTable.CancelUpdates;
finally
HideHourglassCursor;
end;
end;
destructor TGruposEmpleadoController.Destroy;
begin
FDataModule := Nil;
inherited;
end;
function TGruposEmpleadoController.ValidarGrupoEmpleado(AGrupoEmpleado: IBizGrupoEmpleado): Boolean;
begin
Result := False;
if not Assigned(AGrupoEmpleado) then
raise Exception.Create ('GrupoEmpleado no asignada');
if (AGrupoEmpleado.DataTable.State in dsEditModes) then
AGrupoEmpleado.DataTable.Post;
if Length(AGrupoEmpleado.DESCRIPCION) = 0 then
raise Exception.Create('Debe indicar al menos la descripción de este grupo.');
Result := True;
end;
procedure TGruposEmpleadoController.VerTodos(AGruposEmpleado: IBizGrupoEmpleado);
var
AEditor : IEditorGruposEmpleado;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorGruposEmpleado', IEditorGruposEmpleado, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Controller := Self; //OJO ORDEN MUY IMPORTANTE
GruposEmpleado := AGruposEmpleado;
ShowModal;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
function TGruposEmpleadoController.Eliminar(AGrupoEmpleado: IBizGrupoEmpleado): Boolean;
begin
Result := False;
if not Assigned(AGrupoEmpleado) then
raise Exception.Create ('GrupoEmpleado no asignada');
ShowHourglassCursor;
try
if (AGrupoEmpleado.State in dsEditModes) then
AGrupoEmpleado.Cancel;
AGrupoEmpleado.Delete;
AGrupoEmpleado.DataTable.ApplyUpdates;
HideHourglassCursor;
Result := True;
finally
HideHourglassCursor;
end;
end;
procedure TGruposEmpleadoController.RecibirAviso(ASujeto: ISujeto; ADataTable: IDAStronglyTypedDataTable);
begin
inherited;
//
end;
function TGruposEmpleadoController.Guardar(AGrupoEmpleado: IBizGrupoEmpleado): Boolean;
begin
Result := False;
if ValidarGrupoEmpleado(AGrupoEmpleado) then
begin
ShowHourglassCursor;
try
if (AGrupoEmpleado.DataTable.State in dsEditModes) then
AGrupoEmpleado.DataTable.Post;
AGrupoEmpleado.DataTable.ApplyUpdates;
Result := True;
finally
HideHourglassCursor;
end;
end;
end;
function TGruposEmpleadoController.Localizar(AGruposEmpleado: IBizGrupoEmpleado; ADescripcion: String): Boolean;
begin
Result := True;
ShowHourglassCursor;
try
with AGruposEmpleado.DataTable do
begin
DisableControls;
First;
if not Locate(fld_GruposEmpleadoDESCRIPCION, ADescripcion, []) then
Result := False;
EnableControls;
end;
finally
HideHourglassCursor;
end;
end;
end.

View File

@ -0,0 +1,279 @@
unit uVendedoresController;
interface
uses
Classes, uCustomEditor,
uContactosController, uBizContactos,
uIEditorVendedores, uIEditorVendedor, uIDataModuleContactos, uIDataModuleVendedores;
const
CTE_VENDEDOR = 'Vendedor';
type
IVendedoresController = interface(IContactosController)
['{A3841871-7EF6-4847-9758-EA2B1C521D4A}']
function EsEliminable(AVendedor: IBizContacto): Boolean;
function Eliminar(AVendedor: IBizContacto; AllItems: Boolean = false): Boolean; overload;
function DarListaVendedores : TStringList;
function BuscarTodos: IBizContacto; overload;
function BuscarTodos(const CadenaIDs: String): IBizContacto; overload;
end;
TVendedoresController = class(TContactosController, IVendedoresController)
public
constructor Create; override;
function Duplicar(AContacto: IBizContacto): IBizContacto; override;
function Buscar(const ID: Integer): IBizContacto; override;
function BuscarTodos: IBizContacto; overload; override;
function BuscarTodos(const CadenaIDs: String): IBizContacto; overload;
function Nuevo : IBizContacto; override;
procedure Ver(AContacto : IBizContacto); override;
procedure VerTodos(AContactos: IBizContacto); override;
function ElegirContacto(AContactos : IBizContacto;
AMensaje: String; AMultiSelect: Boolean): IBizContacto; override;
function DarListaVendedores : TStringList;
function Eliminar(AVendedor: IBizContacto; AllItems: Boolean = false): Boolean; overload;
function EsEliminable(AVendedor: IBizContacto): Boolean;
end;
implementation
uses
Windows, SysUtils, Controls, cxControls, Dialogs, uDataModuleVendedores, uEditorRegistryUtils,
uDataTableUtils, uDADataTable, DB, schContactosClient_Intf,
uEditorGridBase, uDAInterfaces, uIEditorElegirVendedores;
{ TVendedorController }
function TVendedoresController.Buscar(const ID: Integer): IBizContacto;
begin
Result := (FDataModule as IDataModuleVendedores).GetItem(ID);
FiltrarEmpresa(Result);
end;
function TVendedoresController.BuscarTodos: IBizContacto;
begin
Result := (FDataModule as IDataModuleVendedores).GetItems;
FiltrarEmpresa(Result);
end;
function TVendedoresController.BuscarTodos(const CadenaIDs: String): IBizContacto;
var
Cadena : TStringList;
Condicion: TDAWhereExpression;
i: Integer;
begin
ShowHourglassCursor;
try
Result := BuscarTodos;
if (Length(CadenaIDs) > 0) then
begin
Cadena := TStringList.Create;
Cadena.CommaText := CadenaIDs;
//Vamos generando todas las where de cada uno de los ID recibidos
for i := 0 to Cadena.Count - 1 do
with Result.DataTable.DynamicWhere do
begin
//Todas aquellos vendedores que no esten asociados a la liquidación actual
Condicion := NewBinaryExpression(NewField('', fld_VendedoresID), NewConstant(StrToInt(Cadena.Strings[i]), datInteger), dboNotEqual);
if IsEmpty then
Expression := Condicion
else
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
end;
Cadena.Free;
end;
finally
HideHourglassCursor;
end;
end;
constructor TVendedoresController.Create;
begin
inherited;
FDataModule := TDataModuleVendedores.Create(Nil);
end;
function TVendedoresController.DarListaVendedores: TStringList;
var
AVendedores: IBizContacto;
i : integer;
begin
AVendedores := BuscarTodos;
AVendedores.DataTable.Active := True;
Result := TStringList.Create;
try
with Result do
begin
AVendedores.DataTable.First;
while not AVendedores.DataTable.EOF do
begin
Add(Format('%s=%d', [AVendedores.NOMBRE, AVendedores.ID]));
AVendedores.DataTable.Next;
end;
end;
finally
AVendedores := NIL;
end;
end;
function TVendedoresController.Duplicar(AContacto: IBizContacto): IBizContacto;
begin
Result := inherited Duplicar(AContacto);
end;
function TVendedoresController.ElegirContacto(AContactos: IBizContacto;
AMensaje: String; AMultiSelect: Boolean): IBizContacto;
var
AEditor : IEditorElegirVendedores;
begin
Result := NIL;
CreateEditor('EditorElegirVendedores', IEditorElegirVendedores, AEditor);
try
with AEditor do
begin
Contactos := AContactos;
Controller := Self;
MultiSelect := AMultiSelect;
Mensaje := AMensaje;
if IsPositiveResult(ShowModal) then
Result := ContactosSeleccionados;
Release;
end;
finally
AEditor := NIL;
end;
end;
function TVendedoresController.Eliminar(AVendedor: IBizContacto; AllItems: Boolean = false): Boolean;
//En el caso de eliminar almenos un elemento del conjunto se devuelve true
var
bEliminado: Boolean;
begin
Result := False;
if not Assigned(AVendedor) then
raise Exception.Create ('Contacto no asignado');
ShowHourglassCursor;
try
if not AVendedor.DataTable.Active then
AVendedor.DataTable.Active := True;
if (AVendedor.State in dsEditModes) then
AVendedor.Cancel;
//Siempre eliminaremos el seleccionado
if EsEliminable(AVendedor) then
begin
AVendedor.Delete;
bEliminado := True;
end;
//En el caso de querer eliminar todos los items del objeto AVendedor
if AllItems then
begin
with AVendedor.DataTable do
begin
First;
while not EOF do
begin
if EsEliminable(AVendedor) then
begin
AVendedor.Delete;
bEliminado := True
end
else Next;
end;
end;
end;
if bEliminado then
begin
AVendedor.DataTable.ApplyUpdates;
Result := True;
end
else
Result := False;
finally
HideHourglassCursor;
end;
end;
function TVendedoresController.EsEliminable(AVendedor: IBizContacto): Boolean;
begin
if not Assigned(AVendedor) then
raise Exception.Create ('Contacto no asignado: EsEliminable');
Result := True;
end;
function TVendedoresController.Nuevo: IBizContacto;
var
AContacto : IBizVendedor;
begin
AContacto := (FDataModule as IDataModuleVendedores).NewItem;
FiltrarEmpresa(AContacto);
AContacto.DataTable.Active := True;
AContacto.Insert;
Result := AContacto;
end;
procedure TVendedoresController.Ver(AContacto: IBizContacto);
var
AEditor : IEditorVendedor;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorVendedor', IEditorVendedor, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Contacto := AContacto;
Controller := Self;
ShowModal;
Release;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
procedure TVendedoresController.VerTodos(AContactos: IBizContacto);
var
AEditor : IEditorVendedores;
begin
AEditor := NIL;
ShowHourglassCursor;
try
CreateEditor('EditorVendedores', IEditorVendedores, AEditor);
if Assigned(AEditor) then
with AEditor do
begin
Contactos := AContactos;
Controller := Self;
MultiSelect := True;
ShowEmbedded;
end;
finally
AEditor := NIL;
HideHourglassCursor;
end;
end;
end.

View File

@ -49,12 +49,11 @@
<DelphiCompile Include="Contactos_data.dpk"> <DelphiCompile Include="Contactos_data.dpk">
<MainSource>MainSource</MainSource> <MainSource>MainSource</MainSource>
</DelphiCompile> </DelphiCompile>
<DCCReference Include="..\ApplicationBase.dcp" /> <DCCReference Include="ApplicationBase.dcp" />
<DCCReference Include="..\Base.dcp" /> <DCCReference Include="Base.dcp" />
<DCCReference Include="..\Contactos_model.dcp" /> <DCCReference Include="Contactos_model.dcp" />
<DCCReference Include="..\GUIBase.dcp" /> <DCCReference Include="GUIBase.dcp" />
<DCCReference Include="..\rtl.dcp" /> <DCCReference Include="rtl.dcp" />
<DCCReference Include="..\vcl.dcp" />
<DCCReference Include="uDataModuleClientes.pas"> <DCCReference Include="uDataModuleClientes.pas">
<Form>DataModuleClientes</Form> <Form>DataModuleClientes</Form>
<DesignClass>TDAClientDataModule</DesignClass> <DesignClass>TDAClientDataModule</DesignClass>
@ -63,14 +62,15 @@
<Form>DataModuleContactos</Form> <Form>DataModuleContactos</Form>
<DesignClass>TDAClientDataModule</DesignClass> <DesignClass>TDAClientDataModule</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uDataModuleEmpleados.pas">
<Form>DataModuleEmpleados</Form>
<DesignClass>TDAClientDataModule</DesignClass>
</DCCReference>
<DCCReference Include="uDataModuleProveedores.pas"> <DCCReference Include="uDataModuleProveedores.pas">
<Form>DataModuleProveedores</Form> <Form>DataModuleProveedores</Form>
<DesignClass>TDAClientDataModule</DesignClass> <DesignClass>TDAClientDataModule</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uDataModuleVendedores.pas">
<Form>DataModuleVendedores</Form>
<DesignClass>TDAClientDataModule</DesignClass>
</DCCReference>
<DCCReference Include="vcl.dcp" />
<None Include="ModelSupport_Contactos_data\default.txaPackage" /> <None Include="ModelSupport_Contactos_data\default.txaPackage" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -111,7 +111,7 @@ begin
case IDCategoria of case IDCategoria of
CATEGORIA_CLIENTE : BusinessRulesID := BIZ_CLIENT_CLIENTE; CATEGORIA_CLIENTE : BusinessRulesID := BIZ_CLIENT_CLIENTE;
CATEGORIA_PROVEEDOR : BusinessRulesID := BIZ_CLIENT_PROVEEDOR; CATEGORIA_PROVEEDOR : BusinessRulesID := BIZ_CLIENT_PROVEEDOR;
CATEGORIA_EMPLEADO : BusinessRulesID := BIZ_CLIENT_EMPLEADO; CATEGORIA_VENDEDOR : BusinessRulesID := BIZ_CLIENT_VENDEDOR;
end; end;
with TBizContacto(AContacto.BusinessEventsObj) do with TBizContacto(AContacto.BusinessEventsObj) do

View File

@ -1,109 +0,0 @@
unit uDataModuleEmpleados;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uDataModuleContactos, DB, uDADataTable, uDAScriptingProvider,
uDACDSDataTable, uDABINAdapter, uROServiceComponent, uRORemoteService,
uROClient, uROBinMessage, uROWinInetHttpChannel, uBizGruposEmpleado, uROTypes,
uIDataModuleEmpleados, uBizContactos, uDADesigntimeCall, uIDataModuleFichasEmpleadoReport,
uDAInterfaces, uDAMemDataTable, uDADataStreamer, uDABin2DataStreamer,
uDARemoteDataAdapter;
type
TDataModuleEmpleados = class(TDataModuleContactos, IDataModuleEmpleados, IDataModuleFichasEmpleadoReport)
tbl_Empleados: TDAMemDataTable;
ds_Empleados: TDADataSource;
tbl_GruposEmpleado: TDAMemDataTable;
ds_GruposEmpleado: TDADataSource;
protected
public
function GetItem(const ID : Integer) : IBizEmpleado;
function NewItem : IBizEmpleado;
function GetItems : IBizEmpleado;
function GetGruposEmpleado : IBizGrupoEmpleado;
// Report
function GetReport(const AFichaID: String): Binary;
end;
implementation
{$R *.dfm}
uses
FactuGES_Intf, cxControls, schContactosClient_Intf, uDataTableUtils;
{ TDataModuleVendedores }
function TDataModuleEmpleados.GetGruposEmpleado: IBizGrupoEmpleado;
var
AGrupoEmpleado : TDAMemDataTable;
begin
ShowHourglassCursor;
try
AGrupoEmpleado := CloneDataTable(tbl_GruposEmpleado);
AGrupoEmpleado.BusinessRulesID := BIZ_CLIENT_GRUPOSEMPLEADO;
Result := (AGrupoEmpleado as IBizGrupoEmpleado);
finally
HideHourglassCursor;
end;
end;
function TDataModuleEmpleados.GetItem(const ID: Integer): IBizEmpleado;
var
Condicion: TDAWhereExpression;
begin
ShowHourglassCursor;
try
Result := Self.GetItems;
with Result.DataTable.DynamicWhere do
begin
// (ID = :ID)
Condicion := NewBinaryExpression(NewField('', fld_ContactosID), NewConstant(ID, datInteger), dboEqual);
if IsEmpty then
Expression := Condicion
else
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
end;
finally
HideHourglassCursor;
end;
end;
function TDataModuleEmpleados.GetItems: IBizEmpleado;
var
AContacto : TDAMemDataTable;
begin
ShowHourglassCursor;
try
AContacto := CloneDataTable(tbl_Empleados);
AContacto.BusinessRulesID := BIZ_CLIENT_EMPLEADO;
with TBizEmpleado(AContacto.BusinessEventsObj) do
begin
DatosBancarios := _GetDatosBancarios;
end;
Result := (AContacto as IBizEmpleado);
finally
HideHourglassCursor;
end;
end;
function TDataModuleEmpleados.GetReport(const AFichaID: String): Binary;
begin
Result := (RORemoteService as IsrvContactos).GenerateFichaEmpleadoReport(AFichaID);
end;
function TDataModuleEmpleados.NewItem: IBizEmpleado;
begin
Result := GetItem(ID_NULO)
end;
end.

View File

@ -1,4 +1,4 @@
inherited DataModuleEmpleados: TDataModuleEmpleados inherited DataModuleVendedores: TDataModuleVendedores
inherited ds_Contactos: TDADataSource inherited ds_Contactos: TDADataSource
DataSet = tbl_Contactos.Dataset DataSet = tbl_Contactos.Dataset
end end
@ -8,7 +8,7 @@ inherited DataModuleEmpleados: TDataModuleEmpleados
inherited ds_DatosBancarios: TDADataSource inherited ds_DatosBancarios: TDADataSource
DataSet = tbl_DatosBancarios.Dataset DataSet = tbl_DatosBancarios.Dataset
end end
object tbl_Empleados: TDAMemDataTable object tbl_Vendedores: TDAMemDataTable
RemoteUpdatesOptions = [] RemoteUpdatesOptions = []
Fields = < Fields = <
item item
@ -50,14 +50,14 @@ inherited DataModuleEmpleados: TDataModuleEmpleados
Name = 'CALLE' Name = 'CALLE'
DataType = datString DataType = datString
Size = 255 Size = 255
DisplayLabel = 'Direcci'#243'n' DisplayLabel = 'Direcci'#195#179'n'
DictionaryEntry = 'Contactos_CALLE' DictionaryEntry = 'Contactos_CALLE'
end end
item item
Name = 'POBLACION' Name = 'POBLACION'
DataType = datString DataType = datString
Size = 255 Size = 255
DisplayLabel = 'Poblaci'#243'n' DisplayLabel = 'Poblaci'#195#179'n'
DictionaryEntry = 'Contactos_POBLACION' DictionaryEntry = 'Contactos_POBLACION'
end end
item item
@ -71,7 +71,7 @@ inherited DataModuleEmpleados: TDataModuleEmpleados
Name = 'CODIGO_POSTAL' Name = 'CODIGO_POSTAL'
DataType = datString DataType = datString
Size = 10 Size = 10
DisplayLabel = 'C'#243'digo postal' DisplayLabel = 'C'#195#179'digo postal'
DictionaryEntry = 'Contactos_CODIGO_POSTAL' DictionaryEntry = 'Contactos_CODIGO_POSTAL'
end end
item item
@ -92,7 +92,7 @@ inherited DataModuleEmpleados: TDataModuleEmpleados
Name = 'MOVIL_1' Name = 'MOVIL_1'
DataType = datString DataType = datString
Size = 25 Size = 25
DisplayLabel = 'M'#243'vil' DisplayLabel = 'M'#195#179'vil'
DictionaryEntry = 'Contactos_MOVIL_1' DictionaryEntry = 'Contactos_MOVIL_1'
end end
item item
@ -178,47 +178,8 @@ inherited DataModuleEmpleados: TDataModuleEmpleados
DictionaryEntry = 'Contactos_TIENDA' DictionaryEntry = 'Contactos_TIENDA'
end end
item item
Name = 'FECHA_NACIMIENTO' Name = 'COMISION'
DataType = datDateTime DataType = datFloat
DisplayLabel = 'Fecha nacimiento'
DictionaryEntry = 'Empleados_FECHA_NACIMIENTO'
end
item
Name = 'CATEGORIA'
DataType = datString
Size = 255
DisplayLabel = 'Categor'#237'a'
DictionaryEntry = 'Empleados_CATEGORIA'
end
item
Name = 'FECHA_ALTA_EMPRESA'
DataType = datDateTime
DisplayLabel = 'Fecha de alta'
DictionaryEntry = 'Empleados_FECHA_ALTA_EMPRESA'
end
item
Name = 'FORMACION_BASE'
DataType = datMemo
DisplayLabel = 'Formaci'#243'n base'
DictionaryEntry = 'Empleados_FORMACION_BASE'
end
item
Name = 'FORMACION_COMPLE'
DataType = datMemo
DisplayLabel = 'Formaci'#243'n complementaria'
DictionaryEntry = 'Empleados_FORMACION_COMPLE'
end
item
Name = 'FORMACION_RECIBIDA'
DataType = datMemo
DisplayLabel = 'Formaci'#243'n recibida'
DictionaryEntry = 'Empleados_FORMACION_RECIBIDA'
end
item
Name = 'EXPERIENCIA'
DataType = datMemo
DisplayLabel = 'Experiencia'
DictionaryEntry = 'Empleados_EXPERIENCIA'
end end
item item
Name = 'ID_USUARIO' Name = 'ID_USUARIO'
@ -227,53 +188,17 @@ inherited DataModuleEmpleados: TDataModuleEmpleados
Params = <> Params = <>
StreamingOptions = [soDisableEventsWhileStreaming] StreamingOptions = [soDisableEventsWhileStreaming]
RemoteDataAdapter = rda_Contactos RemoteDataAdapter = rda_Contactos
LocalDataStreamer = Bin2DataStreamer
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'Empleados' LogicalName = 'Vendedores'
IndexDefs = <> IndexDefs = <>
Left = 296 Left = 392
Top = 168 Top = 208
end end
object ds_Empleados: TDADataSource object ds_Vendedores: TDADataSource
DataSet = tbl_Empleados.Dataset DataSet = tbl_Vendedores.Dataset
DataTable = tbl_Empleados DataTable = tbl_Vendedores
Left = 296 Left = 392
Top = 232 Top = 152
end
object tbl_GruposEmpleado: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID'
DataType = datAutoInc
GeneratorName = 'GEN_EMPLEADOS_GRUPOS_ID'
Required = True
DictionaryEntry = 'GruposEmpleado_ID'
InPrimaryKey = True
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 255
DisplayLabel = 'Descripci'#243'n'
DictionaryEntry = 'GruposEmpleado_DESCRIPCION'
end>
Params = <>
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteDataAdapter = rda_Contactos
LocalDataStreamer = Bin2DataStreamer
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'GruposEmpleado'
IndexDefs = <>
Left = 448
Top = 168
end
object ds_GruposEmpleado: TDADataSource
DataSet = tbl_GruposEmpleado.Dataset
DataTable = tbl_GruposEmpleado
Left = 448
Top = 232
end end
end end

View File

@ -0,0 +1,83 @@
unit uDataModuleVendedores;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uDataModuleContactos, DB, uDADataTable, uDAScriptingProvider,
uDACDSDataTable, uDABINAdapter, uROServiceComponent, uRORemoteService,
uROClient, uROBinMessage, uROWinInetHttpChannel, uROTypes,
uIDataModuleVendedores, uBizContactos, uDADesigntimeCall,
uDAInterfaces, uDAMemDataTable, uDADataStreamer, uDABin2DataStreamer,
uDARemoteDataAdapter;
type
TDataModuleVendedores = class(TDataModuleContactos, IDataModuleVendedores)
tbl_Vendedores: TDAMemDataTable;
ds_Vendedores: TDADataSource;
public
function GetItem(const ID : Integer) : IBizVendedor;
function NewItem : IBizVendedor;
function GetItems : IBizVendedor;
end;
implementation
{$R *.dfm}
uses
FactuGES_Intf, cxControls, schContactosClient_Intf, uDataTableUtils;
{ TDataModuleVendedores }
function TDataModuleVendedores.GetItem(const ID: Integer): IBizVendedor;
var
Condicion: TDAWhereExpression;
begin
ShowHourglassCursor;
try
Result := Self.GetItems;
with Result.DataTable.DynamicWhere do
begin
// (ID = :ID)
Condicion := NewBinaryExpression(NewField('', fld_ContactosID), NewConstant(ID, datInteger), dboEqual);
if IsEmpty then
Expression := Condicion
else
Expression := NewBinaryExpression(Expression, Condicion, dboAnd);
end;
finally
HideHourglassCursor;
end;
end;
function TDataModuleVendedores.GetItems: IBizVendedor;
var
AContacto : TDAMemDataTable;
begin
ShowHourglassCursor;
try
AContacto := CloneDataTable(tbl_Vendedores);
AContacto.BusinessRulesID := BIZ_CLIENT_VENDEDOR;
with TBizVendedor(AContacto.BusinessEventsObj) do
begin
DatosBancarios := _GetDatosBancarios;
end;
Result := (AContacto as IBizVendedor);
finally
HideHourglassCursor;
end;
end;
function TDataModuleVendedores.NewItem: IBizVendedor;
begin
Result := GetItem(ID_NULO)
end;
end.

View File

@ -42,7 +42,7 @@
<Borland.Personality>Delphi.Personality</Borland.Personality> <Borland.Personality>Delphi.Personality</Borland.Personality>
<Borland.ProjectType>Package</Borland.ProjectType> <Borland.ProjectType>Package</Borland.ProjectType>
<BorlandProject> <BorlandProject>
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="ImplicitBuild">True</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">False</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">Contactos_model.dpk</Source></Source></Delphi.Personality></BorlandProject></BorlandProject> <BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="ImplicitBuild">False</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">False</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">Contactos_model.dpk</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
</ProjectExtensions> </ProjectExtensions>
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" /> <Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
<ItemGroup> <ItemGroup>
@ -50,21 +50,22 @@
<MainSource>MainSource</MainSource> <MainSource>MainSource</MainSource>
</DelphiCompile> </DelphiCompile>
<DCCReference Include="..\Utiles\uRegimenIVAUtils.pas" /> <DCCReference Include="..\Utiles\uRegimenIVAUtils.pas" />
<DCCReference Include="adortl.dcp" /> <DCCReference Include="Data\adortl.dcp" />
<DCCReference Include="ApplicationBase.dcp" /> <DCCReference Include="Data\ApplicationBase.dcp" />
<DCCReference Include="Base.dcp" /> <DCCReference Include="Data\Base.dcp" />
<DCCReference Include="DataAbstract_Core_D11.dcp" /> <DCCReference Include="Data\DataAbstract_Core_D11.dcp" />
<DCCReference Include="Data\dbrtl.dcp" />
<DCCReference Include="Data\dsnap.dcp" />
<DCCReference Include="Data\GUIBase.dcp" />
<DCCReference Include="Data\RemObjects_Core_D11.dcp" />
<DCCReference Include="Data\rtl.dcp" />
<DCCReference Include="Data\uIDataModuleClientes.pas" /> <DCCReference Include="Data\uIDataModuleClientes.pas" />
<DCCReference Include="Data\uIDataModuleContactos.pas" /> <DCCReference Include="Data\uIDataModuleContactos.pas" />
<DCCReference Include="Data\uIDataModuleEmpleados.pas" />
<DCCReference Include="Data\uIDataModuleEtiquetasContactosReport.pas" /> <DCCReference Include="Data\uIDataModuleEtiquetasContactosReport.pas" />
<DCCReference Include="Data\uIDataModuleFichasEmpleadoReport.pas" />
<DCCReference Include="Data\uIDataModuleProveedores.pas" /> <DCCReference Include="Data\uIDataModuleProveedores.pas" />
<DCCReference Include="dbrtl.dcp" /> <DCCReference Include="Data\uIDataModuleVendedores.pas" />
<DCCReference Include="dsnap.dcp" /> <DCCReference Include="Data\vcl.dcp" />
<DCCReference Include="GUIBase.dcp" /> <DCCReference Include="Data\vcldb.dcp" />
<DCCReference Include="RemObjects_Core_D11.dcp" />
<DCCReference Include="rtl.dcp" />
<DCCReference Include="schContactosClient_Intf.pas" /> <DCCReference Include="schContactosClient_Intf.pas" />
<DCCReference Include="schContactosServer_Intf.pas" /> <DCCReference Include="schContactosServer_Intf.pas" />
<DCCReference Include="uBizClientesDescuentos.pas" /> <DCCReference Include="uBizClientesDescuentos.pas" />
@ -72,12 +73,9 @@
<DCCReference Include="uBizContactosDatosBancarios.pas" /> <DCCReference Include="uBizContactosDatosBancarios.pas" />
<DCCReference Include="uBizDireccionesContacto.pas" /> <DCCReference Include="uBizDireccionesContacto.pas" />
<DCCReference Include="uBizGruposCliente.pas" /> <DCCReference Include="uBizGruposCliente.pas" />
<DCCReference Include="uBizGruposEmpleado.pas" />
<DCCReference Include="uBizGruposProveedor.pas" /> <DCCReference Include="uBizGruposProveedor.pas" />
<DCCReference Include="uBizProcedenciasCliente.pas" /> <DCCReference Include="uBizProcedenciasCliente.pas" />
<DCCReference Include="uBizSubCuentasContacto.pas" /> <DCCReference Include="uBizSubCuentasContacto.pas" />
<DCCReference Include="vcl.dcp" />
<DCCReference Include="vcldb.dcp" />
</ItemGroup> </ItemGroup>
</Project> </Project>
<!-- EurekaLog First Line <!-- EurekaLog First Line

View File

@ -1,20 +0,0 @@
unit uIDataModuleEmpleados;
interface
uses
uBizContactos, uIDataModuleContactos, uBizGruposEmpleado;
type
IDataModuleEmpleados = interface(IDataModuleContactos)
['{42FF228B-C69F-4D45-9E86-A8135D0DB981}']
function GetItem(const ID : Integer) : IBizEmpleado;
function NewItem : IBizEmpleado;
function GetItems : IBizEmpleado;
function GetGruposEmpleado : IBizGrupoEmpleado;
end;
implementation
end.

View File

@ -1,16 +0,0 @@
unit uIDataModuleFichasEmpleadoReport;
interface
uses
SysUtils, Classes, uROTypes;
type
IDataModuleFichasEmpleadoReport = interface
['{45EEB949-2AC0-459F-88B0-235444B005E4}']
function GetReport(const AFichaID: String): Binary;
end;
implementation
end.

View File

@ -0,0 +1,19 @@
unit uIDataModuleVendedores;
interface
uses
uBizContactos, uIDataModuleContactos;
type
IDataModuleVendedores = interface(IDataModuleContactos)
['{42FF228B-C69F-4D45-9E86-A8135D0DB981}']
function GetItem(const ID : Integer) : IBizVendedor;
function NewItem : IBizVendedor;
function GetItems : IBizVendedor;
end;
implementation
end.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -191,7 +191,6 @@ var
idCliente: integer; idCliente: integer;
idTienda: integer; idTienda: integer;
idEmpresa: integer; idEmpresa: integer;
NombreComercial: string;
begin begin
inherited; inherited;

View File

@ -11,11 +11,12 @@ const
BIZ_CLIENT_CONTACTO = 'Client.Contacto'; BIZ_CLIENT_CONTACTO = 'Client.Contacto';
BIZ_CLIENT_CLIENTE = 'Client.Cliente'; BIZ_CLIENT_CLIENTE = 'Client.Cliente';
BIZ_CLIENT_PROVEEDOR = 'Client.Proveedor'; BIZ_CLIENT_PROVEEDOR = 'Client.Proveedor';
BIZ_CLIENT_EMPLEADO = 'Client.Empleado'; BIZ_CLIENT_VENDEDOR = 'Client.Vendedor';
CATEGORIA_CLIENTE = 1; CATEGORIA_CLIENTE = 1;
CATEGORIA_PROVEEDOR = 2; CATEGORIA_PROVEEDOR = 2;
CATEGORIA_EMPLEADO = 3; CATEGORIA_VENDEDOR = 3;
CATEGORIA_INSTALADOR = 4;
PROVEEDOR_REGIMEN_IVA = 'General'; PROVEEDOR_REGIMEN_IVA = 'General';
CLIENTE_REGIMEN_IVA = 'General'; CLIENTE_REGIMEN_IVA = 'General';
@ -170,38 +171,17 @@ type
property ES_ACREEDOR: Integer read GetEs_Acreedor write SetEs_Acreedor; property ES_ACREEDOR: Integer read GetEs_Acreedor write SetEs_Acreedor;
end; end;
IBizEmpleado = interface (IBizContacto) IBizVendedor = interface (IBizContacto)
['{CA24021E-A227-47F9-815F-A8565DB0F748}'] ['{CA24021E-A227-47F9-815F-A8565DB0F748}']
function GetFECHA_NACIMIENTOValue: TDateTime; function GetCOMISIONValue: Float;
procedure SetFECHA_NACIMIENTOValue(const aValue: TDateTime); procedure SetCOMISIONValue(const aValue: Float);
function GetCATEGORIAValue: String; function GetID_USUARIOValue: Integer;
procedure SetCATEGORIAValue(const aValue: String); procedure SetID_USUARIOValue(const aValue: Integer);
function GetFECHA_ALTA_EMPRESAValue: TDateTime; property COMISION: Float read GetCOMISIONValue write SetCOMISIONValue;
procedure SetFECHA_ALTA_EMPRESAValue(const aValue: TDateTime); property ID_USUARIO: Integer read GetID_USUARIOValue write SetID_USUARIOValue;
function GetFORMACION_BASEValue: IROStrings;
procedure SetFORMACION_BASEValue(const aValue: IROStrings);
function GetFORMACION_COMPLEValue: IROStrings;
procedure SetFORMACION_COMPLEValue(const aValue: IROStrings);
function GetFORMACION_RECIBIDAValue: IROStrings;
procedure SetFORMACION_RECIBIDAValue(const aValue: IROStrings);
function GetEXPERIENCIAValue: IROStrings;
procedure SetEXPERIENCIAValue(const aValue: IROStrings);
property FECHA_NACIMIENTO: TDateTime read GetFECHA_NACIMIENTOValue write SetFECHA_NACIMIENTOValue;
property CATEGORIA: String read GetCATEGORIAValue write SetCATEGORIAValue;
property FECHA_ALTA_EMPRESA: TDateTime read GetFECHA_ALTA_EMPRESAValue write SetFECHA_ALTA_EMPRESAValue;
property FORMACION_BASE: IROStrings read GetFORMACION_BASEValue write SetFORMACION_BASEValue;
property FORMACION_COMPLE: IROStrings read GetFORMACION_COMPLEValue write SetFORMACION_COMPLEValue;
property FORMACION_RECIBIDA: IROStrings read GetFORMACION_RECIBIDAValue write SetFORMACION_RECIBIDAValue;
property EXPERIENCIA: IROStrings read GetEXPERIENCIAValue write SetEXPERIENCIAValue;
end; end;
TBizContacto = class(TContactosDataTableRules, IBizContacto, ISeleccionable) TBizContacto = class(TContactosDataTableRules, IBizContacto, ISeleccionable)
@ -386,38 +366,17 @@ type
end; end;
TBizEmpleado = class(TBizContacto, IBizEmpleado) TBizVendedor = class(TBizContacto, IBizVendedor)
protected protected
function GetFECHA_NACIMIENTOValue: TDateTime; function GetCOMISIONValue: Float;
procedure SetFECHA_NACIMIENTOValue(const aValue: TDateTime); procedure SetCOMISIONValue(const aValue: Float);
function GetCATEGORIAValue: String; function GetID_USUARIOValue: Integer;
procedure SetCATEGORIAValue(const aValue: String); procedure SetID_USUARIOValue(const aValue: Integer);
function GetFECHA_ALTA_EMPRESAValue: TDateTime;
procedure SetFECHA_ALTA_EMPRESAValue(const aValue: TDateTime);
function GetFORMACION_BASEValue: IROStrings;
procedure SetFORMACION_BASEValue(const aValue: IROStrings);
function GetFORMACION_COMPLEValue: IROStrings;
procedure SetFORMACION_COMPLEValue(const aValue: IROStrings);
function GetFORMACION_RECIBIDAValue: IROStrings;
procedure SetFORMACION_RECIBIDAValue(const aValue: IROStrings);
function GetEXPERIENCIAValue: IROStrings;
procedure SetEXPERIENCIAValue(const aValue: IROStrings);
public public
property FECHA_NACIMIENTO: TDateTime read GetFECHA_NACIMIENTOValue write SetFECHA_NACIMIENTOValue; property COMISION: Float read GetCOMISIONValue write SetCOMISIONValue;
property CATEGORIA: String read GetCATEGORIAValue write SetCATEGORIAValue; property ID_USUARIO: Integer read GetID_USUARIOValue write SetID_USUARIOValue;
property FECHA_ALTA_EMPRESA: TDateTime read GetFECHA_ALTA_EMPRESAValue write SetFECHA_ALTA_EMPRESAValue;
property FORMACION_BASE: IROStrings read GetFORMACION_BASEValue write SetFORMACION_BASEValue;
property FORMACION_COMPLE: IROStrings read GetFORMACION_COMPLEValue write SetFORMACION_COMPLEValue;
property FORMACION_RECIBIDA: IROStrings read GetFORMACION_RECIBIDAValue write SetFORMACION_RECIBIDAValue;
property EXPERIENCIA: IROStrings read GetEXPERIENCIAValue write SetEXPERIENCIAValue;
procedure IniciarValoresContactoNuevo; override; procedure IniciarValoresContactoNuevo; override;
end; end;
@ -465,7 +424,8 @@ begin
case ID_CATEGORIA of case ID_CATEGORIA of
1 : Result := 'Cliente'; 1 : Result := 'Cliente';
2 : Result := 'Proveedor'; 2 : Result := 'Proveedor';
3 : Result := 'Empleado'; 3 : Result := 'Vendedor';
4 : Result := 'Instalador';
end; end;
end; end;
@ -482,8 +442,6 @@ end;
procedure TBizContacto.IniciarValoresContactoNuevo; procedure TBizContacto.IniciarValoresContactoNuevo;
begin begin
USUARIO := AppFactuGES.UsuarioActivo.UserName; USUARIO := AppFactuGES.UsuarioActivo.UserName;
//TEMPORAL
ID_TIENDA := AppFactuGES.VAR_IDTIENDA; ID_TIENDA := AppFactuGES.VAR_IDTIENDA;
TIENDA := AppFactuGES.VAR_TIENDA; TIENDA := AppFactuGES.VAR_TIENDA;
end; end;
@ -767,7 +725,7 @@ begin
{$ELSE} {$ELSE}
IGNORAR_CONTABILIDAD := 1; IGNORAR_CONTABILIDAD := 1;
TIENE_SUBCUENTA := 0; TIENE_SUBCUENTA := 0;
ES_ACREEDOR := 0; ES_ACREEDOR := 0;
{$ENDIF} {$ENDIF}
end; end;
@ -889,86 +847,35 @@ begin
DataTable.Fields[idx_ProveedoresTIENE_SUBCUENTA].AsInteger := Value; DataTable.Fields[idx_ProveedoresTIENE_SUBCUENTA].AsInteger := Value;
end; end;
{ TBizEmpleado } { TBizVendedor }
function TBizEmpleado.GetCATEGORIAValue: String;
{ TBizVendedor }
function TBizVendedor.GetCOMISIONValue: Float;
begin begin
result := DataTable.Fields[idx_EmpleadosCATEGORIA].AsString; result := DataTable.Fields[idx_VendedoresCOMISION].AsFloat;
end; end;
function TBizEmpleado.GetEXPERIENCIAValue: IROStrings; function TBizVendedor.GetID_USUARIOValue: Integer;
begin begin
result := NewROStrings(); result := DataTable.Fields[idx_VendedoresID_USUARIO].AsInteger;
result.Text := DataTable.Fields[idx_EmpleadosEXPERIENCIA].AsString;
end; end;
function TBizEmpleado.GetFECHA_ALTA_EMPRESAValue: TDateTime; procedure TBizVendedor.IniciarValoresContactoNuevo;
begin
result := DataTable.Fields[idx_EmpleadosFECHA_ALTA_EMPRESA].AsDateTime;
end;
function TBizEmpleado.GetFECHA_NACIMIENTOValue: TDateTime;
begin
result := DataTable.Fields[idx_EmpleadosFECHA_NACIMIENTO].AsDateTime;
end;
function TBizEmpleado.GetFORMACION_BASEValue: IROStrings;
begin
result := NewROStrings();
result.Text := DataTable.Fields[idx_EmpleadosFORMACION_BASE].AsString;
end;
function TBizEmpleado.GetFORMACION_COMPLEValue: IROStrings;
begin
result := NewROStrings();
result.Text := DataTable.Fields[idx_EmpleadosFORMACION_COMPLE].AsString;
end;
function TBizEmpleado.GetFORMACION_RECIBIDAValue: IROStrings;
begin
result := NewROStrings();
result.Text := DataTable.Fields[idx_EmpleadosFORMACION_RECIBIDA].AsString;
end;
procedure TBizEmpleado.IniciarValoresContactoNuevo;
begin begin
inherited; inherited;
ID_CATEGORIA := CATEGORIA_EMPLEADO; ID_CATEGORIA := CATEGORIA_VENDEDOR;
end; end;
procedure TBizEmpleado.SetCATEGORIAValue(const aValue: String); procedure TBizVendedor.SetCOMISIONValue(const aValue: Float);
begin begin
DataTable.Fields[idx_EmpleadosCATEGORIA].AsString := aValue; DataTable.Fields[idx_VendedoresCOMISION].AsFloat := aValue;
end; end;
procedure TBizEmpleado.SetEXPERIENCIAValue(const aValue: IROStrings); procedure TBizVendedor.SetID_USUARIOValue(const aValue: Integer);
begin begin
DataTable.Fields[idx_EmpleadosEXPERIENCIA].AsString := aValue.Text; DataTable.Fields[idx_VendedoresID_USUARIO].AsInteger := aValue;
end;
procedure TBizEmpleado.SetFECHA_ALTA_EMPRESAValue(const aValue: TDateTime);
begin
DataTable.Fields[idx_EmpleadosFECHA_ALTA_EMPRESA].AsDateTime := aValue;
end;
procedure TBizEmpleado.SetFECHA_NACIMIENTOValue(const aValue: TDateTime);
begin
DataTable.Fields[idx_EmpleadosFECHA_NACIMIENTO].AsDateTime := aValue;
end;
procedure TBizEmpleado.SetFORMACION_BASEValue(const aValue: IROStrings);
begin
DataTable.Fields[idx_EmpleadosFORMACION_BASE].AsString := aValue.Text;
end;
procedure TBizEmpleado.SetFORMACION_COMPLEValue(const aValue: IROStrings);
begin
DataTable.Fields[idx_EmpleadosFORMACION_COMPLE].AsString := aValue.Text;
end;
procedure TBizEmpleado.SetFORMACION_RECIBIDAValue(const aValue: IROStrings);
begin
DataTable.Fields[idx_EmpleadosFORMACION_RECIBIDA].AsString := aValue.Text;
end; end;
initialization initialization
@ -976,7 +883,7 @@ initialization
RegisterDataTableRules(BIZ_CLIENT_CLIENTE, TBizCliente); RegisterDataTableRules(BIZ_CLIENT_CLIENTE, TBizCliente);
RegisterDataTableRules(BIZ_CLIENT_PROVEEDOR, TBizProveedor); RegisterDataTableRules(BIZ_CLIENT_PROVEEDOR, TBizProveedor);
RegisterDataTableRules(BIZ_CLIENT_EMPLEADO, TBizEmpleado); RegisterDataTableRules(BIZ_CLIENT_VENDEDOR, TBizVendedor);
finalization finalization

View File

@ -1,116 +0,0 @@
unit uBizEmpleadosServer;
interface
uses
schContactosServer_Intf, uDAInterfaces, uDADelta,
uDADataTable, uDABusinessProcessor, uBizContactosServer;
const
BIZ_SERVER_EMPLEADO = 'Server.Empleado';
type
TBizEmpleadoServer = class(TBizContactosServer)
protected
procedure Insert_Datos_Contacto(aChange: TDADeltaChange); override;
procedure Update_Datos_Contacto(aChange: TDADeltaChange); override;
procedure Delete_Datos_Contacto(aChange: TDADeltaChange); override;
end;
implementation
uses
uDataModuleServer, uDAClasses,
schContactosClient_Intf, uBusinessUtils;
{ TBizEmpleadoServer }
procedure TBizEmpleadoServer.Delete_Datos_Contacto(aChange: TDADeltaChange);
var
ASchema : TDASchema;
ACurrentConn : IDAConnection;
ACommand : IDASQLCommand;
begin
inherited;
ASchema := BusinessProcessor.Schema;
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
ACommand := ASchema.NewCommand(ACurrentConn, 'Delete_EmpleadosDatos');
try
with ACommand do
begin
ParamByName('OLD_ID_EMPLEADO').Value := aChange.OldValueByName[fld_EmpleadosID];
Execute;
end;
finally
ACommand := NIL;
end;
end;
procedure TBizEmpleadoServer.Insert_Datos_Contacto(aChange: TDADeltaChange);
var
ASchema : TDASchema;
ACurrentConn : IDAConnection;
ACommand : IDASQLCommand;
begin
inherited;
ASchema := BusinessProcessor.Schema;
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
ACommand := ASchema.NewCommand(ACurrentConn, 'Insert_EmpleadosDatos');
try
with ACommand do
begin
ParamByName('ID_EMPLEADO').Value := aChange.NewValueByName[fld_EmpleadosID];
ParamByName('FECHA_NACIMIENTO').Value := aChange.NewValueByName[fld_EmpleadosFECHA_NACIMIENTO];
ParamByName('CATEGORIA').Value := aChange.NewValueByName[fld_EmpleadosCATEGORIA];
ParamByName('FECHA_ALTA_EMPRESA').Value := aChange.NewValueByName[fld_EmpleadosFECHA_ALTA_EMPRESA];
ParamByName('FORMACION_BASE').Value := aChange.NewValueByName[fld_EmpleadosFORMACION_BASE];
ParamByName('FORMACION_COMPLE').Value := aChange.NewValueByName[fld_EmpleadosFORMACION_COMPLE];
ParamByName('FORMACION_RECIBIDA').Value := aChange.NewValueByName[fld_EmpleadosFORMACION_RECIBIDA];
ParamByName('EXPERIENCIA').Value := aChange.NewValueByName[fld_EmpleadosEXPERIENCIA];
ParamByName('ID_USUARIO').Value := aChange.NewValueByName[fld_EmpleadosID_USUARIO];
Execute;
end;
finally
ACommand := NIL;
end;
end;
procedure TBizEmpleadoServer.Update_Datos_Contacto(aChange: TDADeltaChange);
var
ASchema : TDASchema;
ACurrentConn : IDAConnection;
ACommand : IDASQLCommand;
begin
inherited;
ASchema := BusinessProcessor.Schema;
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
ACommand := ASchema.NewCommand(ACurrentConn, 'Update_EmpleadosDatos');
try
with ACommand do
begin
ParamByName('OLD_ID_EMPLEADO').Value := aChange.OldValueByName[fld_EmpleadosID];
ParamByName('FECHA_NACIMIENTO').Value := aChange.NewValueByName[fld_EmpleadosFECHA_NACIMIENTO];
ParamByName('CATEGORIA').Value := aChange.NewValueByName[fld_EmpleadosCATEGORIA];
ParamByName('FECHA_ALTA_EMPRESA').Value := aChange.NewValueByName[fld_EmpleadosFECHA_ALTA_EMPRESA];
ParamByName('FORMACION_BASE').Value := aChange.NewValueByName[fld_EmpleadosFORMACION_BASE];
ParamByName('FORMACION_COMPLE').Value := aChange.NewValueByName[fld_EmpleadosFORMACION_COMPLE];
ParamByName('FORMACION_RECIBIDA').Value := aChange.NewValueByName[fld_EmpleadosFORMACION_RECIBIDA];
ParamByName('EXPERIENCIA').Value := aChange.NewValueByName[fld_EmpleadosEXPERIENCIA];
ParamByName('ID_USUARIO').Value := aChange.NewValueByName[fld_EmpleadosID_USUARIO];
Execute;
end;
finally
ACommand := NIL;
end;
end;
initialization
RegisterBusinessProcessorRules(BIZ_SERVER_EMPLEADO, TBizEmpleadoServer);
end.

View File

@ -1,36 +0,0 @@
unit uBizGruposEmpleado;
interface
uses
uDAInterfaces, uDADataTable, schContactosClient_Intf;
const
BIZ_CLIENT_GRUPOSEMPLEADO = 'Client.GrupoEmpleado';
type
IBizGrupoEmpleado = interface(IGruposEmpleado)
['{0952BCC8-09B6-4D09-9B5E-26853E159B79}']
end;
TBizGrupoEmpleado = class(TGruposEmpleadoDataTableRules, IBizGrupoEmpleado)
procedure AfterOpen(Sender: TDADataTable); override;
end;
implementation
{ TBizGrupoEmpleado }
procedure TBizGrupoEmpleado.AfterOpen(Sender: TDADataTable);
begin
inherited;
DataTable.Sort([fld_GruposEmpleadoDESCRIPCION], [sdAscending]);
end;
initialization
RegisterDataTableRules(BIZ_CLIENT_GRUPOSEMPLEADO, TBizGrupoEmpleado);
finalization
end.

View File

@ -0,0 +1,104 @@
unit uBizVendedoresServer;
interface
uses
schContactosServer_Intf, uDAInterfaces, uDADelta,
uDADataTable, uDABusinessProcessor, uBizContactosServer;
const
BIZ_SERVER_VENDEDOR = 'Server.Vendedor';
type
TBizVendedorServer = class(TBizContactosServer)
protected
procedure Insert_Datos_Contacto(aChange: TDADeltaChange); override;
procedure Update_Datos_Contacto(aChange: TDADeltaChange); override;
procedure Delete_Datos_Contacto(aChange: TDADeltaChange); override;
end;
implementation
uses
uDataModuleServer, uDAClasses,
schContactosClient_Intf, uBusinessUtils;
{ TBizVendedorServer }
procedure TBizVendedorServer.Delete_Datos_Contacto(aChange: TDADeltaChange);
var
ASchema : TDASchema;
ACurrentConn : IDAConnection;
ACommand : IDASQLCommand;
begin
inherited;
ASchema := BusinessProcessor.Schema;
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
ACommand := ASchema.NewCommand(ACurrentConn, 'Delete_VendedoresDatos');
try
with ACommand do
begin
ParamByName('OLD_ID_VENDEDOR').Value := aChange.OldValueByName[fld_VendedoresID];
Execute;
end;
finally
ACommand := NIL;
end;
end;
procedure TBizVendedorServer.Insert_Datos_Contacto(aChange: TDADeltaChange);
var
ASchema : TDASchema;
ACurrentConn : IDAConnection;
ACommand : IDASQLCommand;
begin
inherited;
ASchema := BusinessProcessor.Schema;
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
ACommand := ASchema.NewCommand(ACurrentConn, 'Insert_VendedoresDatos');
try
with ACommand do
begin
ParamByName('ID_VENDEDOR').Value := aChange.NewValueByName[fld_VendedoresID];
ParamByName('ID_USUARIO').Value := aChange.NewValueByName[fld_VendedoresID_USUARIO];
ParamByName('COMISION').Value := aChange.NewValueByName[fld_VendedoresCOMISION];
Execute;
end;
finally
ACommand := NIL;
end;
end;
procedure TBizVendedorServer.Update_Datos_Contacto(aChange: TDADeltaChange);
var
ASchema : TDASchema;
ACurrentConn : IDAConnection;
ACommand : IDASQLCommand;
begin
inherited;
ASchema := BusinessProcessor.Schema;
ACurrentConn := GetBusinessProcessorConnection(BusinessProcessor);
ACommand := ASchema.NewCommand(ACurrentConn, 'Update_VendedoresDatos');
try
with ACommand do
begin
ParamByName('OLD_ID_VENDEDOR').Value := aChange.OldValueByName[fld_VendedoresID];
ParamByName('ID_USUARIO').Value := aChange.NewValueByName[fld_VendedoresID_USUARIO];
ParamByName('COMISION').Value := aChange.NewValueByName[fld_VendedoresCOMISION];
Execute;
end;
finally
ACommand := NIL;
end;
end;
initialization
RegisterBusinessProcessorRules(BIZ_SERVER_VENDEDOR, TBizVendedorServer);
end.

View File

@ -277,11 +277,11 @@ object PluginContactos: TPluginContactos
ImageIndex = 1 ImageIndex = 1
OnExecute = actProveedoresExecute OnExecute = actProveedoresExecute
end end
object actEmpleados: TAction object actVendedores: TAction
Category = 'Empresa' Category = 'Empresa'
Caption = 'Vendedores' Caption = 'Vendedores'
ImageIndex = 2 ImageIndex = 2
OnExecute = actEmpleadosExecute OnExecute = actVendedoresExecute
end end
object actGruposCliente: TAction object actGruposCliente: TAction
Caption = 'Grupos de cliente' Caption = 'Grupos de cliente'
@ -293,11 +293,6 @@ object PluginContactos: TPluginContactos
ImageIndex = 5 ImageIndex = 5
OnExecute = actGruposProveedorExecute OnExecute = actGruposProveedorExecute
end end
object actGruposEmpleado: TAction
Caption = 'Categorias de empleado'
ImageIndex = 4
OnExecute = actGruposEmpleadoExecute
end
object actProcedenciasCliente: TAction object actProcedenciasCliente: TAction
Caption = 'Procedencias de cliente' Caption = 'Procedencias de cliente'
ImageIndex = 6 ImageIndex = 6
@ -312,7 +307,7 @@ object PluginContactos: TPluginContactos
Caption = 'Empresa' Caption = 'Empresa'
object Vendedores1: TMenuItem object Vendedores1: TMenuItem
Tag = 102 Tag = 102
Action = actEmpleados Action = actVendedores
SubMenuImages = SmallImages SubMenuImages = SmallImages
end end
end end
@ -330,7 +325,8 @@ object PluginContactos: TPluginContactos
end end
object Categoriasdeempleado1: TMenuItem object Categoriasdeempleado1: TMenuItem
Tag = 103 Tag = 103
Action = actGruposEmpleado Caption = 'Categorias de empleado'
ImageIndex = 4
end end
object Procedenciasdecliente1: TMenuItem object Procedenciasdecliente1: TMenuItem
Tag = 104 Tag = 104

View File

@ -24,12 +24,10 @@ type
Resumen1: TMenuItem; Resumen1: TMenuItem;
SmallImages: TPngImageList; SmallImages: TPngImageList;
Ventas1: TMenuItem; Ventas1: TMenuItem;
actEmpleados: TAction; actVendedores: TAction;
Vendedores1: TMenuItem; Vendedores1: TMenuItem;
actGruposCliente: TAction; actGruposCliente: TAction;
actGruposProveedor: TAction; actGruposProveedor: TAction;
actGruposEmpleado: TAction;
Categoriasdeempleado1: TMenuItem;
Gruposdeproveedor1: TMenuItem; Gruposdeproveedor1: TMenuItem;
Da1: TMenuItem; Da1: TMenuItem;
actProcedenciasCliente: TAction; actProcedenciasCliente: TAction;
@ -37,10 +35,9 @@ type
Empresas1: TMenuItem; Empresas1: TMenuItem;
procedure actClientesExecute(Sender: TObject); procedure actClientesExecute(Sender: TObject);
procedure actProveedoresExecute(Sender: TObject); procedure actProveedoresExecute(Sender: TObject);
procedure actEmpleadosExecute(Sender: TObject); procedure actVendedoresExecute(Sender: TObject);
procedure actGruposClienteExecute(Sender: TObject); procedure actGruposClienteExecute(Sender: TObject);
procedure actGruposProveedorExecute(Sender: TObject); procedure actGruposProveedorExecute(Sender: TObject);
procedure actGruposEmpleadoExecute(Sender: TObject);
procedure actProcedenciasClienteExecute(Sender: TObject); procedure actProcedenciasClienteExecute(Sender: TObject);
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
@ -53,10 +50,10 @@ implementation
uses uses
Forms, Dialogs, uGUIBase, uCustomEditor, SysUtils, uContactosController, Forms, Dialogs, uGUIBase, uCustomEditor, SysUtils, uContactosController,
uClientesController, uProveedoresController, uEmpleadosController, uClientesController, uProveedoresController, uVendedoresController,
uGruposClienteController, uProcedenciasClienteController, uBizGruposCliente, uGruposClienteController, uProcedenciasClienteController, uBizGruposCliente,
uGruposProveedorController, uBizGruposProveedor, uBizProcedenciasCliente, uGruposProveedorController, uBizGruposProveedor, uBizProcedenciasCliente,
uGruposEmpleadoController, uBizGruposEmpleado, uContactosViewRegister, uBizContactos; uContactosViewRegister, uBizContactos;
function GetModule : TModuleController; function GetModule : TModuleController;
begin begin
@ -94,16 +91,6 @@ begin
AGruposClienteController.VerTodos(AGruposCliente); AGruposClienteController.VerTodos(AGruposCliente);
end; end;
procedure TPluginContactos.actGruposEmpleadoExecute(Sender: TObject);
var
AGruposEmpleadoController : IGruposEmpleadoController;
AGruposEmpleado : IBizGrupoEmpleado;
begin
AGruposEmpleadoController := TGruposEmpleadoController.Create;
AGruposEmpleado := (AGruposEmpleadoController.BuscarTodos as IBizGrupoEmpleado);
AGruposEmpleadoController.VerTodos(AGruposEmpleado);
end;
procedure TPluginContactos.actGruposProveedorExecute(Sender: TObject); procedure TPluginContactos.actGruposProveedorExecute(Sender: TObject);
var var
AGruposProveedorController : IGruposProveedorController; AGruposProveedorController : IGruposProveedorController;
@ -134,14 +121,14 @@ begin
AProveedoresController.VerTodos(AProveedores); AProveedoresController.VerTodos(AProveedores);
end; end;
procedure TPluginContactos.actEmpleadosExecute(Sender: TObject); procedure TPluginContactos.actVendedoresExecute(Sender: TObject);
var var
AEmpleadosController : IEmpleadosController; AVendedoresController : IVendedoresController;
AEmpleados : IBizEmpleado; AVendedores : IBizVendedor;
begin begin
AEmpleadosController := TEmpleadosController.Create; AVendedoresController := TVendedoresController.Create;
AEmpleados := (AEmpleadosController.BuscarTodos as IBizEmpleado); AVendedores := (AVendedoresController.BuscarTodos as IBizVendedor);
AEmpleadosController.VerTodos(AEmpleados); AVendedoresController.VerTodos(AVendedores);
end; end;
constructor TPluginContactos.Create(AOwner: TComponent); constructor TPluginContactos.Create(AOwner: TComponent);

View File

@ -1,914 +0,0 @@
object RptFichasEmpleado: TRptFichasEmpleado
OldCreateOrder = True
OnCreate = DataModuleCreate
Height = 455
Width = 576
object DADataCabecera: TDADataSource
DataSet = tbl_FichaEmpleado.Dataset
DataTable = tbl_FichaEmpleado
Left = 264
Top = 72
end
object tbl_FichaEmpleado: TDAMemDataTable
RemoteUpdatesOptions = []
Fields = <
item
Name = 'ID'
DataType = datInteger
end
item
Name = 'ID_CATEGORIA'
DataType = datInteger
end
item
Name = 'NIF_CIF'
DataType = datString
Size = 15
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'PERSONA_CONTACTO'
DataType = datString
Size = 255
end
item
Name = 'CALLE'
DataType = datString
Size = 255
end
item
Name = 'POBLACION'
DataType = datString
Size = 255
end
item
Name = 'PROVINCIA'
DataType = datString
Size = 255
end
item
Name = 'CODIGO_POSTAL'
DataType = datString
Size = 10
end
item
Name = 'TELEFONO_1'
DataType = datString
Size = 25
end
item
Name = 'TELEFONO_2'
DataType = datString
Size = 25
end
item
Name = 'MOVIL_1'
DataType = datString
Size = 25
end
item
Name = 'MOVIL_2'
DataType = datString
Size = 25
end
item
Name = 'FAX'
DataType = datString
Size = 25
end
item
Name = 'EMAIL_1'
DataType = datString
Size = 255
end
item
Name = 'EMAIL_2'
DataType = datString
Size = 255
end
item
Name = 'PAGINA_WEB'
DataType = datString
Size = 255
end
item
Name = 'NOTAS'
DataType = datMemo
end
item
Name = 'FECHA_ALTA'
DataType = datDateTime
end
item
Name = 'FECHA_MODIFICACION'
DataType = datDateTime
end
item
Name = 'USUARIO'
DataType = datString
Size = 20
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'FECHA_NACIMIENTO'
DataType = datDateTime
end
item
Name = 'CATEGORIA'
DataType = datString
Size = 255
end
item
Name = 'FECHA_ALTA_EMPRESA'
DataType = datDateTime
end
item
Name = 'FORMACION_BASE'
DataType = datMemo
end
item
Name = 'FORMACION_COMPLE'
DataType = datMemo
end
item
Name = 'FORMACION_RECIBIDA'
DataType = datMemo
end
item
Name = 'EXPERIENCIA'
DataType = datMemo
end
item
Name = 'NOMBRE_EMPRESA'
DataType = datString
Size = 255
end
item
Name = 'RAZON_SOCIAL'
DataType = datString
Size = 255
end
item
Name = 'TELEFONO_1_EMPRESA'
DataType = datString
Size = 25
end
item
Name = 'FAX_EMPRESA'
DataType = datString
Size = 25
end
item
Name = 'LOGOTIPO'
DataType = datBlob
end>
Params = <
item
Name = 'ID'
DataType = datInteger
Value = ''
ParamType = daptInput
end>
MasterMappingMode = mmDataRequest
LogChanges = False
StreamingOptions = [soDisableEventsWhileStreaming]
RemoteFetchEnabled = False
LocalSchema = schReport
LocalDataStreamer = Bin2DataStreamer
DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch]
MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates]
LogicalName = 'InformeFichasEmpleado'
IndexDefs = <>
Left = 264
Top = 128
end
object frxRichObject1: TfrxRichObject
Left = 48
Top = 296
end
object frxBarCodeObject1: TfrxBarCodeObject
Left = 144
Top = 296
end
object frxOLEObject1: TfrxOLEObject
Left = 48
Top = 344
end
object frxCrossObject1: TfrxCrossObject
Left = 144
Top = 344
end
object frxCheckBoxObject1: TfrxCheckBoxObject
Left = 256
Top = 296
end
object frxGradientObject1: TfrxGradientObject
Left = 360
Top = 296
end
object frxChartObject1: TfrxChartObject
Left = 256
Top = 344
end
object schReport: TDASchema
ConnectionManager = dmServer.ConnectionManager
DataDictionary = DataDictionary
Datasets = <
item
Params = <
item
Name = 'ID'
DataType = datInteger
Value = ''
ParamType = daptInput
end>
Statements = <
item
Connection = 'IBX'
TargetTable = 'V_EMPLEADOS'
SQL =
'select'#10' V_EMPLEADOS.ID,'#10' V_EMPLEADOS.ID_CATEGORIA,'#10' V_E' +
'MPLEADOS.NIF_CIF,'#10' V_EMPLEADOS.NOMBRE,'#10' V_EMPLEADOS.PERSON' +
'A_CONTACTO,'#10' V_EMPLEADOS.CALLE,'#10' V_EMPLEADOS.POBLACION,'#10' ' +
' V_EMPLEADOS.PROVINCIA,'#10' V_EMPLEADOS.CODIGO_POSTAL,'#10' V_EM' +
'PLEADOS.TELEFONO_1,'#10' V_EMPLEADOS.TELEFONO_2,'#10' V_EMPLEADOS.' +
'MOVIL_1,'#10' V_EMPLEADOS.MOVIL_2,'#10' V_EMPLEADOS.FAX,'#10' V_EMP' +
'LEADOS.EMAIL_1,'#10' V_EMPLEADOS.EMAIL_2,'#10' V_EMPLEADOS.PAGINA_' +
'WEB,'#10' V_EMPLEADOS.NOTAS,'#10' V_EMPLEADOS.FECHA_ALTA,'#10' V_EM' +
'PLEADOS.FECHA_MODIFICACION,'#10' V_EMPLEADOS.USUARIO,'#10' V_EMPLE' +
'ADOS.ID_EMPRESA,'#10' V_EMPLEADOS.REFERENCIA,'#10' V_EMPLEADOS.FEC' +
'HA_NACIMIENTO,'#10' V_EMPLEADOS.CATEGORIA,'#10' V_EMPLEADOS.FECHA_' +
'ALTA_EMPRESA,'#10' V_EMPLEADOS.FORMACION_BASE,'#10' V_EMPLEADOS.FO' +
'RMACION_COMPLE,'#10' V_EMPLEADOS.FORMACION_RECIBIDA,'#10' V_EMPLEA' +
'DOS.EXPERIENCIA,'#10' EMPRESAS.NOMBRE as NOMBRE_EMPRESA,'#10' EMPR' +
'ESAS.RAZON_SOCIAL,'#10' EMPRESAS.TELEFONO_1 as TELEFONO_1_EMPRESA' +
','#10' EMPRESAS.FAX as FAX_EMPRESA,'#10' EMPRESAS.LOGOTIPO'#10' '#10'fr' +
'om V_EMPLEADOS'#10'left join EMPRESAS on (EMPRESAS.ID = V_EMPLEADOS.' +
'ID_EMPRESA)'#10'where V_EMPLEADOS.ID = :ID'
StatementType = stSQL
ColumnMappings = <
item
DatasetField = 'ID'
TableField = 'ID'
end
item
DatasetField = 'ID_CATEGORIA'
TableField = 'ID_CATEGORIA'
end
item
DatasetField = 'NIF_CIF'
TableField = 'NIF_CIF'
end
item
DatasetField = 'NOMBRE'
TableField = 'NOMBRE'
end
item
DatasetField = 'PERSONA_CONTACTO'
TableField = 'PERSONA_CONTACTO'
end
item
DatasetField = 'CALLE'
TableField = 'CALLE'
end
item
DatasetField = 'POBLACION'
TableField = 'POBLACION'
end
item
DatasetField = 'PROVINCIA'
TableField = 'PROVINCIA'
end
item
DatasetField = 'CODIGO_POSTAL'
TableField = 'CODIGO_POSTAL'
end
item
DatasetField = 'TELEFONO_1'
TableField = 'TELEFONO_1'
end
item
DatasetField = 'TELEFONO_2'
TableField = 'TELEFONO_2'
end
item
DatasetField = 'MOVIL_1'
TableField = 'MOVIL_1'
end
item
DatasetField = 'MOVIL_2'
TableField = 'MOVIL_2'
end
item
DatasetField = 'FAX'
TableField = 'FAX'
end
item
DatasetField = 'EMAIL_1'
TableField = 'EMAIL_1'
end
item
DatasetField = 'EMAIL_2'
TableField = 'EMAIL_2'
end
item
DatasetField = 'PAGINA_WEB'
TableField = 'PAGINA_WEB'
end
item
DatasetField = 'NOTAS'
TableField = 'NOTAS'
end
item
DatasetField = 'FECHA_ALTA'
TableField = 'FECHA_ALTA'
end
item
DatasetField = 'FECHA_MODIFICACION'
TableField = 'FECHA_MODIFICACION'
end
item
DatasetField = 'USUARIO'
TableField = 'USUARIO'
end
item
DatasetField = 'ID_EMPRESA'
TableField = 'ID_EMPRESA'
end
item
DatasetField = 'REFERENCIA'
TableField = 'REFERENCIA'
end
item
DatasetField = 'FECHA_NACIMIENTO'
TableField = 'FECHA_NACIMIENTO'
end
item
DatasetField = 'CATEGORIA'
TableField = 'CATEGORIA'
end
item
DatasetField = 'FECHA_ALTA_EMPRESA'
TableField = 'FECHA_ALTA_EMPRESA'
end
item
DatasetField = 'FORMACION_BASE'
TableField = 'FORMACION_BASE'
end
item
DatasetField = 'FORMACION_COMPLE'
TableField = 'FORMACION_COMPLE'
end
item
DatasetField = 'FORMACION_RECIBIDA'
TableField = 'FORMACION_RECIBIDA'
end
item
DatasetField = 'EXPERIENCIA'
TableField = 'EXPERIENCIA'
end
item
DatasetField = 'NOMBRE_EMPRESA'
TableField = 'NOMBRE_EMPRESA'
end
item
DatasetField = 'RAZON_SOCIAL'
TableField = 'RAZON_SOCIAL'
end
item
DatasetField = 'FAX_EMPRESA'
TableField = 'FAX_EMPRESA'
end
item
DatasetField = 'TELEFONO_1_EMPRESA'
TableField = 'TELEFONO_1_EMPRESA'
end
item
DatasetField = 'LOGOTIPO'
TableField = 'LOGOTIPO'
end>
end>
Name = 'InformeFichasEmpleado'
Fields = <
item
Name = 'ID'
DataType = datInteger
end
item
Name = 'ID_CATEGORIA'
DataType = datInteger
end
item
Name = 'NIF_CIF'
DataType = datString
Size = 15
end
item
Name = 'NOMBRE'
DataType = datString
Size = 255
end
item
Name = 'PERSONA_CONTACTO'
DataType = datString
Size = 255
end
item
Name = 'CALLE'
DataType = datString
Size = 255
end
item
Name = 'POBLACION'
DataType = datString
Size = 255
end
item
Name = 'PROVINCIA'
DataType = datString
Size = 255
end
item
Name = 'CODIGO_POSTAL'
DataType = datString
Size = 10
end
item
Name = 'TELEFONO_1'
DataType = datString
Size = 25
end
item
Name = 'TELEFONO_2'
DataType = datString
Size = 25
end
item
Name = 'MOVIL_1'
DataType = datString
Size = 25
end
item
Name = 'MOVIL_2'
DataType = datString
Size = 25
end
item
Name = 'FAX'
DataType = datString
Size = 25
end
item
Name = 'EMAIL_1'
DataType = datString
Size = 255
end
item
Name = 'EMAIL_2'
DataType = datString
Size = 255
end
item
Name = 'PAGINA_WEB'
DataType = datString
Size = 255
end
item
Name = 'NOTAS'
DataType = datMemo
end
item
Name = 'FECHA_ALTA'
DataType = datDateTime
end
item
Name = 'FECHA_MODIFICACION'
DataType = datDateTime
end
item
Name = 'USUARIO'
DataType = datString
Size = 20
end
item
Name = 'ID_EMPRESA'
DataType = datInteger
end
item
Name = 'REFERENCIA'
DataType = datString
Size = 255
end
item
Name = 'FECHA_NACIMIENTO'
DataType = datDateTime
end
item
Name = 'CATEGORIA'
DataType = datString
Size = 255
end
item
Name = 'FECHA_ALTA_EMPRESA'
DataType = datDateTime
end
item
Name = 'FORMACION_BASE'
DataType = datMemo
end
item
Name = 'FORMACION_COMPLE'
DataType = datMemo
end
item
Name = 'FORMACION_RECIBIDA'
DataType = datMemo
end
item
Name = 'EXPERIENCIA'
DataType = datMemo
end
item
Name = 'NOMBRE_EMPRESA'
DataType = datString
Size = 255
end
item
Name = 'RAZON_SOCIAL'
DataType = datString
Size = 255
end
item
Name = 'TELEFONO_1_EMPRESA'
DataType = datString
Size = 25
end
item
Name = 'FAX_EMPRESA'
DataType = datString
Size = 25
end
item
Name = 'LOGOTIPO'
DataType = datBlob
end>
end>
JoinDataTables = <>
UnionDataTables = <>
Commands = <>
RelationShips = <>
UpdateRules = <>
Version = 0
Left = 48
Top = 16
end
object DataDictionary: TDADataDictionary
Fields = <
item
Name = 'FacturasCliente_ID'
DataType = datAutoInc
Required = True
DisplayLabel = 'ID'
end
item
Name = 'FacturasCliente_ID_EMPRESA'
DataType = datInteger
DisplayLabel = 'ID_EMPRESA'
end
item
Name = 'FacturasCliente_ID_CONTRATO'
DataType = datInteger
DisplayLabel = 'ID_CONTRATO'
end
item
Name = 'FacturasCliente_FECHA_FACTURA'
DataType = datDateTime
DisplayLabel = 'Fecha de las factura'
end
item
Name = 'FacturasCliente_VENCIMIENTO'
DataType = datInteger
DisplayLabel = 'Vencimiento'
end
item
Name = 'FacturasCliente_SITUACION'
DataType = datString
Size = 255
DisplayLabel = 'Situaci'#243'n'
end
item
Name = 'FacturasCliente_BASE_IMPONIBLE'
DataType = datFloat
DisplayLabel = 'Base imponible'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_IMPORTE_DESCUENTO'
DataType = datFloat
DisplayLabel = 'Importe dto.'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_IMPORTE_IVA'
DataType = datFloat
DisplayLabel = 'Importe IVA'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_IMPORTE_TOTAL'
DataType = datFloat
DisplayLabel = 'Importe total'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_FORMA_PAGO'
DataType = datMemo
DisplayLabel = 'Forma de pago'
end
item
Name = 'FacturasCliente_ID_CLIENTE'
DataType = datInteger
DisplayLabel = 'ID_CLIENTE'
end
item
Name = 'FacturasCliente_NIF_CIF'
DataType = datString
Size = 15
DisplayLabel = 'NIF/CIF'
end
item
Name = 'FacturasCliente_CODIGO_POSTAL'
DataType = datString
Size = 10
DisplayLabel = 'C'#243'd. postal'
end
item
Name = 'FacturasCliente_FECHA_ALTA'
DataType = datDateTime
DisplayLabel = 'FECHA_ALTA'
end
item
Name = 'FacturasCliente_FECHA_MODIFICACION'
DataType = datDateTime
DisplayLabel = 'FECHA_MODIFICACION'
end
item
Name = 'FacturasCliente_OBSERVACIONES'
DataType = datMemo
DisplayLabel = 'Observaciones'
end
item
Name = 'FacturasCliente_NOMBRE'
DataType = datString
Size = 100
DisplayLabel = 'Cliente'
end
item
Name = 'FacturasCliente_CALLE'
DataType = datString
Size = 150
DisplayLabel = 'Direcci'#243'n'
end
item
Name = 'FacturasCliente_PROVINCIA'
DataType = datString
Size = 30
DisplayLabel = 'Provincia'
end
item
Name = 'FacturasCliente_POBLACION'
DataType = datString
Size = 150
DisplayLabel = 'Poblaci'#243'n'
end
item
Name = 'FacturasCliente_IVA'
DataType = datFloat
DisplayLabel = 'IVA'
end
item
Name = 'FacturasCliente_USUARIO'
DataType = datString
Size = 100
DisplayLabel = 'USUARIO'
end
item
Name = 'FacturasCliente_REFERENCIA'
DataType = datString
Size = 20
DisplayLabel = 'Referencia'
end
item
Name = 'FacturasCliente_DESCUENTO'
DataType = datFloat
DisplayLabel = 'Dto.'
end
item
Name = 'FacturasCliente_Detalles_ID'
DataType = datAutoInc
Required = True
DisplayLabel = 'ID'
end
item
Name = 'FacturasCliente_Detalles_ID_FACTURA'
DataType = datInteger
DisplayLabel = 'ID_FACTURA'
end
item
Name = 'FacturasCliente_Detalles_TIPO_DETALLE'
DataType = datString
Size = 10
DisplayLabel = 'Tipo detalle'
end
item
Name = 'FacturasCliente_Detalles_CONCEPTO'
DataType = datString
Size = 2000
DisplayLabel = 'Concepto'
end
item
Name = 'FacturasCliente_Detalles_IMPORTE_UNIDAD'
DataType = datFloat
DisplayLabel = 'Importe unidad'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_Detalles_IMPORTE_TOTAL'
DataType = datFloat
DisplayLabel = 'Importe total'
Alignment = taRightJustify
end
item
Name = 'FacturasCliente_Detalles_VISIBLE'
DataType = datInteger
DisplayLabel = #191'Visible?'
end
item
Name = 'FacturasCliente_Detalles_POSICION'
DataType = datInteger
DisplayLabel = 'Posici'#243'n'
end
item
Name = 'FacturasCliente_Detalles_CANTIDAD'
DataType = datInteger
DisplayLabel = 'Cantidad'
end>
Left = 46
Top = 142
end
object frxReport: TfrxReport
Version = '4.3'
DotMatrixReport = False
EngineOptions.DoublePass = True
IniFile = '\Software\Fast Reports'
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
PreviewOptions.Zoom = 1.000000000000000000
PrintOptions.Printer = 'Por defecto'
PrintOptions.PrintOnSheet = 0
ReportOptions.CreateDate = 39065.872423495400000000
ReportOptions.LastChange = 39329.847549722200000000
ScriptLanguage = 'PascalScript'
ScriptText.Strings = (
'var'
' Pagina: Variant;'
''
''
'procedure DatosEmpresaOnBeforePrint(Sender: TfrxComponent);'
'var'
' Cadena: String;'
'begin'
' DatosEmpresa.Lines.Clear;'
' if (<frxDBCabecera."TELEFONO_1_EMPRESA"> <> '#39#39') then'
' Cadena := '#39'TLF: '#39' + <frxDBCabecera."TELEFONO_1_EMPRESA">;'
' DatosEmpresa.Lines.Add(Cadena);'
''
' Cadena := '#39#39';'
' if (<frxDBCabecera."FAX_EMPRESA"> <> '#39#39') then'
' Cadena := '#39'FAX: '#39' + <frxDBCabecera."FAX_EMPRESA">;'
' DatosEmpresa.Lines.Add(Cadena);'
'end;'
''
'procedure NombreEmpresaOnBeforePrint(Sender: TfrxComponent);'
'begin'
' NombreEmpresa.Lines.Clear;'
' NombreEmpresa.Lines.Add(<frxDBCabecera."NOMBRE_EMPRESA">);'
'end;'
''
'procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);'
'begin'
' if not Engine.FinalPass then'
' Set('#39'TotalPaginas'#39', (<TotalPaginas> + 1));'
''
' if Engine.FinalPass then'
' Set('#39'Pagina'#39', (<Pagina> + 1));'
'end;'
''
'procedure frxReportOnStartReport(Sender: TfrxComponent);'
'begin'
' Set('#39'Pagina'#39', 0);'
' Set('#39'TotalPaginas'#39', 0);'
'end;'
''
'begin'
''
'end.')
ShowProgress = False
StoreInDFM = False
OnStartReport = 'frxReportOnStartReport'
Left = 169
Top = 16
end
object frxDBCabecera: TfrxDBDataset
UserName = 'frxDBCabecera'
CloseDataSource = True
DataSource = DataSource1
Left = 264
Top = 16
end
object Bin2DataStreamer: TDABin2DataStreamer
Left = 48
Top = 80
end
object IBDatabase1: TIBDatabase
Connected = True
DatabaseName = 'C:\Codigo Acana\Database\ACANA.FDB'
Params.Strings = (
'user_name=sysdba'
'password=masterkey'
'lc_ctype=ISO8859_1')
LoginPrompt = False
DefaultTransaction = IBTransaction1
Left = 352
Top = 16
end
object cabecera: TIBQuery
Database = IBDatabase1
Transaction = IBTransaction1
Active = True
SQL.Strings = (
'select'
' V_EMPLEADOS.ID,'
' V_EMPLEADOS.ID_CATEGORIA,'
' V_EMPLEADOS.NIF_CIF,'
' V_EMPLEADOS.NOMBRE,'
' V_EMPLEADOS.PERSONA_CONTACTO,'
' V_EMPLEADOS.CALLE,'
' V_EMPLEADOS.POBLACION,'
' V_EMPLEADOS.PROVINCIA,'
' V_EMPLEADOS.CODIGO_POSTAL,'
' V_EMPLEADOS.TELEFONO_1,'
' V_EMPLEADOS.TELEFONO_2,'
' V_EMPLEADOS.MOVIL_1,'
' V_EMPLEADOS.MOVIL_2,'
' V_EMPLEADOS.FAX,'
' V_EMPLEADOS.EMAIL_1,'
' V_EMPLEADOS.EMAIL_2,'
' V_EMPLEADOS.PAGINA_WEB,'
' V_EMPLEADOS.NOTAS,'
' V_EMPLEADOS.FECHA_ALTA,'
' V_EMPLEADOS.FECHA_MODIFICACION,'
' V_EMPLEADOS.USUARIO,'
' V_EMPLEADOS.ID_EMPRESA,'
' V_EMPLEADOS.REFERENCIA,'
' V_EMPLEADOS.FECHA_NACIMIENTO,'
' V_EMPLEADOS.CATEGORIA,'
' V_EMPLEADOS.FECHA_ALTA_EMPRESA,'
' V_EMPLEADOS.FORMACION_BASE,'
' V_EMPLEADOS.FORMACION_COMPLE,'
' V_EMPLEADOS.FORMACION_RECIBIDA,'
' V_EMPLEADOS.EXPERIENCIA,'
' EMPRESAS.NOMBRE as NOMBRE_EMPRESA,'
' EMPRESAS.RAZON_SOCIAL,'
' EMPRESAS.TELEFONO_1 as TELEFONO_1_EMPRESA,'
' EMPRESAS.FAX as FAX_EMPRESA,'
' EMPRESAS.LOGOTIPO'
' '
'from V_EMPLEADOS'
'left join EMPRESAS on (EMPRESAS.ID = V_EMPLEADOS.ID_EMPRESA)'
'where V_EMPLEADOS.ID = 2050')
Left = 440
Top = 16
end
object DataSource1: TDataSource
DataSet = cabecera
Left = 440
Top = 72
end
object IBTransaction1: TIBTransaction
Active = True
Left = 352
Top = 72
end
end

View File

@ -1,116 +0,0 @@
unit uRptFichasEmpleado_Server;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, frxClass, frxDBSet, uDAScriptingProvider,
uDADataTable, uDACDSDataTable, DB, uDAClasses, frxChart, frxGradient,
uDAInterfaces, uDAMemDataTable, uDABin2DataStreamer,
frxChBox, frxCross, frxOLE, frxBarcode, frxRich, uDABINAdapter, uROTypes,
uDADataStreamer, IBDatabase, IBCustomDataSet, IBQuery;
type
TRptFichasEmpleado = class(TDataModule)
DADataCabecera: TDADataSource;
tbl_FichaEmpleado: TDAMemDataTable;
frxRichObject1: TfrxRichObject;
frxBarCodeObject1: TfrxBarCodeObject;
frxOLEObject1: TfrxOLEObject;
frxCrossObject1: TfrxCrossObject;
frxCheckBoxObject1: TfrxCheckBoxObject;
frxGradientObject1: TfrxGradientObject;
frxChartObject1: TfrxChartObject;
frxDBCabecera: TfrxDBDataset;
schReport: TDASchema;
DataDictionary: TDADataDictionary;
frxReport: TfrxReport;
Bin2DataStreamer: TDABin2DataStreamer;
IBDatabase1: TIBDatabase;
cabecera: TIBQuery;
DataSource1: TDataSource;
IBTransaction1: TIBTransaction;
procedure DataModuleCreate(Sender: TObject);
private
FConnection: IDAConnection;
//Genera cada uno de los albaranes a imprimir
procedure GenerarFicha(const ID: integer); overload;
public
function GenerarFicha(const AFichaID : String): Binary; overload;
end;
implementation
{$R *.dfm}
uses
uDataModuleServer, schContactosClient_Intf;
const
rptFichaEmpleado = 'InfFichaEmpleado.fr3';
{ Dataset names for schReport }
ds_InformeFichaEmpleado = 'InformeFichasEmpleado';
{ TRptFichaEmpleado }
procedure TRptFichasEmpleado.DataModuleCreate(Sender: TObject);
begin
schReport.ConnectionManager := dmServer.ConnectionManager;
FConnection := dmServer.DarNuevaConexion;
frxReport.EngineOptions.NewSilentMode := simReThrow;
end;
function TRptFichasEmpleado.GenerarFicha(const AFichaID: String): Binary;
var
ID_Fichas: TStringList;
i: Integer;
begin
Result := Binary.Create;
FConnection.BeginTransaction;
try
ID_Fichas := TStringList.Create;
ID_Fichas.CommaText := AFichaID;
//Vamos generando todos y cada uno de las fichas de empleado
for i := 0 to ID_Fichas.Count - 1 do
GenerarFicha(StrToInt(ID_Fichas.Strings[i]));
frxReport.PreviewPages.SaveToStream(Result);
finally
FConnection.RollbackTransaction;
end;
end;
procedure TRptFichasEmpleado.GenerarFicha(const ID: integer);
var
AStream: TMemoryStream;
dsMaster: IDADataset;
begin
// AStream := TMemoryStream.Create;
try
// dsMaster := schReport.NewDataset(FConnection, ds_InformeFichaEmpleado, ['ID'], [ID]);
// AStream.Clear;
// Bin2DataStreamer.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1);
// Bin2DataStreamer.ReadDataset(AStream, tbl_FichaEmpleado, TRUE, '', TRUE, TRUE);
tbl_FichaEmpleado.ParamByName('ID').AsInteger := ID;
tbl_FichaEmpleado.Active := True;
frxReport.LoadFromFile(DarRutaInformes + rptFichaEmpleado, True);
frxReport.PrepareReport(False);
finally
// AStream.Free;
// dsMaster := Nil;
end;
end;
end.

View File

@ -1264,7 +1264,7 @@ object srvContactos: TsrvContactos
Statements = < Statements = <
item item
Connection = 'IBX' Connection = 'IBX'
TargetTable = 'V_EMPLEADOS' TargetTable = 'V_VENDEDORES'
StatementType = stAutoSQL StatementType = stAutoSQL
ColumnMappings = < ColumnMappings = <
item item
@ -1368,39 +1368,15 @@ object srvContactos: TsrvContactos
TableField = 'TIENDA' TableField = 'TIENDA'
end end
item item
DatasetField = 'FECHA_NACIMIENTO' DatasetField = 'COMISION'
TableField = 'FECHA_NACIMIENTO' TableField = 'COMISION'
end
item
DatasetField = 'CATEGORIA'
TableField = 'CATEGORIA'
end
item
DatasetField = 'FECHA_ALTA_EMPRESA'
TableField = 'FECHA_ALTA_EMPRESA'
end
item
DatasetField = 'FORMACION_BASE'
TableField = 'FORMACION_BASE'
end
item
DatasetField = 'FORMACION_COMPLE'
TableField = 'FORMACION_COMPLE'
end
item
DatasetField = 'FORMACION_RECIBIDA'
TableField = 'FORMACION_RECIBIDA'
end
item
DatasetField = 'EXPERIENCIA'
TableField = 'EXPERIENCIA'
end end
item item
DatasetField = 'ID_USUARIO' DatasetField = 'ID_USUARIO'
TableField = 'ID_USUARIO' TableField = 'ID_USUARIO'
end> end>
end> end>
Name = 'Empleados' Name = 'Vendedores'
Fields = < Fields = <
item item
Name = 'ID' Name = 'ID'
@ -1549,40 +1525,8 @@ object srvContactos: TsrvContactos
DictionaryEntry = 'Contactos_TIENDA' DictionaryEntry = 'Contactos_TIENDA'
end end
item item
Name = 'FECHA_NACIMIENTO' Name = 'COMISION'
DataType = datDateTime DataType = datFloat
DictionaryEntry = 'Empleados_FECHA_NACIMIENTO'
end
item
Name = 'CATEGORIA'
DataType = datString
Size = 255
DictionaryEntry = 'Empleados_CATEGORIA'
end
item
Name = 'FECHA_ALTA_EMPRESA'
DataType = datDateTime
DictionaryEntry = 'Empleados_FECHA_ALTA_EMPRESA'
end
item
Name = 'FORMACION_BASE'
DataType = datMemo
DictionaryEntry = 'Empleados_FORMACION_BASE'
end
item
Name = 'FORMACION_COMPLE'
DataType = datMemo
DictionaryEntry = 'Empleados_FORMACION_COMPLE'
end
item
Name = 'FORMACION_RECIBIDA'
DataType = datMemo
DictionaryEntry = 'Empleados_FORMACION_RECIBIDA'
end
item
Name = 'EXPERIENCIA'
DataType = datMemo
DictionaryEntry = 'Empleados_EXPERIENCIA'
end end
item item
Name = 'ID_USUARIO' Name = 'ID_USUARIO'
@ -1903,39 +1847,6 @@ object srvContactos: TsrvContactos
DictionaryEntry = 'GruposProveedor_DESCRIPCION' DictionaryEntry = 'GruposProveedor_DESCRIPCION'
end> end>
end end
item
Params = <>
Statements = <
item
Connection = 'IBX'
TargetTable = 'EMPLEADOS_GRUPOS'
StatementType = stAutoSQL
ColumnMappings = <
item
DatasetField = 'DESCRIPCION'
TableField = 'DESCRIPCION'
end
item
DatasetField = 'ID'
TableField = 'ID'
end>
end>
Name = 'GruposEmpleado'
Fields = <
item
Name = 'ID'
DataType = datAutoInc
GeneratorName = 'GEN_EMPLEADOS_GRUPOS_ID'
DictionaryEntry = 'GruposEmpleado_ID'
InPrimaryKey = True
end
item
Name = 'DESCRIPCION'
DataType = datString
Size = 255
DictionaryEntry = 'GruposEmpleado_DESCRIPCION'
end>
end
item item
Params = < Params = <
item item
@ -3349,105 +3260,25 @@ object srvContactos: TsrvContactos
item item
Params = < Params = <
item item
Name = 'OLD_ID_EMPLEADO' Name = 'OLD_ID_VENDEDOR'
DataType = datInteger
Value = ''
ParamType = daptInput
end>
Statements = <
item
Connection = 'IBX'
TargetTable = 'EMPLEADOS_DATOS'
SQL =
'DELETE '#10' FROM'#10' EMPLEADOS_DATOS'#10' WHERE'#10' (ID_EMPLEADO = :O' +
'LD_ID_EMPLEADO)'
StatementType = stSQL
ColumnMappings = <>
end>
Name = 'Delete_EmpleadosDatos'
end
item
Params = <
item
Name = 'ID_EMPLEADO'
Value = ''
end
item
Name = 'FECHA_NACIMIENTO'
Value = ''
end
item
Name = 'CATEGORIA'
Value = ''
end
item
Name = 'FECHA_ALTA_EMPRESA'
Value = ''
end
item
Name = 'FORMACION_BASE'
Value = ''
end
item
Name = 'FORMACION_COMPLE'
Value = ''
end
item
Name = 'FORMACION_RECIBIDA'
Value = ''
end
item
Name = 'EXPERIENCIA'
Value = ''
end
item
Name = 'ID_USUARIO'
Value = '' Value = ''
end> end>
Statements = < Statements = <
item item
Connection = 'IBX' Connection = 'IBX'
TargetTable = 'EMPLEADOS_DATOS' TargetTable = 'VENDEDORES_DATOS'
SQL = SQL =
'INSERT'#10' INTO EMPLEADOS_DATOS'#10' (ID_EMPLEADO, FECHA_NACIMIENTO' + 'DELETE '#10' FROM'#10' VENDEDORES_DATOS'#10' WHERE'#10' (ID_VENDEDOR = :' +
', CATEGORIA, FECHA_ALTA_EMPRESA, FORMACION_BASE,'#10' FORMACION_C' + 'OLD_ID_VENDEDOR)'#10
'OMPLE, FORMACION_RECIBIDA, EXPERIENCIA, ID_USUARIO)'#10' VALUES'#10' ' +
' (:ID_EMPLEADO, :FECHA_NACIMIENTO, :CATEGORIA, :FECHA_ALTA_EMPRE' +
'SA, :FORMACION_BASE,'#10' :FORMACION_COMPLE, :FORMACION_RECIBIDA,' +
' :EXPERIENCIA, :ID_USUARIO)'#10
StatementType = stSQL StatementType = stSQL
ColumnMappings = <> ColumnMappings = <>
end> end>
Name = 'Insert_EmpleadosDatos' Name = 'Delete_VendedoresDatos'
end end
item item
Params = < Params = <
item item
Name = 'FECHA_NACIMIENTO' Name = 'ID_VENDEDOR'
Value = ''
end
item
Name = 'CATEGORIA'
Value = ''
end
item
Name = 'FECHA_ALTA_EMPRESA'
Value = ''
end
item
Name = 'FORMACION_BASE'
Value = ''
end
item
Name = 'FORMACION_COMPLE'
Value = ''
end
item
Name = 'FORMACION_RECIBIDA'
Value = ''
end
item
Name = 'EXPERIENCIA'
Value = '' Value = ''
end end
item item
@ -3455,24 +3286,47 @@ object srvContactos: TsrvContactos
Value = '' Value = ''
end end
item item
Name = 'OLD_ID_EMPLEADO' Name = 'COMISION'
Value = '' Value = ''
end> end>
Statements = < Statements = <
item item
Connection = 'IBX' Connection = 'IBX'
TargetTable = 'EMPLEADOS_DATOS' TargetTable = 'VENDEDORES_DATOS'
SQL = SQL =
'UPDATE EMPLEADOS_DATOS'#10' SET '#10' FECHA_NACIMIENTO = :FECHA_NACI' + 'INSERT'#10' INTO VENDEDORES_DATOS'#10' (ID_VENDEDOR, ID_USUARIO, COM' +
'MIENTO,'#10' CATEGORIA = :CATEGORIA,'#10' FECHA_ALTA_EMPRESA = :FE' + 'ISION)'#10' VALUES'#10' (:ID_VENDEDOR, :ID_USUARIO, :COMISION)'#10
'CHA_ALTA_EMPRESA,'#10' FORMACION_BASE = :FORMACION_BASE,'#10' FORM' +
'ACION_COMPLE = :FORMACION_COMPLE,'#10' FORMACION_RECIBIDA = :FORM' +
'ACION_RECIBIDA,'#10' EXPERIENCIA = :EXPERIENCIA,'#10' ID_USUARIO =' +
' :ID_USUARIO'#10' WHERE'#10' (ID_EMPLEADO = :OLD_ID_EMPLEADO)'#10
StatementType = stSQL StatementType = stSQL
ColumnMappings = <> ColumnMappings = <>
end> end>
Name = 'Update_EmpleadosDatos' Name = 'Insert_VendedoresDatos'
end
item
Params = <
item
Name = 'ID_USUARIO'
Value = ''
end
item
Name = 'COMISION'
Value = ''
end
item
Name = 'OLD_ID_VENDEDOR'
Value = ''
end>
Statements = <
item
Connection = 'IBX'
TargetTable = 'VENDEDORES_DATOS'
SQL =
'UPDATE VENDEDORES_DATOS'#10' SET '#10' ID_USUARIO = :ID_USUARIO,'#10' ' +
' COMISION = :COMISION'#10' WHERE'#10' (ID_VENDEDOR = :OLD_ID_VENDEDO' +
'R)'#10
StatementType = stSQL
ColumnMappings = <>
end>
Name = 'Update_VendedoresDatos'
end end
item item
Params = < Params = <
@ -3660,7 +3514,7 @@ object srvContactos: TsrvContactos
end end
item item
Name = 'FK_DireccionesContacto_Empleados' Name = 'FK_DireccionesContacto_Empleados'
MasterDatasetName = 'Empleados' MasterDatasetName = 'Vendedores'
MasterFields = 'ID' MasterFields = 'ID'
DetailDatasetName = 'DireccionesContacto' DetailDatasetName = 'DireccionesContacto'
DetailFields = 'ID_CONTACTO' DetailFields = 'ID_CONTACTO'
@ -3668,7 +3522,7 @@ object srvContactos: TsrvContactos
end end
item item
Name = 'FK_DatosBancarios_Empleados' Name = 'FK_DatosBancarios_Empleados'
MasterDatasetName = 'Empleados' MasterDatasetName = 'Vendedores'
MasterFields = 'ID' MasterFields = 'ID'
DetailDatasetName = 'DatosBancarios' DetailDatasetName = 'DatosBancarios'
DetailFields = 'ID_CONTACTO' DetailFields = 'ID_CONTACTO'
@ -4504,13 +4358,13 @@ object srvContactos: TsrvContactos
Left = 224 Left = 224
Top = 79 Top = 79
end end
object bpEmpleados: TDABusinessProcessor object bpVendedores: TDABusinessProcessor
Schema = schContactos Schema = schContactos
InsertCommandName = 'Insert_Contactos' InsertCommandName = 'Insert_Contactos'
DeleteCommandName = 'Delete_Contactos' DeleteCommandName = 'Delete_Contactos'
UpdateCommandName = 'Update_Contactos' UpdateCommandName = 'Update_Contactos'
RefreshDatasetName = 'Contactos_Refresh' RefreshDatasetName = 'Contactos_Refresh'
ReferencedDataset = 'Empleados' ReferencedDataset = 'Vendedores'
ProcessorOptions = [poPrepareCommands] ProcessorOptions = [poPrepareCommands]
UpdateMode = updWhereKeyOnly UpdateMode = updWhereKeyOnly
Left = 344 Left = 344

View File

@ -25,7 +25,7 @@ type
Diagrams: TDADiagrams; Diagrams: TDADiagrams;
bpContactos: TDABusinessProcessor; bpContactos: TDABusinessProcessor;
bpDatosBancarios: TDABusinessProcessor; bpDatosBancarios: TDABusinessProcessor;
bpEmpleados: TDABusinessProcessor; bpVendedores: TDABusinessProcessor;
bpClientes: TDABusinessProcessor; bpClientes: TDABusinessProcessor;
bpProveedores: TDABusinessProcessor; bpProveedores: TDABusinessProcessor;
bpDireccionesContacto: TDABusinessProcessor; bpDireccionesContacto: TDABusinessProcessor;
@ -40,7 +40,6 @@ type
procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject;
var aConnectionName: string); var aConnectionName: string);
public public
function GenerateFichaEmpleadoReport(const EmpleadoID: String): Binary;
function GenerateEtiquetasReport(const ContactosID: String): Binary; function GenerateEtiquetasReport(const ContactosID: String): Binary;
end; end;
@ -50,9 +49,9 @@ implementation
uses uses
{Generated:} FactuGES_Invk, Dialogs, uBizContactosServer, {Generated:} FactuGES_Invk, Dialogs, uBizContactosServer,
uDataModuleServer, uDatabaseUtils, uUsersManager, uDataModuleServer, uDatabaseUtils, uUsersManager,
schContactosClient_Intf, uBizEmpleadosServer, schContactosClient_Intf, uBizVendedoresServer,
uBizClientesServer, uBizProveedoresServer, uRestriccionesUsuarioUtils, uBizClientesServer, uBizProveedoresServer, uRestriccionesUsuarioUtils,
uRptFichasEmpleado_Server, uRptEtiquetasContacto_Server; uRptEtiquetasContacto_Server;
procedure Create_srvContactos(out anInstance : IUnknown); procedure Create_srvContactos(out anInstance : IUnknown);
begin begin
@ -70,7 +69,6 @@ begin
(DataSet.Name <> nme_ProcedenciasCliente) and (DataSet.Name <> nme_ProcedenciasCliente) and
(DataSet.Name <> nme_GruposCliente) and (DataSet.Name <> nme_GruposCliente) and
(DataSet.Name <> nme_GruposProveedor) and (DataSet.Name <> nme_GruposProveedor) and
(DataSet.Name <> nme_GruposEmpleado) and
(DataSet.Name <> nme_ClientesDescuentos) then (DataSet.Name <> nme_ClientesDescuentos) then
begin begin
{ Aquí se asegura que el usuario sólo accede a contactos { Aquí se asegura que el usuario sólo accede a contactos
@ -85,7 +83,7 @@ begin
SessionManager := dmServer.SessionManager; SessionManager := dmServer.SessionManager;
bpContactos.BusinessRulesID := BIZ_SERVER_CONTACTO; bpContactos.BusinessRulesID := BIZ_SERVER_CONTACTO;
bpEmpleados.BusinessRulesID := BIZ_SERVER_EMPLEADO; bpVendedores.BusinessRulesID := BIZ_SERVER_VENDEDOR;
bpClientes.BusinessRulesID := BIZ_SERVER_CLIENTE; bpClientes.BusinessRulesID := BIZ_SERVER_CLIENTE;
bpProveedores.BusinessRulesID := BIZ_SERVER_PROVEEDOR; bpProveedores.BusinessRulesID := BIZ_SERVER_PROVEEDOR;
end; end;
@ -108,18 +106,6 @@ begin
end; end;
end; end;
function TsrvContactos.GenerateFichaEmpleadoReport(const EmpleadoID: String): Binary;
var
AReportGenerator : TRptFichasEmpleado;
begin
AReportGenerator := TRptFichasEmpleado.Create(nil);
try
Result := AReportGenerator.GenerarFicha(EmpleadoID);
finally
FreeAndNIL(AReportGenerator);
end;
end;
initialization initialization
TROClassFactory.Create('srvContactos', Create_srvContactos, TsrvContactos_Invoker); TROClassFactory.Create('srvContactos', Create_srvContactos, TsrvContactos_Invoker);

View File

@ -42,7 +42,7 @@
<Borland.Personality>Delphi.Personality</Borland.Personality> <Borland.Personality>Delphi.Personality</Borland.Personality>
<Borland.ProjectType>Package</Borland.ProjectType> <Borland.ProjectType>Package</Borland.ProjectType>
<BorlandProject> <BorlandProject>
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="ImplicitBuild">True</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">False</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">Contactos_view.dpk</Source></Source></Delphi.Personality></BorlandProject></BorlandProject> <BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Package_Options><Package_Options Name="ImplicitBuild">False</Package_Options><Package_Options Name="DesigntimeOnly">False</Package_Options><Package_Options Name="RuntimeOnly">False</Package_Options></Package_Options><VersionInfo><VersionInfo Name="IncludeVerInfo">True</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">3082</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">Contactos_view.dpk</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
</ProjectExtensions> </ProjectExtensions>
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" /> <Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
<ItemGroup> <ItemGroup>
@ -52,21 +52,40 @@
<DCCReference Include="adortl.dcp" /> <DCCReference Include="adortl.dcp" />
<DCCReference Include="ApplicationBase.dcp" /> <DCCReference Include="ApplicationBase.dcp" />
<DCCReference Include="Base.dcp" /> <DCCReference Include="Base.dcp" />
<DCCReference Include="bdertl.dcp" />
<DCCReference Include="ccpackD11.dcp" /> <DCCReference Include="ccpackD11.dcp" />
<DCCReference Include="cfpack_d11.dcp" /> <DCCReference Include="cfpack_d11.dcp" />
<DCCReference Include="Contactos_controller.dcp" /> <DCCReference Include="Contactos_controller.dcp" />
<DCCReference Include="Contactos_model.dcp" /> <DCCReference Include="Contactos_model.dcp" />
<DCCReference Include="cxDataD11.dcp" />
<DCCReference Include="cxEditorsD11.dcp" />
<DCCReference Include="cxLibraryD11.dcp" />
<DCCReference Include="DataAbstract_Core_D11.dcp" /> <DCCReference Include="DataAbstract_Core_D11.dcp" />
<DCCReference Include="dbrtl.dcp" /> <DCCReference Include="dbrtl.dcp" />
<DCCReference Include="designide.dcp" /> <DCCReference Include="designide.dcp" />
<DCCReference Include="dsnap.dcp" /> <DCCReference Include="dsnap.dcp" />
<DCCReference Include="dxComnD11.dcp" />
<DCCReference Include="dxGDIPlusD11.dcp" />
<DCCReference Include="dxLayoutControlD11.dcp" />
<DCCReference Include="dxThemeD11.dcp" />
<DCCReference Include="FormasPago_controller.dcp" /> <DCCReference Include="FormasPago_controller.dcp" />
<DCCReference Include="FormasPago_model.dcp" /> <DCCReference Include="FormasPago_model.dcp" />
<DCCReference Include="GUIBase.dcp" /> <DCCReference Include="GUIBase.dcp" />
<DCCReference Include="GUISDK_D11.dcp" /> <DCCReference Include="GUISDK_D11.dcp" />
<DCCReference Include="Jcl.dcp" />
<DCCReference Include="JclVcl.dcp" />
<DCCReference Include="JSDialog100.dcp" />
<DCCReference Include="JvCoreD11R.dcp" />
<DCCReference Include="JvGlobusD11R.dcp" /> <DCCReference Include="JvGlobusD11R.dcp" />
<DCCReference Include="JvPageCompsD11R.dcp" />
<DCCReference Include="JvStdCtrlsD11R.dcp" />
<DCCReference Include="JvSystemD11R.dcp" />
<DCCReference Include="PngComponentsD10.dcp" />
<DCCReference Include="PNG_D10.dcp" />
<DCCReference Include="RemObjects_Core_D11.dcp" /> <DCCReference Include="RemObjects_Core_D11.dcp" />
<DCCReference Include="rtl.dcp" /> <DCCReference Include="rtl.dcp" />
<DCCReference Include="tb2k_d10.dcp" />
<DCCReference Include="tbx_d10.dcp" />
<DCCReference Include="TiposIVA_controller.dcp" /> <DCCReference Include="TiposIVA_controller.dcp" />
<DCCReference Include="TiposIVA_model.dcp" /> <DCCReference Include="TiposIVA_model.dcp" />
<DCCReference Include="uContactosViewRegister.pas" /> <DCCReference Include="uContactosViewRegister.pas" />
@ -97,30 +116,18 @@
<Form>fEditorElegirProveedores</Form> <Form>fEditorElegirProveedores</Form>
<DesignClass>TCustomEditor</DesignClass> <DesignClass>TCustomEditor</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uEditorEmpleado.pas"> <DCCReference Include="uEditorElegirVendedores.pas">
<Form>fEditorEmpleado</Form> <Form>fEditorElegirVendedores</Form>
<DesignClass>TCustomEditor</DesignClass>
</DCCReference>
<DCCReference Include="uEditorEmpleados.pas">
<Form>fEditorEmpleados</Form>
<DesignClass>TCustomEditor</DesignClass> <DesignClass>TCustomEditor</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uEditorEtiquetasContactosReport.pas"> <DCCReference Include="uEditorEtiquetasContactosReport.pas">
<Form>fEditorEtiquetasContactosReport</Form> <Form>fEditorEtiquetasContactosReport</Form>
<DesignClass>TCustomEditor</DesignClass> <DesignClass>TCustomEditor</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uEditorFichasEmpleadoReport.pas">
<Form>fEditorFichasEmpleadoReport</Form>
<DesignClass>TCustomEditor</DesignClass>
</DCCReference>
<DCCReference Include="uEditorGruposCliente.pas"> <DCCReference Include="uEditorGruposCliente.pas">
<Form>fEditorGruposCliente</Form> <Form>fEditorGruposCliente</Form>
<DesignClass>TCustomEditor</DesignClass> <DesignClass>TCustomEditor</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uEditorGruposEmpleado.pas">
<Form>fEditorGruposEmpleado</Form>
<DesignClass>TCustomEditor</DesignClass>
</DCCReference>
<DCCReference Include="uEditorGruposProveedor.pas"> <DCCReference Include="uEditorGruposProveedor.pas">
<Form>fEditorGruposProveedor</Form> <Form>fEditorGruposProveedor</Form>
<DesignClass>TCustomEditor</DesignClass> <DesignClass>TCustomEditor</DesignClass>
@ -137,6 +144,14 @@
<Form>fEditorProveedores</Form> <Form>fEditorProveedores</Form>
<DesignClass>TCustomEditor</DesignClass> <DesignClass>TCustomEditor</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uEditorVendedor.pas">
<Form>fEditorProcedenciasCliente</Form>
<DesignClass>TCustomEditor</DesignClass>
</DCCReference>
<DCCReference Include="uEditorVendedores.pas">
<Form>fEditorVendedores</Form>
<DesignClass>TCustomEditor</DesignClass>
</DCCReference>
<DCCReference Include="uViewCliente.pas"> <DCCReference Include="uViewCliente.pas">
<Form>frViewCliente</Form> <Form>frViewCliente</Form>
<DesignClass>TCustomView</DesignClass> <DesignClass>TCustomView</DesignClass>
@ -177,14 +192,6 @@
<Form>frViewDireccionesEntrega</Form> <Form>frViewDireccionesEntrega</Form>
<DesignClass>TFrame</DesignClass> <DesignClass>TFrame</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uViewEmpleado.pas">
<Form>frViewEmpleado</Form>
<DesignClass>TCustomView</DesignClass>
</DCCReference>
<DCCReference Include="uViewEmpleados.pas">
<Form>frViewEmpleados</Form>
<DesignClass>TCustomView</DesignClass>
</DCCReference>
<DCCReference Include="uViewProveedor.pas"> <DCCReference Include="uViewProveedor.pas">
<Form>frViewProveedor</Form> <Form>frViewProveedor</Form>
<DesignClass>TCustomView</DesignClass> <DesignClass>TCustomView</DesignClass>
@ -201,9 +208,18 @@
<Form>frViewSubCuentaContacto</Form> <Form>frViewSubCuentaContacto</Form>
<DesignClass>TCustomView</DesignClass> <DesignClass>TCustomView</DesignClass>
</DCCReference> </DCCReference>
<DCCReference Include="uViewVendedor.pas">
<Form>frViewVendedor</Form>
<DesignClass>TCustomView</DesignClass>
</DCCReference>
<DCCReference Include="uViewVendedores.pas">
<Form>frViewVendedores</Form>
<DesignClass>TCustomView</DesignClass>
</DCCReference>
<DCCReference Include="vcl.dcp" /> <DCCReference Include="vcl.dcp" />
<DCCReference Include="vclactnband.dcp" /> <DCCReference Include="vclactnband.dcp" />
<DCCReference Include="vcldb.dcp" /> <DCCReference Include="vcldb.dcp" />
<DCCReference Include="vcljpg.dcp" />
<DCCReference Include="vclx.dcp" /> <DCCReference Include="vclx.dcp" />
<DCCReference Include="xmlrtl.dcp" /> <DCCReference Include="xmlrtl.dcp" />
</ItemGroup> </ItemGroup>

View File

@ -10,34 +10,32 @@ implementation
uses uses
uEditorRegistryUtils, uEditorRegistryUtils,
uEditorClientes, uEditorProveedores, uEditorClientes, uEditorProveedores,
uEditorEmpleados, uEditorElegirCLientes, uEditorVendedores, uEditorElegirCLientes,
uEditorCliente, uEditorProveedor, uEditorCliente, uEditorProveedor,
uEditorEmpleado, uEditorElegirProveedores, uEditorDireccion, uEditorVendedor, uEditorElegirProveedores, uEditorDireccion,
uEditorGruposCliente, uEditorProcedenciasCliente, uEditorElegirVendedores, uEditorGruposCliente, uEditorProcedenciasCliente,
uEditorGruposProveedor, uEditorGruposEmpleado, uEditorGruposProveedor, uEditorEtiquetasContactosReport;
uEditorFichasEmpleadoReport, uEditorEtiquetasContactosReport;
procedure RegisterViews; procedure RegisterViews;
begin begin
EditorRegistry.RegisterClass(TfEditorClientes, 'EditorClientes'); EditorRegistry.RegisterClass(TfEditorClientes, 'EditorClientes');
EditorRegistry.RegisterClass(TfEditorProveedores, 'EditorProveedores'); EditorRegistry.RegisterClass(TfEditorProveedores, 'EditorProveedores');
EditorRegistry.RegisterClass(TfEditorEmpleados, 'EditorEmpleados'); EditorRegistry.RegisterClass(TfEditorVendedores, 'EditorVendedores');
EditorRegistry.RegisterClass(TfEditorCliente, 'EditorCliente'); EditorRegistry.RegisterClass(TfEditorCliente, 'EditorCliente');
EditorRegistry.RegisterClass(TfEditorProveedor, 'EditorProveedor'); EditorRegistry.RegisterClass(TfEditorProveedor, 'EditorProveedor');
EditorRegistry.RegisterClass(TfEditorEmpleado, 'EditorEmpleado'); EditorRegistry.RegisterClass(TfEditorVendedor, 'EditorVendedor');
EditorRegistry.RegisterClass(TfEditorElegirClientes, 'EditorElegirClientes'); EditorRegistry.RegisterClass(TfEditorElegirClientes, 'EditorElegirClientes');
EditorRegistry.RegisterClass(TfEditorElegirProveedores, 'EditorElegirProveedores'); EditorRegistry.RegisterClass(TfEditorElegirProveedores, 'EditorElegirProveedores');
EditorRegistry.RegisterClass(TfEditorElegirVendedores, 'EditorElegirVendedores');
EditorRegistry.RegisterClass(TfEditorDireccion, 'EditorDireccion'); EditorRegistry.RegisterClass(TfEditorDireccion, 'EditorDireccion');
EditorRegistry.RegisterClass(TfEditorGruposCliente, 'EditorGruposCliente'); EditorRegistry.RegisterClass(TfEditorGruposCliente, 'EditorGruposCliente');
EditorRegistry.RegisterClass(TfEditorProcedenciasCliente, 'EditorProcedenciasCliente'); EditorRegistry.RegisterClass(TfEditorProcedenciasCliente, 'EditorProcedenciasCliente');
EditorRegistry.RegisterClass(TfEditorGruposProveedor, 'EditorGruposProveedor'); EditorRegistry.RegisterClass(TfEditorGruposProveedor, 'EditorGruposProveedor');
EditorRegistry.RegisterClass(TfEditorGruposEmpleado, 'EditorGruposEmpleado');
EditorRegistry.RegisterClass(TfEditorFichasEmpleadoPreview, 'EditorFichasEmpleadoPreview');
EditorRegistry.RegisterClass(TfEditorEtiquetasContactosPreview, 'EditorEtiquetasContactosPreview'); EditorRegistry.RegisterClass(TfEditorEtiquetasContactosPreview, 'EditorEtiquetasContactosPreview');
end; end;
@ -45,23 +43,22 @@ procedure UnregisterViews;
begin begin
EditorRegistry.UnRegisterClass(TfEditorClientes); EditorRegistry.UnRegisterClass(TfEditorClientes);
EditorRegistry.UnRegisterClass(TfEditorProveedores); EditorRegistry.UnRegisterClass(TfEditorProveedores);
EditorRegistry.UnRegisterClass(TfEditorEmpleados); EditorRegistry.UnRegisterClass(TfEditorVendedores);
EditorRegistry.UnRegisterClass(TfEditorCliente); EditorRegistry.UnRegisterClass(TfEditorCliente);
EditorRegistry.UnRegisterClass(TfEditorProveedor); EditorRegistry.UnRegisterClass(TfEditorProveedor);
EditorRegistry.UnRegisterClass(TfEditorEmpleado); EditorRegistry.UnRegisterClass(TfEditorVendedor);
EditorRegistry.UnRegisterClass(TfEditorElegirClientes); EditorRegistry.UnRegisterClass(TfEditorElegirClientes);
EditorRegistry.UnRegisterClass(TfEditorElegirProveedores); EditorRegistry.UnRegisterClass(TfEditorElegirProveedores);
EditorRegistry.UnRegisterClass(TfEditorElegirVendedores);
EditorRegistry.UnRegisterClass(TfEditorDireccion); EditorRegistry.UnRegisterClass(TfEditorDireccion);
EditorRegistry.UnRegisterClass(TfEditorGruposCliente); EditorRegistry.UnRegisterClass(TfEditorGruposCliente);
EditorRegistry.UnRegisterClass(TfEditorProcedenciasCliente); EditorRegistry.UnRegisterClass(TfEditorProcedenciasCliente);
EditorRegistry.UnRegisterClass(TfEditorGruposProveedor); EditorRegistry.UnRegisterClass(TfEditorGruposProveedor);
EditorRegistry.UnRegisterClass(TfEditorGruposEmpleado);
EditorRegistry.UnRegisterClass(TfEditorFichasEmpleadoPreview);
EditorRegistry.UnRegisterClass(TfEditorEtiquetasContactosPreview); EditorRegistry.UnRegisterClass(TfEditorEtiquetasContactosPreview);
end; end;

View File

@ -11,7 +11,7 @@ uses
uViewBase, JvAppStorage, JvAppRegistryStorage, uViewBase, JvAppStorage, JvAppRegistryStorage,
JvFormPlacement, ExtCtrls, pngimage, JvComponentBase, uViewContacto, StdCtrls, JvFormPlacement, ExtCtrls, pngimage, JvComponentBase, uViewContacto, StdCtrls,
uIEditorCliente, TBXStatusBars, JvExComCtrls, JvStatusBar, uViewEmpleado, uIEditorCliente, TBXStatusBars, JvExComCtrls, JvStatusBar,
uViewDireccionesEntrega, uViewDetallesGenerico, uViewClienteDescuentos, uViewDireccionesEntrega, uViewDetallesGenerico, uViewClienteDescuentos,
uViewContactoDatosBancarios, dxLayoutLookAndFeels, uViewContactoDatosBancarios, dxLayoutLookAndFeels,
uViewClienteDatosComerciales, uDAInterfaces, uViewSubCuentaContacto; uViewClienteDatosComerciales, uDAInterfaces, uViewSubCuentaContacto;

View File

@ -166,8 +166,8 @@ inherited fEditorElegirClientes: TfEditorElegirClientes
Width = 663 Width = 663
ExplicitWidth = 663 ExplicitWidth = 663
inherited edtFechaFinFiltro: TcxDateEdit inherited edtFechaFinFiltro: TcxDateEdit
ExplicitWidth = 314 ExplicitWidth = 232
Width = 314 Width = 232
end end
end end
inherited TBXAlignmentPanel1: TTBXAlignmentPanel inherited TBXAlignmentPanel1: TTBXAlignmentPanel
@ -191,6 +191,7 @@ inherited fEditorElegirClientes: TfEditorElegirClientes
ExplicitWidth = 663 ExplicitWidth = 663
inherited TBXToolbar1: TTBXToolbar inherited TBXToolbar1: TTBXToolbar
Width = 653 Width = 653
ExplicitWidth = 653
end end
end end
end end

View File

@ -0,0 +1,215 @@
inherited fEditorElegirVendedores: TfEditorElegirVendedores
Caption = 'fEditorElegirVendedores'
PixelsPerInch = 96
TextHeight = 13
object JvgWizardHeader1: TJvgWizardHeader [0]
Left = 0
Top = 27
Width = 786
Height = 60
CaptionFont.Charset = DEFAULT_CHARSET
CaptionFont.Color = clWindowText
CaptionFont.Height = -11
CaptionFont.Name = 'Tahoma'
CaptionFont.Style = [fsBold]
CommentFont.Charset = DEFAULT_CHARSET
CommentFont.Color = clWindowText
CommentFont.Height = -11
CommentFont.Name = 'Tahoma'
CommentFont.Style = []
SymbolFont.Charset = DEFAULT_CHARSET
SymbolFont.Color = clHighlightText
SymbolFont.Height = -35
SymbolFont.Name = 'Wingdings'
SymbolFont.Style = [fsBold]
Captions.Strings = (
'Seleccione el vendedor')
Comments.Strings = (
' ')
Gradient.FromColor = clHighlight
Gradient.ToColor = clWindow
Gradient.Active = False
Gradient.Orientation = fgdVertical
BufferedDraw = True
ExplicitTop = -33
end
inherited TBXDock: TTBXDock
Top = 87
ExplicitTop = 87
inherited tbxMain: TTBXToolbar
ExplicitWidth = 284
inherited TBXItem2: TTBXItem
Images = frViewVendedores1.PngImageList
end
end
end
inherited frViewVendedores1: TfrViewVendedores
Top = 162
Height = 227
ExplicitTop = 162
ExplicitHeight = 227
inherited cxGrid: TcxGrid
Height = 99
ExplicitHeight = 99
inherited cxGridView: TcxGridDBTableView
DataController.Summary.FooterSummaryItems = <
item
Format = '0 vendedores'
Kind = skCount
FieldName = 'ID'
Column = frViewVendedores1.cxGridViewNIF_CIF
end>
end
end
inherited frViewFiltroBase1: TfrViewFiltroBase
inherited TBXDockablePanel1: TTBXDockablePanel
inherited dxLayoutControl1: TdxLayoutControl
inherited txtFiltroTodo: TcxTextEdit
ExplicitWidth = 273
Width = 273
end
inherited edtFechaIniFiltro: TcxDateEdit
ExplicitWidth = 121
Width = 121
end
inherited edtFechaFinFiltro: TcxDateEdit
ExplicitWidth = 201
Width = 201
end
end
end
inherited ActionList1: TActionList
inherited actQuitarFiltro: TAction
OnExecute = nil
end
end
end
inherited pnlAgrupaciones: TTBXDockablePanel
Top = 201
ExplicitTop = 201
end
inherited dxComponentPrinter: TdxComponentPrinter
inherited dxComponentPrinterLink: TdxGridReportLink
BuiltInReportLink = True
end
end
inherited cxViewGridPopupMenu: TcxGridPopupMenu
PopupMenus = <
item
GridView = frViewVendedores1.cxGridView
HitTypes = [gvhtCell]
Index = 0
end>
end
inherited dxPrintStyleManager1: TdxPrintStyleManager
inherited dxPrintStyleManager1Style1: TdxPSPrintStyle
BuiltInStyle = True
end
end
end
inline frViewBarraSeleccion1: TfrViewBarraSeleccion [5]
Left = 0
Top = 389
Width = 786
Height = 36
Align = alBottom
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 4
ReadOnly = False
ExplicitTop = 389
ExplicitWidth = 786
ExplicitHeight = 36
inherited JvFooter1: TJvFooter
Width = 786
Height = 36
Align = alBottom
ExplicitWidth = 786
ExplicitHeight = 36
inherited bSeleccionar: TJvFooterBtn
Left = 574
Top = 3
ModalResult = 0
ExplicitLeft = 471
ExplicitTop = 3
end
inherited bCancelar: TJvFooterBtn
Left = 678
Top = 4
ExplicitLeft = 678
ExplicitTop = 4
end
end
inherited BarraSeleccionActionList: TActionList
inherited actSeleccionar: TAction
OnExecute = frViewBarraSeleccion1actSeleccionarExecute
OnUpdate = frViewBarraSeleccion1actSeleccionarUpdate
end
inherited actCancelar: TAction
OnExecute = frViewBarraSeleccion1actCancelarExecute
end
end
end
inherited EditorActionList: TActionList [6]
inherited actNuevo: TAction
Visible = False
end
inherited actModificar: TAction
Visible = False
end
inherited actEliminar: TAction
Visible = False
end
inherited actRefrescar: TAction
Visible = False
end
inherited actDuplicar: TAction
Visible = False
end
end
inherited SmallImages: TPngImageList [7]
end
inherited LargeImages: TPngImageList [8]
end
inherited JvFormStorage: TJvFormStorage [9]
end
inherited JvAppRegistryStorage: TJvAppRegistryStorage [10]
end
inherited dsDataTable: TDADataSource [11]
end
inherited StatusBarImages: TPngImageList [12]
end
inherited GridPopupMenu: TPopupMenu [13]
end
inherited JsPrevisualizarDialog: TJSDialog [14]
end
inherited JsImprimirDialog: TJSDialog [15]
end
object EditorSeleccionActionList: TActionList
Images = SmallImages
Left = 232
Top = 128
object actBuscar2: TAction
Category = 'Buscar'
Caption = 'Buscar'
ImageIndex = 10
ShortCut = 114
end
object actQuitarFiltro2: TAction
Category = 'Buscar'
Caption = 'Quitar filtro y ver todo'
ImageIndex = 19
OnExecute = actQuitarFiltro2Execute
end
object actAnchoAuto2: TAction
Category = 'Ver'
Caption = 'Ancho autom'#225'tico'
ImageIndex = 21
OnExecute = actAnchoAuto2Execute
end
end
end

View File

@ -0,0 +1,119 @@
unit uEditorElegirVendedores;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uEditorVendedores, JSDialog, Menus, DB, uDAInterfaces, uDADataTable,
JvAppStorage, JvAppRegistryStorage, JvComponentBase, JvFormPlacement, ImgList,
PngImageList, StdActns, ActnList, uCustomView, uViewBase, uViewGridBase,
uViewGrid, uViewContactos, uViewVendedores, ComCtrls, JvExComCtrls,
JvStatusBar, TBX, TB2ExtItems, TBXExtItems, TB2Item, TB2Dock, TB2Toolbar,
pngimage, ExtCtrls, JvExControls, JvNavigationPane, uViewBarraSeleccion,
uBizContactos, JvgWizardHeader, uIEditorElegirVendedores;
type
TfEditorElegirVendedores = class(TfEditorVendedores, IEditorElegirVendedores)
frViewBarraSeleccion1: TfrViewBarraSeleccion;
EditorSeleccionActionList: TActionList;
actBuscar2: TAction;
actQuitarFiltro2: TAction;
actAnchoAuto2: TAction;
JvgWizardHeader1: TJvgWizardHeader;
procedure frViewBarraSeleccion1actSeleccionarUpdate(Sender: TObject);
procedure frViewBarraSeleccion1actCancelarExecute(Sender: TObject);
procedure actQuitarFiltro2Execute(Sender: TObject);
procedure actAnchoAuto2Execute(Sender: TObject);
procedure frViewBarraSeleccion1actSeleccionarExecute(Sender: TObject);
protected
procedure SetMultiSelect (AValue : Boolean);
function GetMultiSelect : Boolean;
function GetContactosSeleccionados: IBizContacto;
procedure SetViewGrid(const Value: IViewGridBase); override;
procedure SetMensaje (const AValue: String);
function GetMensaje: String;
public
property Mensaje : String read GetMensaje write SetMensaje;
property ContactosSeleccionados: IBizContacto read GetContactosSeleccionados;
property MultiSelect : Boolean read GetMultiSelect write SetMultiSelect;
end;
implementation
{$R *.dfm}
uses cxControls, uDBSelectionListUtils, uGridUtils;
procedure TfEditorElegirVendedores.actAnchoAuto2Execute(Sender: TObject);
begin
inherited;
actAnchoAuto.Execute;
end;
procedure TfEditorElegirVendedores.actQuitarFiltro2Execute(Sender: TObject);
begin
inherited;
actQuitarFiltro.Execute;
end;
procedure TfEditorElegirVendedores.frViewBarraSeleccion1actCancelarExecute(Sender: TObject);
begin
inherited;
Close;
end;
procedure TfEditorElegirVendedores.frViewBarraSeleccion1actSeleccionarExecute(
Sender: TObject);
begin
inherited;
ModalResult := mrOk;
end;
procedure TfEditorElegirVendedores.frViewBarraSeleccion1actSeleccionarUpdate(
Sender: TObject);
begin
inherited;
(Sender as TAction).Enabled := (ViewGrid._FocusedView.Controller.SelectedRowCount > 0)
end;
function TfEditorElegirVendedores.GetContactosSeleccionados: IBizContacto;
begin
ShowHourglassCursor;
try
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Contactos as ISeleccionable).SelectedRecords);
// En Contactos.SelectedRecords tengo los ID de las filas seleccionadas del grid
Result := Controller.ExtraerSeleccionados(Contactos);
finally
HideHourglassCursor;
end;
end;
function TfEditorElegirVendedores.GetMensaje: String;
begin
Result := JvgWizardHeader1.Comments.Text;
end;
function TfEditorElegirVendedores.GetMultiSelect: Boolean;
begin
Result := ViewGrid.MultiSelect;
end;
procedure TfEditorElegirVendedores.SetMensaje(const AValue: String);
begin
JvgWizardHeader1.Comments.Text := AValue;
end;
procedure TfEditorElegirVendedores.SetMultiSelect(AValue: Boolean);
begin
ViewGrid.MultiSelect := AValue;
end;
procedure TfEditorElegirVendedores.SetViewGrid(const Value: IViewGridBase);
begin
inherited;
ViewGrid.OnDblClick := frViewBarraSeleccion1.actSeleccionar.OnExecute;
end;
end.

View File

@ -1,106 +0,0 @@
unit uEditorEmpleado;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
uEditorContacto, JvAppStorage, JvAppRegistryStorage, JvComponentBase,
JvFormPlacement, DB, uDADataTable, ImgList, PngImageList, StdActns, ActnList,
ComCtrls, TBX, TB2Item, TB2Dock, TB2Toolbar, ExtCtrls, JvExControls,
JvComponent, JvNavigationPane, uCustomView, uViewBase, uViewContacto,
uViewEmpleado, uBizContactos,
uIEditorEmpleado, pngimage, TBXStatusBars, JvExComCtrls, JvStatusBar,
uViewDetallesGenerico, uViewContactoDatosBancarios, dxLayoutLookAndFeels,
dxLayoutControl, cxContainer, cxEdit, cxTextEdit, cxMemo, cxDBEdit, cxControls,
uDAInterfaces;
type
TfEditorEmpleado = class(TfEditorContacto, IEditorEmpleado)
frViewEmpleado1: TfrViewEmpleado;
pagFormacion: TTabSheet;
pagExperiencia: TTabSheet;
dxLayoutControl1Group_Root: TdxLayoutGroup;
dxLayoutControl1: TdxLayoutControl;
dxLayoutControl1Item1: TdxLayoutItem;
eFormacionBasica: TcxDBMemo;
dxLayoutControl1Group1: TdxLayoutGroup;
dxLayoutControl1Item2: TdxLayoutItem;
eFormacionComplementaria: TcxDBMemo;
dxLayoutControl1Group2: TdxLayoutGroup;
dxLayoutControl1Item3: TdxLayoutItem;
eFormacionRecibida: TcxDBMemo;
dxLayoutControl1Group3: TdxLayoutGroup;
dxLayoutControl2: TdxLayoutControl;
eExperiencia: TcxDBMemo;
dxLayoutGroup1: TdxLayoutGroup;
dxLayoutGroup3: TdxLayoutGroup;
dxLayoutItem1: TdxLayoutItem;
actGruposEmpleado: TAction;
procedure actGruposEmpleadoExecute(Sender: TObject);
protected
procedure EliminarInterno; override;
procedure SetContacto(const Value: IBizContacto); override;
public
constructor Create(AOwner: TComponent); override;
procedure PonerTitulos(const ATitulo: string = ''); override;
end;
implementation
uses
uEditorDBItem, uDialogUtils, uGruposEmpleadoController, uBizGruposEmpleado;
{$R *.dfm}
{ TfEditorEmpleado }
procedure TfEditorEmpleado.actGruposEmpleadoExecute(Sender: TObject);
var
AGruposController : IGruposEmpleadoController;
AGrupos : IBizGrupoEmpleado;
begin
AGruposController := TGruposEmpleadoController.Create;
try
AGrupos := (AGruposController.BuscarTodos as IBizGrupoEmpleado);
AGruposController.VerTodos(AGrupos);
finally
AGrupos := NIL;
AGruposController := NIL;
end;
end;
constructor TfEditorEmpleado.Create(AOwner: TComponent);
begin
inherited;
ViewContacto := frViewEmpleado1;
pagFormacion.TabVisible := False;
pagExperiencia.TabVisible := False;
end;
procedure TfEditorEmpleado.EliminarInterno;
begin
if (ShowConfirmMessage('¿Desea borrar este vendedor?', '') = IDYES) then
inherited;
end;
procedure TfEditorEmpleado.PonerTitulos(const ATitulo: string);
var
FTitulo : String;
begin
if Assigned(Contacto) then
begin
if Contacto.EsNuevo then
FTitulo := 'Nuevo vendedor'
else
FTitulo := 'Vendedor';
end;
inherited PonerTitulos(FTitulo);
end;
procedure TfEditorEmpleado.SetContacto(const Value: IBizContacto);
begin
inherited;
end;
end.

View File

@ -1,187 +0,0 @@
unit uEditorEmpleados;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
uEditorContactos, Menus, DB, uDADataTable, JvAppStorage,
JvAppRegistryStorage, JvComponentBase, JvFormPlacement, ImgList, PngImageList,
StdActns, ActnList, uCustomView, uViewBase, uViewBarraSeleccion, ComCtrls,
TB2ExtItems, TBXExtItems, TBX, TB2Item, TB2Dock, TB2Toolbar, ExtCtrls,
JvExControls, JvComponent, JvNavigationPane, uViewGridBase, uViewGrid,
uViewContactos, uViewEmpleados, uIEditorEmpleados, pngimage, TBXStatusBars,
JvExComCtrls, JvStatusBar, JSDialog, uContactosController, uDAInterfaces;
type
TfEditorEmpleados = class(TfEditorContactos, IEditorEmpleados)
frViewEmpleados1: TfrViewEmpleados;
JsPrevisualizarDialog: TJSDialog;
JsImprimirDialog: TJSDialog;
JsListaContactosNoEliminados: TJSDialog;
protected
procedure EliminarInterno; override;
procedure ImprimirInterno; override;
procedure PrevisualizarInterno; override;
public
constructor Create(AOwner: TComponent); override;
procedure PonerTitulos(const ATitulo: string = ''); override;
end;
implementation
uses
uGridUtils, uEditorGridBase, uDataModuleUsuarios, uDialogUtils, uBizContactos,
uEmpleadosController, uDBSelectionListUtils, uFactuGES_App;
{$R *.dfm}
constructor TfEditorEmpleados.Create(AOwner: TComponent);
begin
inherited;
ViewGrid := frViewEmpleados1;
end;
procedure TfEditorEmpleados.EliminarInterno;
var
AContactos: IBizContacto;
AllItems: Boolean;
begin
AContactos := Nil;
AllItems := False;
if MultiSelect and Assigned(ViewGrid) then
AllItems := (ViewGrid.NumSeleccionados > 1);
if AllItems then
begin
if (Application.MessageBox('¿Desea borrar los vendedores seleccionados?', 'Atención', MB_YESNO) = IDYES) then
begin
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Contactos as ISeleccionable).SelectedRecords);
AContactos := (Controller as IEmpleadosController).ExtraerSeleccionados(Contactos) as IBizContacto;
end
end
else begin
if (Application.MessageBox('¿Desea borrar el vendedor seleccionado?', 'Atención', MB_YESNO) = IDYES) then
AContactos := Contactos;
end;
if Assigned(AContactos) then
begin
(FController as IEmpleadosController).Eliminar(AContactos, AllItems);
if AllItems then
begin
if (AContactos.DataTable.RecordCount > 0) then
begin
with AContactos.DataTable do
begin
First;
while not EOF do
begin
JsListaContactosNoEliminados.Content.Add('Vendedor: ' + AContactos.NOMBRE);
Next;
end;
end;
JsListaContactosNoEliminados.Execute;
end;
actRefrescar.Execute;
end;
end;
ViewGrid.GotoFirst;
end;
procedure TfEditorEmpleados.ImprimirInterno;
var
Respuesta : Integer;
AFichas: IBizEmpleado;
AllItems: Boolean;
begin
{
AFichas := Nil;
AllItems := False;
if MultiSelect and Assigned(ViewGrid) then
AllItems := (ViewGrid.NumSeleccionados > 1);
//Si esta agrupado solo podré imprimir la lista de elementos visibles
if not ViewGrid.esSeleccionCeldaDatos then
inherited
else
begin
Respuesta := JsPrevisualizarDialog.Execute;
if Respuesta <> IDCANCEL then
begin
case JsPrevisualizarDialog.CustomButtonResult of
200 : begin // Lista de elementos visibles
inherited;
end;
100 : begin // Elemento Seleccionado
if AllItems then
begin
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Contactos as ISeleccionable).SelectedRecords);
AFichas := (Controller as IFacturasClienteController).ExtraerSeleccionados(Facturas) as IBizEmpleado;
end
else
AFichas := Facturas;
if Assigned(AFichas) then
FController.Preview(AFichas, AllItems);
end;
end;
end;
end;
}
end;
procedure TfEditorEmpleados.PonerTitulos(const ATitulo: string);
var
FTitulo : String;
begin
FTitulo := 'Lista de vendedores - ' + AppFactuGES.EmpresaActiva.NOMBRE;
inherited PonerTitulos(FTitulo);
end;
procedure TfEditorEmpleados.PrevisualizarInterno;
var
Respuesta : Integer;
AFichas: IBizEmpleado;
AllItems: Boolean;
begin
AFichas := Nil;
AllItems := False;
if MultiSelect and Assigned(ViewGrid) then
AllItems := (ViewGrid.NumSeleccionados > 1);
//Si esta agrupado solo podré imprimir la lista de elementos visibles
if not ViewGrid.esSeleccionCeldaDatos then
inherited
else
begin
Respuesta := JsPrevisualizarDialog.Execute;
if Respuesta <> IDCANCEL then
begin
case JsPrevisualizarDialog.CustomButtonResult of
200 : begin // Lista de elementos visibles
inherited;
end;
100 : begin // Elemento Seleccionado
if AllItems then
begin
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Contactos as ISeleccionable).SelectedRecords);
AFichas := (Controller as IEmpleadosController).ExtraerSeleccionados(Contactos) as IBizEmpleado;
end
else
AFichas := (Contactos as IBizEmpleado);
if Assigned(AFichas) then
(FController as IEmpleadosController).Preview(AFichas, AllItems);
end;
end;
end;
end;
end;
end.

View File

@ -1,11 +0,0 @@
inherited fEditorFichasEmpleadoPreview: TfEditorFichasEmpleadoPreview
Caption = 'Previsualizar la factura'
ExplicitHeight = 240
PixelsPerInch = 96
TextHeight = 13
inherited JvNavPanelHeader: TJvNavPanelHeader
inherited Image1: TImage
ExplicitLeft = 768
end
end
end

View File

@ -1,29 +0,0 @@
unit uEditorFichasEmpleadoReport;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uEditorPreview, frxExportImage, frxExportPDF, frxDCtrl, frxClass,
frxDMPExport, frxGradient, frxChBox, frxCross, frxRich, frxOLE,
frxBarcode, JvAppStorage, JvAppRegistryStorage, JvComponentBase,
JvFormPlacement, ImgList, PngImageList, StdActns, ActnList, ComCtrls,
TB2ExtItems, TBXExtItems, TBX, TB2Item, TB2Dock, TB2Toolbar, pngimage,
ExtCtrls, JvExControls, JvComponent, JvNavigationPane, uIEditorFichasEmpleadoPreview,
JvExComCtrls, JvStatusBar, frxExportText, frxExportRTF, frxExportMail,
frxExportXLS;
type
TfEditorFichasEmpleadoPreview = class(TfEditorPreview, IEditorFichasEmpleadoPreview)
private
{ Private declarations }
public
{ Public declarations }
end;
implementation
{$R *.dfm}
end.

View File

@ -1,142 +0,0 @@
object fEditorGruposEmpleado: TfEditorGruposEmpleado
Left = 453
Top = 234
ActiveControl = ListaGruposEmpleado
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'Administraci'#243'n de categor'#237'as de empleados'
ClientHeight = 499
ClientWidth = 404
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnClose = CustomEditorClose
OnShow = FormShow
InstanceID = 0
ReadOnly = False
PixelsPerInch = 96
TextHeight = 13
object bAceptar: TButton
Left = 226
Top = 464
Width = 75
Height = 25
Action = actAceptar
Default = True
TabOrder = 1
end
object bCancelar: TButton
Left = 314
Top = 464
Width = 75
Height = 25
Action = actCancelar
Cancel = True
TabOrder = 2
end
object PageControl1: TPageControl
Left = 8
Top = 8
Width = 390
Height = 442
ActivePage = TabSheet1
TabOrder = 0
object TabSheet1: TTabSheet
Caption = 'Categor'#237'as de empleado'
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object Label1: TLabel
Left = 10
Top = 12
Width = 155
Height = 13
Caption = 'Lista de categor'#237'as de empleado'
end
object ListaGruposEmpleado: TDBLookupListBox
Left = 8
Top = 31
Width = 281
Height = 277
KeyField = 'RecID'
ListField = 'DESCRIPCION'
ListSource = DADataSource
TabOrder = 0
end
object bEliminar: TButton
Left = 304
Top = 31
Width = 75
Height = 25
Action = actEliminar
TabOrder = 1
end
object GroupBox1: TGroupBox
Left = 6
Top = 318
Width = 369
Height = 84
Caption = 'A'#241'adir una nueva categoria de empleado'
TabOrder = 2
object eCategoria: TLabel
Left = 18
Top = 20
Width = 87
Height = 13
Caption = 'Nombre del grupo:'
end
object bAnadir: TButton
Left = 282
Top = 38
Width = 75
Height = 25
Action = actAnadir
TabOrder = 1
end
object editGrupoEmpleado: TEdit
Left = 18
Top = 40
Width = 255
Height = 21
TabOrder = 0
end
end
end
end
object ActionList1: TActionList
Left = 144
Top = 16
object actAnadir: TAction
Caption = '&A'#241'adir'
OnExecute = actAnadirExecute
OnUpdate = actAnadirUpdate
end
object actEliminar: TAction
Caption = '&Eliminar'
OnExecute = actEliminarExecute
OnUpdate = actEliminarUpdate
end
object actAceptar: TAction
Caption = 'A&ceptar'
OnExecute = actAceptarExecute
end
object actCancelar: TAction
Caption = '&Cancelar'
OnExecute = actCancelarExecute
end
object actCerrar: TAction
Caption = 'actCerrar'
OnExecute = actCerrarExecute
end
end
object DADataSource: TDADataSource
Left = 168
Top = 16
end
end

View File

@ -1,179 +0,0 @@
{
===============================================================================
Copyright (©) 2006. Rodax Software.
===============================================================================
Los contenidos de este fichero son propiedad de Rodax Software titular del
copyright. Este fichero sólo podrá ser copiado, distribuido y utilizado,
en su totalidad o en parte, con el permiso escrito de Rodax Software, o de
acuerdo con los términos y condiciones establecidas en el acuerdo/contrato
bajo el que se suministra.
-----------------------------------------------------------------------------
Web: www.rodax-software.com
===============================================================================
Fecha primera versión: 22-05-2006
Versión actual: 1.0.0
Fecha versión actual: 22-05-2006
===============================================================================
Modificaciones:
Fecha Comentarios
---------------------------------------------------------------------------
===============================================================================
}
unit uEditorGruposEmpleado;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, StdCtrls, DBCtrls, uDADataTable, ActnList,
uIEditorGruposEmpleado, uCustomEditor, uGUIBase, ExtCtrls,
ComCtrls, uBizGruposEmpleado, uGruposEmpleadoController, uDAInterfaces;
type
TfEditorGruposEmpleado = class(TCustomEditor, IEditorGruposEmpleado)
ActionList1: TActionList;
DADataSource: TDADataSource;
ListaGruposEmpleado: TDBLookupListBox;
editGrupoEmpleado: TEdit;
bAnadir: TButton;
actAnadir: TAction;
actEliminar: TAction;
bEliminar: TButton;
actAceptar: TAction;
actCancelar: TAction;
bAceptar: TButton;
bCancelar: TButton;
actCerrar: TAction;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
GroupBox1: TGroupBox;
Label1: TLabel;
procedure FormShow(Sender: TObject);
procedure CustomEditorClose(Sender: TObject; var Action: TCloseAction);
procedure actAnadirExecute(Sender: TObject);
procedure actEliminarExecute(Sender: TObject);
procedure actAceptarExecute(Sender: TObject);
procedure actCancelarExecute(Sender: TObject);
procedure actCerrarExecute(Sender: TObject);
procedure actAnadirUpdate(Sender: TObject);
procedure actEliminarUpdate(Sender: TObject);
protected
FGruposEmpleado: IBizGrupoEmpleado;
FController: IGruposEmpleadoController;
function GetGruposEmpleado: IBizGrupoEmpleado;
procedure SetGruposEmpleado(const Value: IBizGrupoEmpleado);
function GetController : IGruposEmpleadoController;
procedure SetController (const Value : IGruposEmpleadoController);
public
property GruposEmpleado: IBizGrupoEmpleado read GetGruposEmpleado write SetGruposEmpleado;
property Controller : IGruposEmpleadoController read GetController write SetController;
end;
implementation
{$R *.dfm}
{ TfEditorGruposEmpleado }
uses
uDialogUtils;
function TfEditorGruposEmpleado.GetController: IGruposEmpleadoController;
begin
Result := FController;
end;
function TfEditorGruposEmpleado.GetGruposEmpleado: IBizGrupoEmpleado;
begin
Result := FGruposEmpleado;
end;
procedure TfEditorGruposEmpleado.SetController(const Value: IGruposEmpleadoController);
begin
FController := Value;
end;
procedure TfEditorGruposEmpleado.SetGruposEmpleado(const Value: IBizGrupoEmpleado);
begin
FGruposEmpleado := Value;
DADataSource.DataTable := (FGruposEmpleado as IBizGrupoEmpleado).DataTable;
DADataSource.DataTable.Open;
end;
procedure TfEditorGruposEmpleado.actAnadirExecute(Sender: TObject);
begin
if not FController.Localizar(GruposEmpleado, editGrupoEmpleado.Text) then
begin
GruposEmpleado.Append;
GruposEmpleado.DESCRIPCION := editGrupoEmpleado.Text;
GruposEmpleado.Post;
editGrupoEmpleado.Clear;
ListaGruposEmpleado.SetFocus;
end
else
ShowErrorMessage('Ya existe el grupo ' + editGrupoEmpleado.Text,
'Ya existe la categoría de empleado ''' + editGrupoEmpleado.Text + ''' en la lista.');
end;
procedure TfEditorGruposEmpleado.actEliminarExecute(Sender: TObject);
begin
GruposEmpleado.Delete;
ListaGruposEmpleado.SetFocus;
end;
procedure TfEditorGruposEmpleado.actEliminarUpdate(Sender: TObject);
begin
(Sender as TAction).Enabled := (FGruposEmpleado.DataTable.RecordCount > 0) and
(Length(ListaGruposEmpleado.SelectedItem) > 0);
end;
procedure TfEditorGruposEmpleado.CustomEditorClose(Sender: TObject; var Action: TCloseAction);
begin
FGruposEmpleado := Nil;
FController := Nil;
end;
procedure TfEditorGruposEmpleado.actAceptarExecute(Sender: TObject);
begin
try
GruposEmpleado.DataTable.ApplyUpdates;
except
on E : Exception do begin
GruposEmpleado.DataTable.CancelUpdates;
ShowErrorMessage('Error al guardar cambios', 'Se ha producido un error grave', E);
exit;
end;
end;
actCerrar.Execute;
end;
procedure TfEditorGruposEmpleado.actCancelarExecute(Sender: TObject);
begin
GruposEmpleado.DataTable.CancelUpdates;
actCerrar.Execute;
end;
procedure TfEditorGruposEmpleado.actCerrarExecute(Sender: TObject);
begin
Close;
end;
procedure TfEditorGruposEmpleado.actAnadirUpdate(Sender: TObject);
begin
(Sender as TAction).Enabled := (Length(editGrupoEmpleado.Text) > 0)
end;
procedure TfEditorGruposEmpleado.FormShow(Sender: TObject);
begin
if not FGruposEmpleado.DataTable.Active then
FGruposEmpleado.DataTable.Active := true;
editGrupoEmpleado.SetFocus;
end;
end.

View File

@ -1,5 +1,5 @@
inherited fEditorEmpleado: TfEditorEmpleado inherited fEditorVendedor: TfEditorVendedor
Caption = 'fEditorEmpleado' Caption = 'fEditorVendedor'
ClientHeight = 576 ClientHeight = 576
ClientWidth = 676 ClientWidth = 676
ExplicitWidth = 684 ExplicitWidth = 684
@ -65,7 +65,7 @@ inherited fEditorEmpleado: TfEditorEmpleado
inherited pagGeneral: TTabSheet inherited pagGeneral: TTabSheet
ExplicitWidth = 662 ExplicitWidth = 662
ExplicitHeight = 447 ExplicitHeight = 447
inline frViewEmpleado1: TfrViewEmpleado inline frViewVendedor1: TfrViewVendedor
Left = 0 Left = 0
Top = 0 Top = 0
Width = 662 Width = 662
@ -137,24 +137,6 @@ inherited fEditorEmpleado: TfEditorEmpleado
Height = 94 Height = 94
Width = 618 Width = 618
end end
inherited eFechaNacimiento: TcxDBDateEdit
Top = 84
ExplicitTop = 84
ExplicitWidth = 80
Width = 80
end
inherited eFechaAltaEmpresa: TcxDBDateEdit
Top = 84
ExplicitTop = 84
ExplicitWidth = 80
Width = 80
end
inherited cbCategoria: TcxDBComboBox
Top = 111
ExplicitTop = 111
ExplicitWidth = 225
Width = 225
end
inherited eTlfParticular: TcxDBTextEdit inherited eTlfParticular: TcxDBTextEdit
Left = 430 Left = 430
Top = 57 Top = 57
@ -255,6 +237,19 @@ inherited fEditorEmpleado: TfEditorEmpleado
end end
end end
end end
inherited cbUsuario: TcxComboBox
Top = 84
ExplicitTop = 84
ExplicitWidth = 201
Width = 201
end
inherited edtComision: TcxDBSpinEdit
Top = 111
Style.IsFontAssigned = True
ExplicitTop = 111
ExplicitWidth = 65
Width = 65
end
end end
inherited dsContacto: TDADataSource inherited dsContacto: TDADataSource
Left = 8 Left = 8
@ -274,194 +269,9 @@ inherited fEditorEmpleado: TfEditorEmpleado
Width = 662 Width = 662
LookAndFeel = dxLayoutOfficeLookAndFeel LookAndFeel = dxLayoutOfficeLookAndFeel
ExplicitWidth = 662 ExplicitWidth = 662
inherited eEntidad: TcxDBTextEdit
ExplicitWidth = 114
Width = 114
end
inherited eSucursal: TcxDBTextEdit inherited eSucursal: TcxDBTextEdit
Left = 426 Left = 426
ExplicitLeft = 426 ExplicitLeft = 426
ExplicitWidth = 112
Width = 112
end
inherited eCuenta: TcxDBTextEdit
ExplicitWidth = 194
Width = 194
end
inherited eTitular: TcxDBTextEdit
ExplicitWidth = 194
Width = 194
end
end
end
end
object pagFormacion: TTabSheet
Caption = 'Formaci'#243'n'
ImageIndex = 2
object dxLayoutControl1: TdxLayoutControl
Left = 0
Top = 0
Width = 662
Height = 447
Align = alClient
ParentBackground = True
TabOrder = 0
AutoContentSizes = [acsWidth, acsHeight]
LookAndFeel = dxLayoutOfficeLookAndFeel
object eFormacionBasica: TcxDBMemo
Left = 22
Top = 30
DataBinding.DataField = 'FORMACION_BASE'
DataBinding.DataSource = frViewEmpleado1.dsContacto
Properties.ScrollBars = ssVertical
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 0
Height = 89
Width = 580
end
object eFormacionComplementaria: TcxDBMemo
Left = 22
Top = 174
DataBinding.DataField = 'FORMACION_COMPLE'
DataBinding.DataSource = frViewEmpleado1.dsContacto
Properties.ScrollBars = ssVertical
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 1
Height = 89
Width = 580
end
object eFormacionRecibida: TcxDBMemo
Left = 22
Top = 318
DataBinding.DataField = 'FORMACION_RECIBIDA'
DataBinding.DataSource = frViewEmpleado1.dsContacto
Properties.ScrollBars = ssVertical
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 2
Height = 89
Width = 580
end
object dxLayoutControl1Group_Root: TdxLayoutGroup
Caption = 'Formaci'#243'n b'#225'sica'
ShowCaption = False
Hidden = True
ShowBorder = False
object dxLayoutControl1Group1: TdxLayoutGroup
AutoAligns = [aaHorizontal]
AlignVert = avClient
Caption = 'Formaci'#243'n basica'
object dxLayoutControl1Item1: TdxLayoutItem
AutoAligns = [aaHorizontal]
AlignVert = avClient
Control = eFormacionBasica
ControlOptions.ShowBorder = False
end
end
object dxLayoutControl1Group2: TdxLayoutGroup
AutoAligns = [aaHorizontal]
AlignVert = avClient
Caption = 'Fomaci'#243'n complementaria'
object dxLayoutControl1Item2: TdxLayoutItem
AutoAligns = [aaHorizontal]
AlignVert = avClient
Control = eFormacionComplementaria
ControlOptions.ShowBorder = False
end
end
object dxLayoutControl1Group3: TdxLayoutGroup
AutoAligns = [aaHorizontal]
AlignVert = avClient
Caption = 'Formaci'#243'n recibida'
object dxLayoutControl1Item3: TdxLayoutItem
AutoAligns = [aaHorizontal]
AlignVert = avClient
Control = eFormacionRecibida
ControlOptions.ShowBorder = False
end
end
end
end
end
object pagExperiencia: TTabSheet
Caption = 'Experiencia'
ImageIndex = 3
object dxLayoutControl2: TdxLayoutControl
Left = 0
Top = 0
Width = 662
Height = 447
Align = alClient
ParentBackground = True
TabOrder = 0
AutoContentSizes = [acsWidth, acsHeight]
LookAndFeel = dxLayoutOfficeLookAndFeel
object eExperiencia: TcxDBMemo
Left = 22
Top = 30
Align = alClient
DataBinding.DataField = 'EXPERIENCIA'
DataBinding.DataSource = frViewEmpleado1.dsContacto
Properties.ScrollBars = ssVertical
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 0
Height = 89
Width = 580
end
object dxLayoutGroup1: TdxLayoutGroup
Caption = 'Formaci'#243'n b'#225'sica'
ShowCaption = False
Hidden = True
ShowBorder = False
object dxLayoutGroup3: TdxLayoutGroup
AutoAligns = [aaHorizontal]
AlignVert = avClient
Caption = 'Experiencia (Acci'#243'n formativa / Fecha / Duraci'#243'n)'
object dxLayoutItem1: TdxLayoutItem
AutoAligns = [aaHorizontal]
AlignVert = avClient
Control = eExperiencia
ControlOptions.ShowBorder = False
end
end end
end end
end end
@ -473,14 +283,6 @@ inherited fEditorEmpleado: TfEditorEmpleado
ExplicitTop = 557 ExplicitTop = 557
ExplicitWidth = 676 ExplicitWidth = 676
end end
inherited EditorActionList: TActionList
object actGruposEmpleado: TAction
Category = 'Acciones'
Caption = 'Categorias de empleado'
ImageIndex = 21
OnExecute = actGruposEmpleadoExecute
end
end
inherited SmallImages: TPngImageList inherited SmallImages: TPngImageList
PngImages = < PngImages = <
item item

View File

@ -0,0 +1,69 @@
unit uEditorVendedor;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
uEditorContacto, JvAppStorage, JvAppRegistryStorage, JvComponentBase,
JvFormPlacement, DB, uDADataTable, ImgList, PngImageList, StdActns, ActnList,
ComCtrls, TBX, TB2Item, TB2Dock, TB2Toolbar, ExtCtrls, JvExControls,
JvComponent, JvNavigationPane, uCustomView, uViewBase, uViewContacto,
uViewVendedor, uBizContactos,
uIEditorVendedor, pngimage, TBXStatusBars, JvExComCtrls, JvStatusBar,
uViewDetallesGenerico, uViewContactoDatosBancarios, dxLayoutLookAndFeels,
dxLayoutControl, cxContainer, cxEdit, cxTextEdit, cxMemo, cxDBEdit, cxControls,
uDAInterfaces;
type
TfEditorVendedor = class(TfEditorContacto, IEditorVendedor)
frViewVendedor1: TfrViewVendedor;
protected
procedure EliminarInterno; override;
procedure SetContacto(const Value: IBizContacto); override;
public
constructor Create(AOwner: TComponent); override;
procedure PonerTitulos(const ATitulo: string = ''); override;
end;
implementation
uses
uEditorDBItem, uDialogUtils;
{$R *.dfm}
{ TfEditorVendedor }
constructor TfEditorVendedor.Create(AOwner: TComponent);
begin
inherited;
ViewContacto := frViewVendedor1;
end;
procedure TfEditorVendedor.EliminarInterno;
begin
if (ShowConfirmMessage('¿Desea borrar este vendedor?', '') = IDYES) then
inherited;
end;
procedure TfEditorVendedor.PonerTitulos(const ATitulo: string);
var
FTitulo : String;
begin
if Assigned(Contacto) then
begin
if Contacto.EsNuevo then
FTitulo := 'Nuevo vendedor'
else
FTitulo := 'Vendedor';
end;
inherited PonerTitulos(FTitulo);
end;
procedure TfEditorVendedor.SetContacto(const Value: IBizContacto);
begin
inherited;
end;
end.

View File

@ -1,7 +1,8 @@
inherited fEditorEmpleados: TfEditorEmpleados inherited fEditorVendedores: TfEditorVendedores
Caption = 'fEditorEmpleados' Caption = 'fEditorVendedores'
ClientWidth = 786 ClientWidth = 786
ExplicitWidth = 794 ExplicitWidth = 794
ExplicitHeight = 478
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
inherited JvNavPanelHeader: TJvNavPanelHeader inherited JvNavPanelHeader: TJvNavPanelHeader
@ -51,7 +52,7 @@ inherited fEditorEmpleados: TfEditorEmpleados
ExplicitWidth = 632 ExplicitWidth = 632
inherited TBXItem2: TTBXItem inherited TBXItem2: TTBXItem
ImageIndex = 0 ImageIndex = 0
Images = frViewEmpleados1.PngImageList Images = frViewVendedores1.PngImageList
end end
end end
inherited tbxMenu: TTBXToolbar inherited tbxMenu: TTBXToolbar
@ -62,7 +63,7 @@ inherited fEditorEmpleados: TfEditorEmpleados
Width = 786 Width = 786
ExplicitWidth = 786 ExplicitWidth = 786
end end
inline frViewEmpleados1: TfrViewEmpleados [3] inline frViewVendedores1: TfrViewVendedores [3]
Left = 0 Left = 0
Top = 102 Top = 102
Width = 786 Width = 786
@ -90,7 +91,7 @@ inherited fEditorEmpleados: TfEditorEmpleados
Format = '0 vendedores' Format = '0 vendedores'
Kind = skCount Kind = skCount
FieldName = 'ID' FieldName = 'ID'
Column = frViewEmpleados1.cxGridViewNIF_CIF Column = frViewVendedores1.cxGridViewNIF_CIF
end> end>
end end
end end
@ -149,7 +150,7 @@ inherited fEditorEmpleados: TfEditorEmpleados
inherited cxViewGridPopupMenu: TcxGridPopupMenu inherited cxViewGridPopupMenu: TcxGridPopupMenu
PopupMenus = < PopupMenus = <
item item
GridView = frViewEmpleados1.cxGridView GridView = frViewVendedores1.cxGridView
HitTypes = [gvhtCell] HitTypes = [gvhtCell]
Index = 0 Index = 0
end> end>

View File

@ -0,0 +1,114 @@
unit uEditorVendedores;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
uEditorContactos, Menus, DB, uDADataTable, JvAppStorage,
JvAppRegistryStorage, JvComponentBase, JvFormPlacement, ImgList, PngImageList,
StdActns, ActnList, uCustomView, uViewBase, uViewBarraSeleccion, ComCtrls,
TB2ExtItems, TBXExtItems, TBX, TB2Item, TB2Dock, TB2Toolbar, ExtCtrls,
JvExControls, JvComponent, JvNavigationPane, uViewGridBase, uViewGrid,
uViewContactos, uIEditorVendedores, pngimage, TBXStatusBars,
JvExComCtrls, JvStatusBar, JSDialog, uContactosController, uDAInterfaces,
uViewVendedores;
type
TfEditorVendedores = class(TfEditorContactos, IEditorVendedores)
frViewVendedores1: TfrViewVendedores;
JsPrevisualizarDialog: TJSDialog;
JsImprimirDialog: TJSDialog;
JsListaContactosNoEliminados: TJSDialog;
protected
procedure EliminarInterno; override;
procedure ImprimirInterno; override;
procedure PrevisualizarInterno; override;
public
constructor Create(AOwner: TComponent); override;
procedure PonerTitulos(const ATitulo: string = ''); override;
end;
implementation
uses
uGridUtils, uEditorGridBase, uDataModuleUsuarios, uDialogUtils, uBizContactos,
uVendedoresController, uDBSelectionListUtils, uFactuGES_App;
{$R *.dfm}
constructor TfEditorVendedores.Create(AOwner: TComponent);
begin
inherited;
ViewGrid := frViewVendedores1;
end;
procedure TfEditorVendedores.EliminarInterno;
var
AContactos: IBizContacto;
AllItems: Boolean;
begin
AContactos := Nil;
AllItems := False;
if MultiSelect and Assigned(ViewGrid) then
AllItems := (ViewGrid.NumSeleccionados > 1);
if AllItems then
begin
if (Application.MessageBox('¿Desea borrar los vendedores seleccionados?', 'Atención', MB_YESNO) = IDYES) then
begin
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Contactos as ISeleccionable).SelectedRecords);
AContactos := (Controller as IVendedoresController).ExtraerSeleccionados(Contactos) as IBizContacto;
end
end
else begin
if (Application.MessageBox('¿Desea borrar el vendedor seleccionado?', 'Atención', MB_YESNO) = IDYES) then
AContactos := Contactos;
end;
if Assigned(AContactos) then
begin
(FController as IVendedoresController).Eliminar(AContactos, AllItems);
if AllItems then
begin
if (AContactos.DataTable.RecordCount > 0) then
begin
with AContactos.DataTable do
begin
First;
while not EOF do
begin
JsListaContactosNoEliminados.Content.Add('Vendedor: ' + AContactos.NOMBRE);
Next;
end;
end;
JsListaContactosNoEliminados.Execute;
end;
actRefrescar.Execute;
end;
end;
ViewGrid.GotoFirst;
end;
procedure TfEditorVendedores.ImprimirInterno;
begin
inherited;
end;
procedure TfEditorVendedores.PonerTitulos(const ATitulo: string);
var
FTitulo : String;
begin
FTitulo := 'Lista de vendedores - ' + AppFactuGES.EmpresaActiva.NOMBRE;
inherited PonerTitulos(FTitulo);
end;
procedure TfEditorVendedores.PrevisualizarInterno;
begin
inherited;
end;
end.

View File

@ -1,96 +0,0 @@
unit uViewEmpleado;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uViewContacto, dxLayoutLookAndFeels, DB, uDADataTable,
dxLayoutControl, cxMemo, cxDBEdit, cxContainer, cxEdit, cxTextEdit, cxControls,
cxMaskEdit, cxSpinEdit, ImgList, PngImageList, ActnList, cxHyperLinkEdit,
Buttons, PngSpeedButton, cxDropDownEdit, cxCalendar, cxGraphics, uGruposEmpleadoController,
uDAInterfaces, uCustomView, uViewBase, uViewTienda;
type
IViewEmpleado = interface(IViewContacto)
['{245F4A36-39A4-4081-9826-F05FBBC729AE}']
end;
TfrViewEmpleado = class(TfrViewContacto, IViewEmpleado)
eFechaNacimiento: TcxDBDateEdit;
dxLayoutControlContactoItem19: TdxLayoutItem;
eFechaAltaEmpresa: TcxDBDateEdit;
dxLayoutControlContactoGroup10: TdxLayoutGroup;
dxLayoutControlContactoItem20: TdxLayoutItem;
cbCategoria: TcxDBComboBox;
procedure CustomViewCreate(Sender: TObject);
procedure CustomViewDestroy(Sender: TObject);
procedure cbCategoriaPropertiesInitPopup(Sender: TObject);
procedure cbCategoriaPropertiesValidate(Sender: TObject;
var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
protected
FGrupoController: IGruposEmpleadoController;
public
{ Public declarations }
end;
implementation
{$R *.dfm}
uses
uBizGruposEmpleado, uBizContactos, uFactuGES_App;
procedure TfrViewEmpleado.cbCategoriaPropertiesInitPopup(Sender: TObject);
begin
inherited;
with cbCategoria.Properties.Items do
begin
BeginUpdate;
try
Clear;
AddStrings(FGrupoController.DarListaGruposEmpleado);
finally
EndUpdate;
end;
end;
end;
procedure TfrViewEmpleado.cbCategoriaPropertiesValidate(Sender: TObject;
var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
var
AGrupo : IBizGrupoEmpleado;
begin
inherited;
with (Sender as TcxDBComboBox) do
begin
if (Length(DisplayValue) > 0) and (DisplayValue <> (Contacto as IBizEmpleado).CATEGORIA) then
if Properties.LookupItems.IndexOf(DisplayValue) < 0 then
begin
Properties.LookupItems.BeginUpdate;
AGrupo := FGrupoController.BuscarTodos;
AGrupo.DataTable.Active := True;
try
FGrupoController.Anadir(AGrupo);
AGrupo.DESCRIPCION := DisplayValue;
FGrupoController.Guardar(AGrupo);
Properties.LookupItems.Add(DisplayValue);
finally
Properties.LookupItems.EndUpdate;
AGrupo := NIL;
end;
end;
end;
end;
procedure TfrViewEmpleado.CustomViewCreate(Sender: TObject);
begin
inherited;
FGrupoController := TGruposEmpleadoController.Create;
end;
procedure TfrViewEmpleado.CustomViewDestroy(Sender: TObject);
begin
FGrupoController := NIL;
inherited;
end;
end.

View File

@ -1,13 +1,15 @@
inherited frViewEmpleado: TfrViewEmpleado inherited frViewVendedor: TfrViewVendedor
Width = 642 Width = 642
Height = 578 Height = 446
OnCreate = CustomViewCreate
OnDestroy = CustomViewDestroy
ExplicitWidth = 642 ExplicitWidth = 642
ExplicitHeight = 578 ExplicitHeight = 446
inherited dxLayoutControlContacto: TdxLayoutControl inherited dxLayoutControlContacto: TdxLayoutControl
Width = 642 Width = 642
Height = 578 Height = 446
ExplicitWidth = 642 ExplicitWidth = 642
ExplicitHeight = 578 ExplicitHeight = 446
inherited PngSpeedButton1: TPngSpeedButton inherited PngSpeedButton1: TPngSpeedButton
Left = 597 Left = 597
ExplicitLeft = 597 ExplicitLeft = 597
@ -22,105 +24,47 @@ inherited frViewEmpleado: TfrViewEmpleado
end end
inherited eCalle: TcxDBTextEdit inherited eCalle: TcxDBTextEdit
Left = 121 Left = 121
Top = 277 Top = 246
TabOrder = 6 TabOrder = 6
ExplicitLeft = 121 ExplicitLeft = 121
ExplicitTop = 277 ExplicitTop = 246
ExplicitWidth = 152 ExplicitWidth = 152
Width = 152 Width = 152
end end
inherited eProvincia: TcxDBTextEdit inherited eProvincia: TcxDBTextEdit
Left = 121 Left = 121
Top = 331 Top = 300
TabOrder = 9 TabOrder = 9
ExplicitLeft = 121 ExplicitLeft = 121
ExplicitTop = 331 ExplicitTop = 300
ExplicitWidth = 152 ExplicitWidth = 152
Width = 152 Width = 152
end end
inherited ePoblacion: TcxDBTextEdit inherited ePoblacion: TcxDBTextEdit
Left = 121 Left = 121
Top = 304 Top = 273
TabOrder = 7 TabOrder = 7
ExplicitLeft = 121 ExplicitLeft = 121
ExplicitTop = 304 ExplicitTop = 273
ExplicitWidth = 51 ExplicitWidth = 51
Width = 51 Width = 51
end end
inherited eCodigoPostal: TcxDBTextEdit inherited eCodigoPostal: TcxDBTextEdit
Left = 263 Left = 263
Top = 304 Top = 273
TabOrder = 8 TabOrder = 8
ExplicitLeft = 263 ExplicitLeft = 263
ExplicitTop = 304 ExplicitTop = 273
end end
inherited eObservaciones: TcxDBMemo inherited eObservaciones: TcxDBMemo
Top = 388 Top = 357
TabOrder = 18 TabOrder = 18
ExplicitTop = 388 ExplicitTop = 357
ExplicitWidth = 596 ExplicitWidth = 596
ExplicitHeight = 151 ExplicitHeight = 151
Height = 151 Height = 151
Width = 596 Width = 596
end end
object eFechaNacimiento: TcxDBDateEdit [8]
Left = 121
Top = 82
DataBinding.DataField = 'FECHA_NACIMIENTO'
DataBinding.DataSource = dsContacto
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.NativeStyle = True
Style.ButtonStyle = bts3D
Style.PopupBorderStyle = epbsFrame3D
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 19
Width = 121
end
object eFechaAltaEmpresa: TcxDBDateEdit [9]
Left = 121
Top = 82
DataBinding.DataField = 'FECHA_ALTA_EMPRESA'
DataBinding.DataSource = dsContacto
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.NativeStyle = True
Style.ButtonStyle = bts3D
Style.PopupBorderStyle = epbsFrame3D
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 3
Width = 235
end
object cbCategoria: TcxDBComboBox [10]
Left = 121
Top = 109
DataBinding.DataField = 'CATEGORIA'
DataBinding.DataSource = dsContacto
Properties.ImmediatePost = True
Properties.OnInitPopup = cbCategoriaPropertiesInitPopup
Properties.OnValidate = cbCategoriaPropertiesValidate
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
Style.ButtonStyle = bts3D
Style.PopupBorderStyle = epbsFrame3D
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 4
Width = 160
end
inherited eTlfParticular: TcxDBTextEdit inherited eTlfParticular: TcxDBTextEdit
Left = 453 Left = 453
TabOrder = 11 TabOrder = 11
@ -182,10 +126,10 @@ inherited frViewEmpleado: TfrViewEmpleado
end end
inherited ePersonaContacto: TcxDBTextEdit inherited ePersonaContacto: TcxDBTextEdit
Left = 121 Left = 121
Top = 250 Top = 219
TabOrder = 5 TabOrder = 5
ExplicitLeft = 121 ExplicitLeft = 121
ExplicitTop = 250 ExplicitTop = 219
ExplicitWidth = 152 ExplicitWidth = 152
Width = 152 Width = 152
end end
@ -197,9 +141,62 @@ inherited frViewEmpleado: TfrViewEmpleado
ExplicitWidth = 264 ExplicitWidth = 264
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
Width = 264 Width = 264
ExplicitWidth = 316 ExplicitWidth = 262
end end
end end
object cbUsuario: TcxComboBox [20]
Left = 121
Top = 82
Anchors = [akLeft, akTop, akRight]
Properties.DropDownListStyle = lsFixedList
Properties.ImmediatePost = True
Properties.OnValidate = cbUsuarioPropertiesValidate
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.HotTrack = False
Style.LookAndFeel.Kind = lfStandard
Style.LookAndFeel.NativeStyle = True
Style.ButtonStyle = bts3D
Style.PopupBorderStyle = epbsFrame3D
StyleDisabled.LookAndFeel.Kind = lfStandard
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.Kind = lfStandard
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.Kind = lfStandard
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 3
Width = 201
end
object edtComision: TcxDBSpinEdit [21]
Left = 121
Top = 109
AutoSize = False
DataBinding.DataField = 'COMISION'
DataBinding.DataSource = dsContacto
ParentFont = False
Properties.Alignment.Horz = taRightJustify
Properties.DisplayFormat = ',0.00 %;-,0.00 %'
Properties.ImmediatePost = True
Properties.MaxValue = 100.000000000000000000
Style.BorderColor = clWindowFrame
Style.BorderStyle = ebs3D
Style.Font.Charset = DEFAULT_CHARSET
Style.Font.Color = clWindowText
Style.Font.Height = -11
Style.Font.Name = 'Tahoma'
Style.Font.Style = []
Style.HotTrack = False
Style.LookAndFeel.NativeStyle = True
Style.TextColor = clWindowText
Style.ButtonStyle = bts3D
Style.IsFontAssigned = True
StyleDisabled.LookAndFeel.NativeStyle = True
StyleFocused.LookAndFeel.NativeStyle = True
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 4
Height = 21
Width = 65
end
inherited dxLayoutControlContactoGroup_Root: TdxLayoutGroup inherited dxLayoutControlContactoGroup_Root: TdxLayoutGroup
inherited dxLayoutControlContactoGroup9: TdxLayoutGroup inherited dxLayoutControlContactoGroup9: TdxLayoutGroup
inherited dxLayoutControlContactoGroup4: TdxLayoutGroup inherited dxLayoutControlContactoGroup4: TdxLayoutGroup
@ -212,22 +209,14 @@ inherited frViewEmpleado: TfrViewEmpleado
inherited dxLayoutControlContactoItem13: TdxLayoutItem inherited dxLayoutControlContactoItem13: TdxLayoutItem
Caption = 'Nombre y apellidos:' Caption = 'Nombre y apellidos:'
end end
object dxLayoutControlContactoGroup10: TdxLayoutGroup object dxLayoutControlContactoItem19: TdxLayoutItem
ShowCaption = False Caption = 'Usuario:'
Hidden = True Control = cbUsuario
LayoutDirection = ldHorizontal ControlOptions.ShowBorder = False
ShowBorder = False
object dxLayoutControlContactoItem19: TdxLayoutItem
AutoAligns = [aaVertical]
AlignHorz = ahClient
Caption = 'Fecha de alta:'
Control = eFechaAltaEmpresa
ControlOptions.ShowBorder = False
end
end end
object dxLayoutControlContactoItem20: TdxLayoutItem object dxLayoutControlContactoItem20: TdxLayoutItem
Caption = 'Categor'#237'a:' Caption = 'Comisi'#243'n:'
Control = cbCategoria Control = edtComision
ControlOptions.ShowBorder = False ControlOptions.ShowBorder = False
end end
end end

View File

@ -0,0 +1,129 @@
unit uViewVendedor;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uViewContacto, dxLayoutLookAndFeels, DB, uDADataTable,
dxLayoutControl, cxMemo, cxDBEdit, cxContainer, cxEdit, cxTextEdit, cxControls,
cxMaskEdit, cxSpinEdit, ImgList, PngImageList, ActnList, cxHyperLinkEdit,
Buttons, PngSpeedButton, cxDropDownEdit, cxCalendar, cxGraphics,
uDAInterfaces, uCustomView, uViewBase, uViewTienda, uBizContactos;
type
IViewVendedor = interface(IViewContacto)
['{245F4A36-39A4-4081-9826-F05FBBC729AE}']
end;
TfrViewVendedor = class(TfrViewContacto, IViewVendedor)
dxLayoutControlContactoItem19: TdxLayoutItem;
cbUsuario: TcxComboBox;
dxLayoutControlContactoItem20: TdxLayoutItem;
edtComision: TcxDBSpinEdit;
procedure CustomViewCreate(Sender: TObject);
procedure CustomViewDestroy(Sender: TObject);
procedure cbUsuarioPropertiesValidate(Sender: TObject;
var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
private
FDataItem : TDADataTable;
FListaUsuarios : TStringList;
function GetDataItem: TDADataTable;
procedure SetDataItem(const Value: TDADataTable);
protected
procedure SetContacto(const Value: IBizContacto); override;
public
property DataItem : TDADataTable read GetDataItem write SetDataItem;
procedure ElegirUsuario(const AIDUsuario : Integer);
end;
implementation
{$R *.dfm}
uses uFactuGES_App;
procedure TfrViewVendedor.cbUsuarioPropertiesValidate(Sender: TObject;
var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
var
AIndex : integer;
begin
inherited;
if Assigned(FDataItem) and FDataItem.Active then
begin
AIndex := StrToInt(FListaUsuarios.Values[DisplayValue]);
FDataItem.Edit;
if Assigned(FDataItem.FindField('ID_USUARIO')) then
FDataItem.FieldByName('ID_USUARIO').AsInteger := AIndex;
// if Assigned(FDataItem.FindField('USUARIO')) then
// FDataItem.FieldByName('USUARIO').AsString := DisplayValue;
FDataItem.post;
end;
end;
procedure TfrViewVendedor.CustomViewCreate(Sender: TObject);
var
i : integer;
begin
inherited;
FListaUsuarios := AppFactuGES.UsuariosController.DarListaUsuarios;
with cbUsuario.Properties.Items do
begin
BeginUpdate;
try
Clear;
for i := 0 to FListaUsuarios.Count - 1 do
Add(FListaUsuarios.Names[i]);
finally
EndUpdate;
end;
end;
end;
procedure TfrViewVendedor.CustomViewDestroy(Sender: TObject);
begin
FreeAndNIL(FListaUsuarios);
inherited;
end;
procedure TfrViewVendedor.ElegirUsuario(const AIDUsuario: Integer);
var
i : integer;
begin
for i := 0 to FListaUsuarios.Count-1 do
begin
if FListaUsuarios.ValueFromIndex[i] = IntToStr(AIDUsuario) then
begin
cbUsuario.Text := FListaUsuarios.Names[i];
Break;
end;
end;
end;
function TfrViewVendedor.GetDataItem: TDADataTable;
begin
Result := FDataItem;
end;
procedure TfrViewVendedor.SetContacto(const Value: IBizContacto);
begin
inherited;
DataItem := FContacto.DataTable;
end;
procedure TfrViewVendedor.SetDataItem(const Value: TDADataTable);
begin
FDataItem := Value;
if Assigned(FDataItem.FindField('ID_USUARIO')) then
ElegirUsuario(FDataItem.FieldByName('ID_USUARIO').AsInteger);
end;
end.

View File

@ -1,4 +1,4 @@
inherited frViewEmpleados: TfrViewEmpleados inherited frViewVendedores: TfrViewVendedores
inherited cxGrid: TcxGrid inherited cxGrid: TcxGrid
inherited cxGridView: TcxGridDBTableView inherited cxGridView: TcxGridDBTableView
DataController.Summary.FooterSummaryItems = < DataController.Summary.FooterSummaryItems = <
@ -24,10 +24,6 @@ inherited frViewEmpleados: TfrViewEmpleados
inherited frViewFiltroBase1: TfrViewFiltroBase inherited frViewFiltroBase1: TfrViewFiltroBase
inherited TBXDockablePanel1: TTBXDockablePanel inherited TBXDockablePanel1: TTBXDockablePanel
inherited dxLayoutControl1: TdxLayoutControl inherited dxLayoutControl1: TdxLayoutControl
inherited txtFiltroTodo: TcxTextEdit
ExplicitWidth = 457
Width = 457
end
inherited edtFechaIniFiltro: TcxDateEdit inherited edtFechaIniFiltro: TcxDateEdit
ExplicitWidth = 239 ExplicitWidth = 239
Width = 239 Width = 239