Adaptacion para poder visualizar por años la informacion

git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@907 0c75b7a4-871f-7646-8a2f-f78d34cc349f
This commit is contained in:
roberto 2009-02-27 10:38:00 +00:00
parent 13b33f6eab
commit 13283a1b0d
2 changed files with 50 additions and 8 deletions

View File

@ -45,12 +45,21 @@ inherited fEditorRemesasCliente: TfEditorRemesasCliente
Width = 785
ExplicitWidth = 785
inherited tbxMain: TTBXToolbar
ExplicitWidth = 704
ExplicitWidth = 785
object TBXSeparatorItem17: TTBXSeparatorItem [12]
end
end
inherited tbxFiltro: TTBXToolbar
ExplicitWidth = 269
ExplicitWidth = 359
inherited lblAno: TTBXLabelItem
Visible = True
end
inherited cbxListaAnos: TTBXComboBoxItem
Visible = True
end
inherited sepAno: TTBXSeparatorItem
Visible = True
end
inherited tbxEditFiltro: TTBXEditItem
EditOptions = [tboUseEditWhenVertical]
end
@ -68,8 +77,8 @@ inherited fEditorRemesasCliente: TfEditorRemesasCliente
end
end
inherited TBXTMain2: TTBXToolbar
Left = 334
ExplicitLeft = 334
Left = 359
ExplicitLeft = 359
end
end
inherited StatusBar: TJvStatusBar

View File

@ -28,12 +28,16 @@ type
procedure FormShow(Sender: TObject);
procedure actVolcarDiscoExecute(Sender: TObject);
procedure actVolcarDiscoUpdate(Sender: TObject);
procedure OnListaAnosChange(Sender: TObject; const Text: string);
private
FRemesasCliente: IBizRemesaCliente;
FController : IRemesasClienteController;
protected
function GetRemesasCliente: IBizRemesaCliente;
procedure SetRemesasCliente(const Value: IBizRemesaCliente);
function GetController : IRemesasClienteController; virtual;
procedure SetController (const Value : IRemesasClienteController); virtual;
@ -42,7 +46,7 @@ type
procedure ModificarInterno; override;
procedure PrevisualizarInterno; override;
procedure ImprimirInterno; override;
procedure RefrescarInterno; override;
//Si queremos crear otra vista para el editor heredado solo tendriamos que
//sobreescribir este metodo
@ -72,6 +76,8 @@ uses
}
procedure TfEditorRemesasCliente.FormShow(Sender: TObject);
begin
cbxListaAnos.OnChange := OnListaAnosChange; //OJO SIEMPRE ANTES DEL INHERITED
inherited;
if not Assigned(ViewGrid) then
@ -148,6 +154,13 @@ begin
FController.Ver(RemesasCliente);
end;
procedure TfEditorRemesasCliente.OnListaAnosChange(Sender: TObject; const Text: string);
begin
Controller.FiltrarAno(RemesasCliente, DynWhereDataTable, Text);
if RemesasCliente.DataTable.Active then
RefrescarInterno;
end;
procedure TfEditorRemesasCliente.PonerTitulos(const ATitulo: string);
var
FTitulo : String;
@ -197,17 +210,37 @@ begin
end;
end;
procedure TfEditorRemesasCliente.RefrescarInterno;
begin
//Volvemos a cargar los años de las remesas
if Assigned(FController) then
ListaAnos := FController.DarListaAnosRemesas;
inherited;
end;
procedure TfEditorRemesasCliente.SetRemesasCliente(const Value: IBizRemesaCliente);
begin
FRemesasCliente := Value;
if Assigned(FRemesasCliente) 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 := FRemesasCliente.DataTable.DynamicWhere.Xml;
dsDataTable.DataTable := FRemesasCliente.DataTable;
if Assigned(ViewGrid) then
(ViewGrid as IViewRemesasCliente).RemesasCliente := RemesasCliente;
end;
end;
procedure TfEditorRemesasCliente.SetController(const Value: IRemesasClienteController);
begin
FController := Value;
if Assigned(FController) then
ListaAnos := FController.DarListaAnosRemesas;
end;
destructor TfEditorRemesasCliente.Destroy;