143 lines
4.1 KiB
ObjectPascal
143 lines
4.1 KiB
ObjectPascal
|
|
unit uEditorCalendarioRecepciones;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, uEditorCalendarioConFiltro, dxPSGlbl, dxPSUtl, dxPSEngn,
|
|||
|
|
dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider, dxPSFillPatterns,
|
|||
|
|
dxPSEdgePatterns, dxPrnDlg, dxPSCore, dxPScxCommon, dxPScxScheduler2Lnk,
|
|||
|
|
DB, uDADataTable, cxSchedulerStorage, cxSchedulerDBStorage,
|
|||
|
|
dxLayoutLookAndFeels, JvAppStorage, JvAppRegistryStorage, cxCheckBox,
|
|||
|
|
JvComponentBase, JvFormPlacement, ImgList, PngImageList, StdActns,
|
|||
|
|
ActnList, ComCtrls, TBX, TB2Item, TB2Dock, TB2Toolbar, pngimage,
|
|||
|
|
ExtCtrls, JvExControls, JvComponent, JvNavigationPane, uCustomView,
|
|||
|
|
uViewBase, uViewCalendarioBase, uViewCalendarioConFiltro, uBizCitas;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
IEditorCalendarioRecepciones = interface(IEditorCalendarioConFiltro)
|
|||
|
|
['{108A5E35-18F4-4100-B4EB-F059AC86BBB4}']
|
|||
|
|
function GetDocumentos: IBizDocumentos;
|
|||
|
|
procedure SetDocumentos(const Value: IBizDocumentos);
|
|||
|
|
property Documentos : IBizDocumentos read GetDocumentos write SetDocumentos;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
TfEditorCalendarioRecepciones = class(TfEditorCalendarioConFiltro, IEditorCalendarioRecepciones)
|
|||
|
|
frViewCalendarioRecepciones: TfrViewCalendarioConFiltro;
|
|||
|
|
DADataSource2: TDADataSource;
|
|||
|
|
|
|||
|
|
private
|
|||
|
|
FDocumentos: IBizDocumentos;
|
|||
|
|
procedure CargarLista; override;
|
|||
|
|
function GetDocumentos: IBizDocumentos;
|
|||
|
|
procedure SetDocumentos(const Value: IBizDocumentos);
|
|||
|
|
|
|||
|
|
protected
|
|||
|
|
procedure InicializarCampos; override;
|
|||
|
|
procedure InicializarEvento (var aEvent : TcxSchedulerControlEvent); override;
|
|||
|
|
|
|||
|
|
public
|
|||
|
|
property Documentos : IBizDocumentos read GetDocumentos write SetDocumentos;
|
|||
|
|
constructor Create(AOwner: TComponent); override;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
fEditorCalendarioRecepciones: TfEditorCalendarioRecepciones;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
{ TfEditorCalendarioRecepciones }
|
|||
|
|
uses schCitasClient_Intf, uEditorCalendarioBase, uDataModuleCalendarios;
|
|||
|
|
|
|||
|
|
procedure TfEditorCalendarioRecepciones.CargarLista;
|
|||
|
|
begin
|
|||
|
|
NombreLista := 'Documentos';
|
|||
|
|
inherited;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
constructor TfEditorCalendarioRecepciones.Create(AOwner: TComponent);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
ViewCitas := frViewCalendarioRecepciones;
|
|||
|
|
// (ViewCitas as IViewCalendarioConFiltro).Resources.OnEditValueChanged := Nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfEditorCalendarioRecepciones.GetDocumentos: IBizDocumentos;
|
|||
|
|
begin
|
|||
|
|
Result := FDocumentos;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorCalendarioRecepciones.InicializarCampos;
|
|||
|
|
var
|
|||
|
|
aField : TcxSchedulerDBStorageField;
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
|
|||
|
|
with cxSchedulerDBStorage.CustomFields do
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
BeginUpdate;
|
|||
|
|
|
|||
|
|
aField := Add;
|
|||
|
|
aField.FieldName := CTE_TIPO_DOCUMENTO;
|
|||
|
|
|
|||
|
|
finally
|
|||
|
|
EndUpdate;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorCalendarioRecepciones.InicializarEvento(var aEvent: TcxSchedulerControlEvent);
|
|||
|
|
var
|
|||
|
|
ItemSeleccionado: Integer;
|
|||
|
|
ItemTextSeleccionado: String;
|
|||
|
|
ADocumento : IBizDocumentos;
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
|
|||
|
|
with AEvent do
|
|||
|
|
begin
|
|||
|
|
SetCustomFieldValueByName(fld_CITASTIPOTAREA, TextoTipoCita[Ord(tcRecepcion)]);
|
|||
|
|
|
|||
|
|
//Preparamos la fuente de datos para que se cargen los tipos de pedido del documento seleccionado
|
|||
|
|
//CAMBIAR<41>
|
|||
|
|
|
|||
|
|
|
|||
|
|
with (ViewCitas as IViewCalendarioConFiltro).Resources do
|
|||
|
|
begin
|
|||
|
|
Items.BeginUpdate;
|
|||
|
|
for ItemSeleccionado := 0 to Items.Count - 1 do
|
|||
|
|
if Items[ItemSeleccionado].Checked then
|
|||
|
|
Break;
|
|||
|
|
Items.EndUpdate;
|
|||
|
|
end;
|
|||
|
|
ItemTextSeleccionado := (ViewCitas as IViewCalendarioConFiltro).Resources.Items[ItemSeleccionado].Text;
|
|||
|
|
|
|||
|
|
ADocumento := dmCalendarios.GetDocumento(ItemTextSeleccionado);
|
|||
|
|
ADocumento.DataTable.Active := True;
|
|||
|
|
SetCustomFieldValueByName(CTE_TIPO_DOCUMENTO, ADocumento.CODIGO);
|
|||
|
|
ADocumento := Nil;
|
|||
|
|
|
|||
|
|
AllDayEvent := True;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfEditorCalendarioRecepciones.SetDocumentos(const Value: IBizDocumentos);
|
|||
|
|
begin
|
|||
|
|
FDocumentos := Value;
|
|||
|
|
|
|||
|
|
if Assigned(FDocumentos) then
|
|||
|
|
begin
|
|||
|
|
DADataSource2.DataTable := FDocumentos.DataTable;
|
|||
|
|
|
|||
|
|
if not FDocumentos.DataTable.Active then
|
|||
|
|
FDocumentos.DataTable.Active := True;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
DADataSource2.DataTable := Nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|