is there something of Wrong ?
I open Servizi on two xbrowse
and I create the xbrowse with no setodbffunc but with datasource command
then I add oBrw1:bEdit := { |oRec| EditServizi( oRec,oBrw1 ) }
on Editsource function I must cal the new number on cId if lAdd
// this is wrong ?
I cannot make it ?
SomeOne sad me it is wrong and I cannot make it..
wich is the problem ?
can you explain me ?
thanks
I open Servizi on two xbrowse
cFilter1:= 'MULTIPLE=.F.'
cFilter2:= 'MULTIPLE=.T.'
oServizi := TDatabase():Open( , "SERVIZI", "DBFCDX", .T. )
oServizi:bTrigger := { || If( Empty( ORDINE ), ORDINE := RECNO(), nil ),;
If( Empty( ID ), ID := strzero(RECNO(),4), nil )}
oServizi:SetOrder( 0 )
oServizi:GoTop()
oServiziSingoli := TDatabase():Open( , "SERVIZI", "DBFCDX", .T. )
oServiziSingoli:bTrigger := { || If( Empty( ORDINE ), ORDINE := RECNO(), nil ),;
If( Empty( ID ), ID := strzero(RECNO(),4), nil )}
oServiziSingoli:SetOrder( 1 )
oServiziSingoli:setFilter( cFilter1)
oServiziSingoli:GoTop()
oServiziMultipli := TDatabase():Open( , "SERVIZI", "DBFCDX", .T. )
oServiziMultipli:bTrigger := { || If( Empty( ORDINE ), ORDINE := RECNO(), nil ),;
If( Empty( ID ), ID := strzero(RECNO(),4), nil )}
oServiziMultipli:SetOrder( 1 )
oServiziMultipli:setFilter( cFilter2)
oServiziMultipli:GoTop()and I create the xbrowse with no setodbffunc but with datasource command
then I add oBrw1:bEdit := { |oRec| EditServizi( oRec,oBrw1 ) }
on Editsource function I must cal the new number on cId if lAdd
Function EditServizi( oRec,oBrw )
local lAdd := ( oRec:RecNo == 0 )
local lSave := .F.
local oFont
local oBtn
local oDlg
local oBtnImage
local cFile :=""
local cImgPath:=".\images\"
local cDefaImage:=cImgPath+UrlImage("noImage.png")
Local cImage:= lfn2sfn(rtrim(oRec:Image))
Local oImage
local cId := strzero(oRec:RecNo,4)
local aGet[10]
If lAdd
oBrw:clearFilter()
oRec:gobottom()
cId:= strzero(oRec:RecNo+1,4)
oBrw:setFilter( cFilter1)
oBrw:GoTop()
oRec:Load(.t.)
else
cId := strzero(oRec:RecNo,4)
Endif
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, 15
DEFINE DIALOG oDlg SIZE 422, 326 PIXEL ; //FROM 100, 100 TO 426,522;
TITLE If( lAdd, "New Service", "Edit Service" ) FONT oFont ;
COLOR CLR_BLACK,CLR_WHITE TRANSPARENT
@ 12, 10 SAY "Code:" OF oDlg SIZE 19, 8 PIXEL
@ 10, 46 GET aGet[1] VAR cId OF oDlg SIZE 25, 12 PIXEL;
VALID If( Empty( cId ), ( MsgInfo( NO_EMPTY ), .f. ), ;
If( Duplicate( cId, "ID", oRec:RecNo,oServizi,aGet[1] ), ( MsgInfo( YES_DUPLICATE ), .f. ), ;
.t. ) )// this is wrong ?
If lAdd
oBrw:oDbf:clearFilter()
oRec:gobottom()
cId:= strzero(oRec:RecNo+1,4)
oBrw:oDbf:setFilter( cFilter1)
oBrw:oDbf:GoTop()
oRec:Load(.t.)
else
cId := strzero(oRec:RecNo,4)
EndifI cannot make it ?
SomeOne sad me it is wrong and I cannot make it..
wich is the problem ?
can you explain me ?
thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
