2007-11-05 17:59:28 +00:00
|
|
|
|
{
|
|
|
|
|
|
===============================================================================
|
|
|
|
|
|
Copyright (<EFBFBD>) 2007. Rodax Software.
|
|
|
|
|
|
===============================================================================
|
|
|
|
|
|
Los contenidos de este fichero son propiedad de Rodax Software titular del
|
|
|
|
|
|
copyright. Este fichero s<EFBFBD>lo podr<EFBFBD> ser copiado, distribuido y utilizado,
|
|
|
|
|
|
en su totalidad o en parte, con el permiso escrito de Rodax Software, o de
|
|
|
|
|
|
acuerdo con los t<EFBFBD>rminos y condiciones establecidas en el acuerdo/contrato
|
|
|
|
|
|
bajo el que se suministra.
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
|
Web: www.rodax-software.com
|
|
|
|
|
|
===============================================================================
|
|
|
|
|
|
Fecha primera versi<EFBFBD>n:
|
|
|
|
|
|
Versi<EFBFBD>n actual: 1.0.0
|
|
|
|
|
|
Fecha versi<EFBFBD>n actual:
|
|
|
|
|
|
===============================================================================
|
|
|
|
|
|
Modificaciones:
|
|
|
|
|
|
|
|
|
|
|
|
Fecha Comentarios
|
|
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
===============================================================================
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unit uEditorElegirRecibosCliente;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, DB, uDADataTable, Menus, JvAppStorage, JvAppRegistryStorage,
|
|
|
|
|
|
JvComponentBase, JvFormPlacement, ImgList, PngImageList, StdActns,
|
|
|
|
|
|
ActnList, uCustomView, uViewBase, uViewGridBase, uViewGrid,
|
|
|
|
|
|
JvExComCtrls, JvStatusBar,
|
|
|
|
|
|
ComCtrls, TB2ExtItems, TBXExtItems, TBX,
|
|
|
|
|
|
TB2Item, TB2Dock, TB2Toolbar, pngimage, ExtCtrls, JvExControls, JvComponent,
|
2009-07-09 11:21:22 +00:00
|
|
|
|
JvNavigationPane, uViewBarraSeleccion, StdCtrls,
|
2007-11-05 17:59:28 +00:00
|
|
|
|
|
|
|
|
|
|
uViewRecibosCliente, uEditorRecibosCliente, uBizRecibosCliente, uIEditorElegirRecibosCliente,
|
|
|
|
|
|
Buttons, cxRadioGroup, cxMaskEdit, cxDropDownEdit, cxCalendar, cxControls,
|
2008-08-27 16:48:20 +00:00
|
|
|
|
cxContainer, cxEdit, cxTextEdit, TBXDkPanels, JSDialog,
|
|
|
|
|
|
uDAInterfaces;
|
2007-11-05 17:59:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfEditorElegirRecibosCliente = class(TfEditorRecibosCliente, IEditorElegirRecibosCliente)
|
|
|
|
|
|
frViewBarraSeleccion1: TfrViewBarraSeleccion;
|
2009-07-09 11:21:22 +00:00
|
|
|
|
lblTitle: TLabel;
|
|
|
|
|
|
lblComments: TLabel;
|
2007-11-05 17:59:28 +00:00
|
|
|
|
EditorSeleccionActionList: TActionList;
|
|
|
|
|
|
actBuscar2: TAction;
|
|
|
|
|
|
actQuitarFiltro2: TAction;
|
|
|
|
|
|
actAnchoAuto2: TAction;
|
|
|
|
|
|
pnlFiltrar: TTBXDockablePanel;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
txtFiltroTodo: TcxTextEdit;
|
|
|
|
|
|
edtFechaFiltro1: TcxDateEdit;
|
|
|
|
|
|
edtFechaFiltro2: TcxDateEdit;
|
|
|
|
|
|
rbTodo: TcxRadioButton;
|
|
|
|
|
|
rbFechas: TcxRadioButton;
|
|
|
|
|
|
Button1: TBitBtn;
|
|
|
|
|
|
procedure frViewBarraSeleccion1actSeleccionarUpdate(Sender: TObject);
|
|
|
|
|
|
procedure frViewBarraSeleccion1actCancelarExecute(Sender: TObject);
|
|
|
|
|
|
procedure frViewBarraSeleccion1actSeleccionarExecute(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure actAnchoAuto2Execute(Sender: TObject);
|
|
|
|
|
|
procedure actQuitarFiltro2Execute(Sender: TObject);
|
|
|
|
|
|
procedure txtFiltroTodoPropertiesChange(Sender: TObject);
|
|
|
|
|
|
procedure edtFechaFiltro1PropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
procedure rbTodoClick(Sender: TObject);
|
|
|
|
|
|
protected
|
|
|
|
|
|
procedure SetMultiSelect (AValue : Boolean);
|
|
|
|
|
|
function GetMultiSelect : Boolean;
|
|
|
|
|
|
function GetRecibosClienteSeleccionados: IBizRecibosCliente;
|
|
|
|
|
|
procedure SetViewGrid(const Value: IViewGridBase); override;
|
|
|
|
|
|
procedure SetMensaje (const AValue: String);
|
|
|
|
|
|
function GetMensaje: String;
|
|
|
|
|
|
public
|
|
|
|
|
|
property Mensaje : String read GetMensaje write SetMensaje;
|
|
|
|
|
|
property RecibosClienteSeleccionados: IBizRecibosCliente read GetRecibosClienteSeleccionados;
|
|
|
|
|
|
property MultiSelect : Boolean read GetMultiSelect write SetMultiSelect;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
uEditorGridBase, cxGridCustomTableView, uIntegerListUtils, uDBSelectionListUtils,
|
2008-05-30 16:56:23 +00:00
|
|
|
|
uGridStatusUtils, uDialogUtils, uEditorBase, uRecibosClienteController;
|
2007-11-05 17:59:28 +00:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
{ TfEditorElegirRecibosCliente }
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.actAnchoAuto2Execute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
actAnchoAuto.Execute;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.actQuitarFiltro2Execute(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
// inherited;
|
|
|
|
|
|
|
|
|
|
|
|
if Assigned(ViewGrid) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
txtFiltroTodo.Clear;
|
|
|
|
|
|
edtFechaFiltro1.Clear;
|
|
|
|
|
|
edtFechaFiltro2.Clear;
|
|
|
|
|
|
(ViewGrid as IViewRecibosCliente).FiltrarPorFechas(null, null);
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
// actQuitarFiltro.Execute;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.edtFechaFiltro1PropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if not VarIsNull(edtFechaFiltro1.EditValue) and not VarIsNull(edtFechaFiltro2.EditValue) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if (edtFechaFiltro1.EditValue > edtFechaFiltro2.EditValue) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ShowWarningMessage('La fecha de inicio debe ser anterior a la fecha final');
|
|
|
|
|
|
edtFechaFiltro1.SetFocus;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
(ViewGrid as IViewRecibosCliente).FiltrarPorFechas(edtFechaFiltro1.EditValue, edtFechaFiltro2.EditValue);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
EditorActionList.State := asSuspended;
|
|
|
|
|
|
frViewRecibosCliente1.cxViewGridPopupMenu.PopupMenus.Items[0].HitTypes := [];
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.frViewBarraSeleccion1actCancelarExecute(
|
|
|
|
|
|
Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.frViewBarraSeleccion1actSeleccionarExecute(
|
|
|
|
|
|
Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
ModalResult := mrOk;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.frViewBarraSeleccion1actSeleccionarUpdate(
|
|
|
|
|
|
Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
(Sender as TAction).Enabled := (ViewGrid._FocusedView.Controller.SelectedRowCount > 0)
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfEditorElegirRecibosCliente.GetRecibosClienteSeleccionados: IBizRecibosCliente;
|
|
|
|
|
|
begin
|
|
|
|
|
|
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (RecibosCliente as ISeleccionable).SelectedRecords);
|
|
|
|
|
|
// En SelectedRecords tengo los ID de las filas seleccionadas del grid
|
|
|
|
|
|
Result := (Controller as IRecibosClienteController).ExtraerSeleccionados(RecibosCliente) as IBizRecibosCliente;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.rbTodoClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
actQuitarFiltro.Execute;
|
|
|
|
|
|
|
|
|
|
|
|
if rbTodo.Checked then
|
|
|
|
|
|
begin
|
|
|
|
|
|
edtFechaFiltro1.Enabled := False;
|
|
|
|
|
|
edtFechaFiltro2.Enabled := False;
|
|
|
|
|
|
txtFiltroTodo.Enabled := True;
|
|
|
|
|
|
end
|
|
|
|
|
|
else begin
|
|
|
|
|
|
edtFechaFiltro1.Enabled := True;
|
|
|
|
|
|
edtFechaFiltro2.Enabled := True;
|
|
|
|
|
|
txtFiltroTodo.Enabled := False;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfEditorElegirRecibosCliente.GetMensaje: String;
|
|
|
|
|
|
begin
|
2009-07-09 11:21:22 +00:00
|
|
|
|
Result := lblComments.Caption;
|
2007-11-05 17:59:28 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfEditorElegirRecibosCliente.GetMultiSelect: Boolean;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := ViewGrid.MultiSelect;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.SetMensaje(const AValue: String);
|
|
|
|
|
|
begin
|
2009-07-09 11:21:22 +00:00
|
|
|
|
lblComments.Caption := AValue;
|
2007-11-05 17:59:28 +00:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.SetMultiSelect(AValue: Boolean);
|
|
|
|
|
|
begin
|
|
|
|
|
|
ViewGrid.MultiSelect := AValue;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.SetViewGrid(const Value: IViewGridBase);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
ViewGrid.OnDblClick := frViewBarraSeleccion1.actSeleccionar.OnExecute;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfEditorElegirRecibosCliente.txtFiltroTodoPropertiesChange(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Assigned(ViewGrid) then
|
|
|
|
|
|
ViewGrid.Filter := txtFiltroTodo.Text;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|