#Include "Fivewin.ch"
#Include "dtpicker.ch"
#include 'xbrowse.ch'
#include "constant.ch"
#define LIGHTCYAN nRGB( 203, 225, 252 )
REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ordkeyno, ordkeycount,ordcreate,ordkeygoto
Function Test()
Local oFrm
Local oBrw
Local cAbi := space(5)
Local cCab := space(5)
Local cBanca := space(106)
Local cFiliale := space(40)
Local cCap := space(5)
Local cLocalita := space(42)
Local cProvincia:= space(2)
Local ogrp1
Local oBut1
Local oCerca
Local aGet[7]
//arrays per fare il xbrowse
Local aCampi := {"ABI","CAB","ISTBAN","FILBAN","INDIR","CAP","LOCALITA","PROV","SWIFT"}
Local aNomi := {"Abi","Cab","Istituto Bancario","Filiale","Indirizzo","C.A.P.","Località","Provincia","Codice Swift"}
Local aSizes := {30,30,120,120,120,30,60,30,40}
// coordinates della dialog
Local nRight := 75
Local nBottom := 22
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
RddSetDefault( "DBFCDX" )
SetGetColorFocus()
USE BANCHE ALIAS BA
Define DIALOG oFrm TITLE "Importa Banche - " ;
SIZE nWidth, nHeight PIXEL COLOR 0, 14215660 ;
STYLE nOr( WS_OVERLAPPEDWINDOW )
// //XBROWSE
@ 80,1 XBROWSE oBrw OF oFrm SIZE -2,-10 PIXEL ;
DATASOURCE "BA" ;
COLUMNS aCampi HEADERS aNomi COLSIZES aSizes
oBrw:CreateFromCode()
@ 1, 4 GROUP oGrp1 TO 65, 255 LABEL "Cerca " PIXEL;
OF oFrm COLOR 0, 14215660
@ 12, 6 SAY "&Abi:" SIZE 25, 7 PIXEL OF oFrm COLOR 0, 14215660
@ 12, 45 SAY "&Cab:" SIZE 25, 7 PIXEL OF oFrm COLOR 0, 14215660
@ 24, 11 SAY "&Descrizione Banca:" SIZE 55, 7 PIXEL OF oFrm COLOR 0, 14215660
@ 38, 11 SAY "&Descrizione Filiale :" SIZE 55, 7 PIXEL OF oFrm COLOR 0, 14215660
@ 54, 11 SAY "Ca&p:" SIZE 25, 7 PIXEL OF oFrm COLOR 0, 14215660
@ 54, 64 SAY "Lo&c:" SIZE 25, 7 PIXEL OF oFrm COLOR 0, 14215660
@ 54, 217 SAY "Pro&v:" SIZE 25, 7 PIXEL OF oFrm COLOR 0, 14215660
@ 10, 33 BUTTON oBut1 Prompt ".." SIZE 10, 9 PIXEL OF oFrm ACTION NIL
@ 10, 73 BUTTON oBut1 Prompt ".." SIZE 10, 9 PIXEL OF oFrm ACTION NIL
@ 10, 18 GET aGet[1] VAR cAbi SIZE 15, 10 PIXEL OF oFrm
@ 10, 58 GET aGet[2] VAR cCab SIZE 15, 10 PIXEL OF oFrm
@ 22, 85 GET aGet[3] VAR cBanca SIZE 130, 10 PIXEL OF oFrm
@ 36, 85 GET aGet[4] VAR cFiliale SIZE 130, 10 PIXEL OF oFrm
@ 52, 28 GET aGet[5] VAR cCap SIZE 30, 10 PIXEL OF oFrm
@ 52, 85 GET aGet[6] VAR cLocalita SIZE 130, 10 PIXEL OF oFrm
@ 52, 235 GET aGet[7] VAR cProvincia SIZE 14, 10 PIXEL OF oFrm
ACTIVATE DIALOG oFrm CENTERED
dbCloseAll()
RETURN NIL
static FUNCTION BrowseSeach(cAbi,cCab,cBanca,cFiliale,cCap,cLocalita,cProvincia,oBrw)
FIELD ABI,CAB,ISTBAN,FILBAN,CAP,LOCALITA,PROV
local cCond:="", bCond
cCond := "ABI = alltrim('" + cAbi + "' ) .AND. "
cCond += "CAB = alltrim('" + cCab + "' ) .AND. "
cCond += "ISTBAN = alltrim('" + cBanca + "' ) .AND. "
cCond += "FILBAN = alltrim('" + cFiliale + "' ) .AND. "
cCond += "CAP = alltrim('" + cCap + "' ) .AND. "
cCond += "LOCALITA = alltrim('" + clocalita + "' ) .AND. "
cCond += "PROV = alltrim('" + cProvincia + "' ) "
bCond := &( "{ || " + cCond + " }" )
( oBrw:cAlias )->( DBSETFILTER( bCond, cCond ), DBGOTOP() )
oBrw:refresh()
RETURN NIL