129 lines
4.2 KiB
ObjectPascal
129 lines
4.2 KiB
ObjectPascal
|
|
unit uEditorElegirPedidosCliente;
|
|||
|
|
|
|||
|
|
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,
|
|||
|
|
uViewPedidosCliente, ComCtrls, TB2ExtItems, TBXExtItems, TBX,
|
|||
|
|
TB2Item, TB2Dock, TB2Toolbar, pngimage, ExtCtrls, JvExControls, JvComponent,
|
|||
|
|
JvNavigationPane, uViewBarraSeleccion, JvgWizardHeader, StdCtrls,
|
|||
|
|
uEditorPedidosCliente, uBizPedidosCliente, uIEditorElegirPedidosCliente,
|
|||
|
|
JvExComCtrls, JvStatusBar, JSDialog;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfEditorElegirPedidosCliente = class(TfEditorPedidosCliente, IEditorElegirPedidosCliente)
|
|||
|
|
frViewBarraSeleccion1: TfrViewBarraSeleccion;
|
|||
|
|
JvgWizardHeader1: TJvgWizardHeader;
|
|||
|
|
EditorSeleccionActionList: TActionList;
|
|||
|
|
actBuscar2: TAction;
|
|||
|
|
actQuitarFiltro2: TAction;
|
|||
|
|
actAnchoAuto2: TAction;
|
|||
|
|
procedure frViewBarraSeleccion1actSeleccionarUpdate(Sender: TObject);
|
|||
|
|
procedure frViewBarraSeleccion1actCancelarExecute(Sender: TObject);
|
|||
|
|
procedure frViewBarraSeleccion1actSeleccionarExecute(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure actAnchoAuto2Execute(Sender: TObject);
|
|||
|
|
procedure actQuitarFiltro2Execute(Sender: TObject);
|
|||
|
|
protected
|
|||
|
|
procedure SetMultiSelect (AValue : Boolean);
|
|||
|
|
function GetMultiSelect : Boolean;
|
|||
|
|
function GetPedidosClienteSeleccionados: IBizPedidoCliente;
|
|||
|
|
procedure SetViewGrid(const Value: IViewGridBase); override;
|
|||
|
|
procedure SetMensaje (const AValue: String);
|
|||
|
|
function GetMensaje: String;
|
|||
|
|
public
|
|||
|
|
property Mensaje : String read GetMensaje write SetMensaje;
|
|||
|
|
property PedidosClienteSeleccionados: IBizPedidoCliente read GetPedidosClienteSeleccionados;
|
|||
|
|
property MultiSelect : Boolean read GetMultiSelect write SetMultiSelect;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
uEditorGridBase, cxGridCustomTableView, uIntegerListUtils, uDBSelectionListUtils,
|
|||
|
|
uGridUtils, uEditorBase, uPedidosClienteController,
|
|||
|
|
cxGridLevel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
{ TfEditorElegirPedidosCliente }
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPedidosCliente.actAnchoAuto2Execute(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
actAnchoAuto.Execute;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPedidosCliente.actQuitarFiltro2Execute(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
actQuitarFiltro.Execute;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPedidosCliente.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
EditorActionList.State := asSuspended;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPedidosCliente.frViewBarraSeleccion1actCancelarExecute(
|
|||
|
|
Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPedidosCliente.frViewBarraSeleccion1actSeleccionarExecute(
|
|||
|
|
Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
ModalResult := mrOk;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPedidosCliente.frViewBarraSeleccion1actSeleccionarUpdate(
|
|||
|
|
Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
(Sender as TAction).Enabled := (ViewGrid._FocusedView.Controller.SelectedRowCount > 0)
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirPedidosCliente.GetPedidosClienteSeleccionados: IBizPedidoCliente;
|
|||
|
|
begin
|
|||
|
|
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Pedidos as ISeleccionable).SelectedRecords);
|
|||
|
|
// En SelectedRecords tengo los ID de las filas seleccionadas del grid
|
|||
|
|
Result := (Controller as IPedidosClienteController).ExtraerSeleccionados(Pedidos) as IBizPedidoCliente;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirPedidosCliente.GetMensaje: String;
|
|||
|
|
begin
|
|||
|
|
Result := JvgWizardHeader1.Comments.Text;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorElegirPedidosCliente.GetMultiSelect: Boolean;
|
|||
|
|
begin
|
|||
|
|
Result := ViewGrid.MultiSelect;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPedidosCliente.SetMensaje(const AValue: String);
|
|||
|
|
begin
|
|||
|
|
JvgWizardHeader1.Comments.Text := AValue;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPedidosCliente.SetMultiSelect(AValue: Boolean);
|
|||
|
|
begin
|
|||
|
|
ViewGrid.MultiSelect := AValue;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorElegirPedidosCliente.SetViewGrid(const Value: IViewGridBase);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
//Para que no salgan las pesta<74>as de filtrado
|
|||
|
|
ViewGrid._Grid.RootLevelOptions.DetailTabsPosition := dtpNone;
|
|||
|
|
ViewGrid.OnDblClick := frViewBarraSeleccion1.actSeleccionar.OnExecute;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|