unit incidencias;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels,
cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint,
dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMoneyTwins,
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinPumpkin, dxSkinSeven,
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxContainer, cxEdit,
dxLayoutcxEditAdapters, dxLayoutContainer, cxStyles, cxCustomData, cxFilter,
cxData, cxDataStorage, cxNavigator, Data.DB, cxDBData, hyieutils, iexBitmaps,
hyiedefs, iesettings, cxMemo, cxRichEdit, cxDBRichEdit, cxMaskEdit,
cxDropDownEdit, cxCalendar, cxDBEdit, ieview, iemview, cxGridLevel, cxClasses,
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGrid, cxTextEdit, dxLayoutControl, FIBDataSet, pFIBDataSet, DatosGenerales,
cxGridCardView, cxGridDBCardView, cxGridCustomLayoutView, FIBDatabase,
pFIBDatabase,iexdbbitmaps, ieopensavedlg, iexActionsMulti, System.Actions,
Vcl.ActnList, Vcl.Menus, AdvMenus, MDIChildFormControl, cxDBNavigator, cxLabel,
TaskDialog, TaskDialogEx;
type
TfrmIncidencias = class(TForm)
dxLayoutControl1Group_Root: TdxLayoutGroup;
dxLayoutControl1: TdxLayoutControl;
cxTextEdit1: TcxTextEdit;
FOLIOITEM: TdxLayoutItem;
ImageEnMView1: TImageEnMView;
dxLayoutControl1Item2: TdxLayoutItem;
dxLayoutControl1Group1: TdxLayoutGroup;
cxDBDateEdit1: TcxDBDateEdit;
dxLayoutControl1Item4: TdxLayoutItem;
cxDBDateEdit2: TcxDBDateEdit;
GRUPO2: TdxLayoutGroup;
cxDBRichEdit1: TcxDBRichEdit;
dxLayoutControl1Item5: TdxLayoutItem;
dxLayoutControl1Item3: TdxLayoutItem;
cxDBTextEdit1: TcxDBTextEdit;
dxLayoutControl1Item6: TdxLayoutItem;
cxDBTextEdit2: TcxDBTextEdit;
dxLayoutControl1Item7: TdxLayoutItem;
dxLayoutControl1Group5: TdxLayoutGroup;
dxLayoutControl1Group6: TdxLayoutGroup;
dxLayoutControl1Group3: TdxLayoutGroup;
cxGrid2DBTableView1: TcxGridDBTableView;
cxGrid2Level1: TcxGridLevel;
cxGrid2: TcxGrid;
GRUPO1: TdxLayoutItem;
dxLayoutControl1Group4: TdxLayoutGroup;
tbcomprobantes: TpFIBDataSet;
trcomprobantes: TpFIBTransaction;
trcomprobantesescribe: TpFIBTransaction;
dscomprobantes: TDataSource;
cxGrid2DBTableView1NOMBRE: TcxGridDBColumn;
ActionList1: TActionList;
ImageEnMViewClear1: TImageEnMViewClear;
ImageEnMViewDeleteImage1: TImageEnMViewDeleteImage;
ImageEnMViewSeekNext1: TImageEnMViewSeekNext;
ImageEnMViewSeekPrior1: TImageEnMViewSeekPrior;
ImageEnMViewAcquire1: TImageEnMViewAcquire;
ImageEnMViewSelectAcquireSource1: TImageEnMViewSelectAcquireSource;
OpenImageEnDialog1: TOpenImageEnDialog;
AdvPopupMenu1: TAdvPopupMenu;
SeleccionarFuentedeAdquisicin1: TMenuItem;
Adquirir1: TMenuItem;
MDIChild1: TMDIChild;
ImageEnMViewPromptToAdd1: TImageEnMViewPromptToAdd;
Adicionardesdearchivo1: TMenuItem;
cxDBNavigator1: TcxDBNavigator;
GRUPO3: TdxLayoutItem;
cxLabel1: TcxLabel;
dxLayoutControl1Item1: TdxLayoutItem;
dxLayoutControl1Group2: TdxLayoutGroup;
Nombre: TAdvInputTaskDialogEx;
tbcomprobantesCLAVE: TFIBIntegerField;
tbcomprobantesNOMBRE: TFIBStringField;
tbcomprobantesCOMENTARIOS: TFIBMemoField;
tbcomprobantesFECHA: TFIBDateField;
tbcomprobantesCAPTURA: TFIBDateField;
tbcomprobantesSOLICITUD: TFIBStringField;
TBFOTOS: TpFIBDataSet;
TRFOTOS: TpFIBTransaction;
TRFOTOSESCRIBE: TpFIBTransaction;
DSFOTOS: TDataSource;
TBFOTOSCLAVE: TFIBIntegerField;
TBFOTOSIMAGEN: TFIBBlobField;
TBFOTOSNOMBRE: TFIBStringField;
TBFOTOSCOMPROBANTE: TFIBIntegerField;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure cxTextEdit1PropertiesValidate(Sender: TObject;
var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
procedure TBFOTOSBeforePost(DataSet: TDataSet);
procedure ImageEnMView1ImageLoaded(Sender: TObject; idx: Integer);
procedure ImageEnMViewPromptToAdd1Execute(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmIncidencias: TfrmIncidencias;
inicio:boolean;
fdbmbitmap:tiedbmultibitmap;
implementation
{$R *.dfm}
procedure TfrmIncidencias.cxTextEdit1PropertiesValidate(Sender: TObject;
var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
VAR
ACTIVAR:BOOLEAN;
MALA:VARIANT;
CLAVE:STRING;
begin
CXLABEL1.Caption:='';
MALA:=
DATOS.tbsolicitudes.LOOKUP('CUIS',DISPLAYVALUE,'CUIS;NOMBRE1');
TRY
CLAVE:=MALA[0];
CXLABEL1.Caption:=
mala[1];
tbcomprobantes.ParamByName('CUIS').VALUE:=
CLAVE;
TBCOMPROBANTES.CloseOpen(TRUE);
grupo1.enabled:=true;
grupo2.Enabled:=true;
grupo3.Enabled:=true;
EXCEPT
tbcomprobantes.Active:=false;
grupo1.enabled:=false;
grupo2.Enabled:=false;
grupo3.Enabled:=false;
CXTEXTEDIT1.SetFocus;
CXTEXTEDIT1.SelectAll;
end;
end;
procedure TfrmIncidencias.FormClose(Sender: TObject; var Action: TCloseAction);
begin
freeandnil(fdbmbitmap);
end;
procedure TfrmIncidencias.FormCreate(Sender: TObject);
begin
inicio:=true;
fDBMBitmap := TIEDBMultiBitmap.create();
fDBMBitmap.DataSource := DSFOTOS;
fDBMBitmap.ImageBlobField := 'IMAGEN';
fdbmbitmap.FollowDBCursor:=true;
ImageEnMView1.SetExternalMBitmap( fDBMBitmap );
imageenmview1.MIO.IEMBitmap.ParamsEnabled:=true;
end;
procedure TfrmIncidencias.ImageEnMView1ImageLoaded(Sender: TObject;
idx: Integer);
begin
IMAGEENMVIEW1.EnsureImageLoaded(IDX);
SHOWMESSAGE(IMAGEENMVIEW1.MIO.PARAMS[IDX].EXIF_GPSLatitude_Str);
end;
procedure TfrmIncidencias.ImageEnMViewPromptToAdd1Execute(Sender: TObject);
begin
end;
procedure TfrmIncidencias.TBFOTOSBeforePost(DataSet: TDataSet);
var
decision:integer;
begin
if TBFOTOSNOMBRE.IsNull then
begin
decision:=nombre.Execute;
if (decision=mrOk) then
begin
if not(TBFOTOS.state in [dsinsert,dsedit]) then
TBFOTOS.edit;
TBFOTOSNOMBRE.value:=nombre.InputText;
end
else
begin
tbFOTOS.cancel;
end;
end;
end;
end.