2010-08-25 17:55:43 +00:00
|
|
|
|
unit uEditorContratosClienteBeneficios;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, uEditorGridBase, Menus, JvAppStorage, JvAppRegistryStorage, DB,
|
|
|
|
|
|
uDAInterfaces, uDADataTable, JvComponentBase, JvFormPlacement, ImgList,
|
|
|
|
|
|
PngImageList, StdActns, ActnList, ComCtrls, JvExComCtrls, JvStatusBar, TBX,
|
|
|
|
|
|
TB2ExtItems, TBXExtItems, TB2Item, TB2Dock, TB2Toolbar, pngimage, ExtCtrls,
|
|
|
|
|
|
JvExControls, JvNavigationPane, uIEditorContratosClienteBeneficios, uBizContratosCliente,
|
|
|
|
|
|
uCustomView, uViewBase, uViewGridBase, uViewGrid,
|
2022-02-09 15:00:16 +00:00
|
|
|
|
uViewContratosClienteBeneficios, uContratosClienteController;
|
2010-08-25 17:55:43 +00:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfEditorContratosClienteBeneficios = class(TfEditorGridBase, IEditorContratosClienteBeneficios)
|
|
|
|
|
|
frViewContratosClienteBeneficios1: TfrViewContratosClienteBeneficios;
|
2022-02-09 15:00:16 +00:00
|
|
|
|
actVerBeneficio: TAction;
|
|
|
|
|
|
TBItem1: TTBItem;
|
2010-08-25 17:55:43 +00:00
|
|
|
|
procedure FormShow(Sender: TObject);
|
2022-02-09 15:00:16 +00:00
|
|
|
|
procedure actVerBeneficioExecute(Sender: TObject);
|
2025-02-26 09:43:21 +00:00
|
|
|
|
procedure OnListaAnosChange(Sender: TObject; const Text: string);
|
|
|
|
|
|
|
2010-08-25 17:55:43 +00:00
|
|
|
|
private
|
|
|
|
|
|
FContratos: IBizContratosClienteBeneficios;
|
2022-02-09 15:00:16 +00:00
|
|
|
|
FController : IContratosClienteController;
|
|
|
|
|
|
|
2010-08-25 17:55:43 +00:00
|
|
|
|
function GetContratos: IBizContratosClienteBeneficios;
|
|
|
|
|
|
procedure SetContratos(const Value: IBizContratosClienteBeneficios);
|
|
|
|
|
|
|
2022-02-09 15:00:16 +00:00
|
|
|
|
function GetController : IContratosClienteController;
|
|
|
|
|
|
procedure SetController (const Value : IContratosClienteController);
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-25 17:55:43 +00:00
|
|
|
|
protected
|
|
|
|
|
|
procedure ImprimirInterno; override;
|
|
|
|
|
|
procedure PrevisualizarInterno; override;
|
2025-02-26 09:43:21 +00:00
|
|
|
|
procedure RefrescarInterno; override;
|
2010-08-25 17:55:43 +00:00
|
|
|
|
|
|
|
|
|
|
public
|
|
|
|
|
|
property Contratos: IBizContratosClienteBeneficios read GetContratos write SetContratos;
|
2022-02-09 15:00:16 +00:00
|
|
|
|
property Controller : IContratosClienteController read GetController write SetController;
|
2010-08-25 17:55:43 +00:00
|
|
|
|
constructor Create(AOwner: TComponent); override;
|
|
|
|
|
|
destructor Destroy; override;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
fEditorContratosClienteBeneficios: TfEditorContratosClienteBeneficios;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
2025-02-26 09:43:21 +00:00
|
|
|
|
uses
|
|
|
|
|
|
cxControls;
|
2010-08-25 17:55:43 +00:00
|
|
|
|
|
2025-02-26 09:43:21 +00:00
|
|
|
|
{$R *.dfm}
|
2010-08-25 17:55:43 +00:00
|
|
|
|
{ TfEditorContratosClienteBeneficios }
|
|
|
|
|
|
|
2022-02-09 15:00:16 +00:00
|
|
|
|
procedure TfEditorContratosClienteBeneficios.actVerBeneficioExecute(
|
|
|
|
|
|
Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
FController.VerBeneficio(Contratos.ID);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2010-08-25 17:55:43 +00:00
|
|
|
|
constructor TfEditorContratosClienteBeneficios.Create(AOwner: TComponent);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
FContratos := NIL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
destructor TfEditorContratosClienteBeneficios.Destroy;
|
|
|
|
|
|
begin
|
|
|
|
|
|
FContratos := NIL;
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorContratosClienteBeneficios.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-02-26 09:43:21 +00:00
|
|
|
|
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
|
|
|
|
|
|
|
2010-08-25 17:55:43 +00:00
|
|
|
|
inherited;
|
|
|
|
|
|
ViewGrid := frViewContratosClienteBeneficios1;
|
|
|
|
|
|
FContratos.Active := True;
|
|
|
|
|
|
actAnchoAuto.Execute;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfEditorContratosClienteBeneficios.GetContratos: IBizContratosClienteBeneficios;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := FContratos;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2022-02-09 15:00:16 +00:00
|
|
|
|
function TfEditorContratosClienteBeneficios.GetController: IContratosClienteController;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := FController;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2010-08-25 17:55:43 +00:00
|
|
|
|
procedure TfEditorContratosClienteBeneficios.ImprimirInterno;
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-02-26 09:43:21 +00:00
|
|
|
|
procedure TfEditorContratosClienteBeneficios.OnListaAnosChange(Sender: TObject; const Text: string);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Controller.FiltrarAnoBeneficios(Contratos, DynWhereDataTable, Text);
|
|
|
|
|
|
if Contratos.DataTable.Active then
|
|
|
|
|
|
RefrescarInterno;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2010-08-25 17:55:43 +00:00
|
|
|
|
procedure TfEditorContratosClienteBeneficios.PrevisualizarInterno;
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
|
2025-02-26 09:43:21 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorContratosClienteBeneficios.RefrescarInterno;
|
|
|
|
|
|
begin
|
|
|
|
|
|
//Volvemos a cargar los a<>os de los Contratos
|
|
|
|
|
|
if Assigned(FController) then
|
|
|
|
|
|
ListaAnos := FController.DarListaAnosContratos;
|
|
|
|
|
|
|
|
|
|
|
|
//Pasamos del padre ya que refresh da error
|
|
|
|
|
|
// inherited;
|
|
|
|
|
|
ShowHourglassCursor;
|
|
|
|
|
|
ViewGrid.SaveGridStatus;
|
|
|
|
|
|
ViewGrid._FocusedView.BeginUpdate;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
Contratos.DataTable.Active := False;
|
|
|
|
|
|
Contratos.DataTable.Active := True;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
|
ViewGrid._FocusedView.EndUpdate;
|
|
|
|
|
|
ViewGrid.RestoreGridStatus;
|
|
|
|
|
|
HideHourglassCursor;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-25 17:55:43 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorContratosClienteBeneficios.SetContratos(const Value: IBizContratosClienteBeneficios);
|
|
|
|
|
|
begin
|
|
|
|
|
|
FContratos := Value;
|
2025-02-26 09:43:21 +00:00
|
|
|
|
|
|
|
|
|
|
if Assigned(FContratos) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
//Se guarda el where de la sentencia origen, por si el editor tiene filtros que
|
|
|
|
|
|
//afecten a este where y en un futuro se desea volver al where origen (filtro de a<>o))
|
|
|
|
|
|
DynWhereDataTable := FContratos.DataTable.DynamicWhere.Xml;
|
|
|
|
|
|
frViewContratosClienteBeneficios1.Contratos := FContratos;
|
|
|
|
|
|
end;
|
2010-08-25 17:55:43 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
2025-02-26 09:43:21 +00:00
|
|
|
|
procedure TfEditorContratosClienteBeneficios.SetController(const Value: IContratosClienteController);
|
2022-02-09 15:00:16 +00:00
|
|
|
|
begin
|
|
|
|
|
|
FController := Value;
|
|
|
|
|
|
|
2025-02-26 09:43:21 +00:00
|
|
|
|
if Assigned(FController) then
|
|
|
|
|
|
ListaAnos := FController.DarListaAnosContratos;
|
2022-02-09 15:00:16 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
2010-08-25 17:55:43 +00:00
|
|
|
|
end.
|