#include "fivewin.ch"
REQUEST DBFCDX
static cDbfPath
Function Servizi()
local oDlgServices, oFont, oBold, oBrw1, oBrw2, oSay1, oSay2, oBtnOk, oBtnClose, m
Local oServizi,oServiziSingoli,oServiziMultipli
Local cFilter1,cFilter2
Local cCursor:= TCursor():New(,'HAND')
cFilter1:= 'FIELD->MULTIPLE=.F.'
cFilter2:= 'FIELD->MULTIPLE=.T.'
cDbfPath := cFilePath(GetModuleFileName( GetInstance() )) + "Data\"
cIniFile := cFilePath( GetModuleFileName( GetInstance() ) ) + "Beach.ini"
oServiziSingoli:=Db_Open( "Servizi",.t.)
oServiziSingoli:DbSetFilter( {|| &cFilter1 }, )
oServiziSingoli:gotop()
oServiziMultipli:=Db_Open( "Servizi",.t.)
oServiziMultipli:DbSetFilter( {|| &cFilter2 }, )
oServiziMultipli:gotop()
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-14 BOLD
DEFINE DIALOG oDlgServices SIZE 880,600 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
TITLE "Bikini - Gestione Servizi Singoli e Multipli"
@ 10, 40 SAY oSay1 PROMPT "Servizi singoli" SIZE 400,24 PIXEL OF oDlgServices CENTER FONT oBold
@ 10,440 SAY oSay2 PROMPT "Servizi multipli" SIZE 400,24 PIXEL OF oDlgServices CENTER FONT oBold
@ 95, 40 XBROWSE oBrw1 SIZE 400,-65 PIXEL OF oDlgServices;
COLUMNS 5,2,4,7,8,9,12,11;
HEADERS "Tipo","Descrizione","Costo","Disp.","A4", "Pos", "Ord.","";
COLSIZES 40,90,50,50,30,30,34,34 ;
CELL LINES NOBORDER ;
DATASOURCE oServiziSingoli:cAlias
WITH OBJECT oBrw1
:nRowHeight := 30
WITH OBJECT oBrw1:aCols[ 1]
:lBmpStretch := .F.
:lBmpTransparent := .T.
:nwidth := 40
:bStrImage := {|| oServiziSingoli:IMAGE }
END
WITH OBJECT oBrw1:aCols[ 3]
:cEditPicture := '@ €99,999.99'
:nFootStrAlign := AL_RIGHT
END
WITH OBJECT oBrw1:aCols[ 5]
:AddBitmap({ "BTN_PNG_TICK" ,"BTN_PNG_TICK_RED"})
:bBmpData := { || iif( oServiziSingoli:a4, 1, 2) }
:bStrData := { || "" }
END
WITH OBJECT oBrw1:aCols[ 6]
:AddBitmap({ "BTN_PNG_TICK" ,"BTN_PNG_TICK_RED"})
:bBmpData := { || iif(oServiziSingoli:pos, 1, 2) }
:bStrData := { || "" }
END
WITH OBJECT oBrw1:aCols[ 8]
:AddBitmap({ "BTN_PNG_LOCKSI" ,"BTN_PNG_LOCKNO"})
:bBmpData := { || iif( oServiziSingoli:ISlock, 1, 2) }
:bStrData := { || "" }
END
:lHscroll := .F.
:l2007 := .F.
:l2015 := .T.
:lRecordSelector := .f.
:nStretchCol := STRETCHCOL_WIDEST
:lAllowRowSizing := .F.
:lAllowColSwapping := .F.
:lAllowColHiding := .F.
:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
:SetoDBF( oServiziSingoli )
:CreateFromCode()
END
for n := 1 to len(oBrw1:aCols)
oBrw1:aCols[n]:lAllowSizing := .f.
next
@ 95,450 XBROWSE oBrw2 SIZE -40,-65 PIXEL OF oDlgServices;
COLUMNS 5,2,4,8,9,12;
HEADERS "Tipo","Descrizione","Costo","A4", "Pos", "Ord.";
COLSIZES 40,150,70,30,30,40 ;
CELL LINES NOBORDER ;
DATASOURCE oServiziMultipli:cAlias
WITH OBJECT oBrw2
:nRowHeight := 30
WITH OBJECT oBrw2:aCols[ 1]
:lBmpStretch := .F.
:lBmpTransparent := .T.
:nwidth := 40
:bStrImage := {||oServiziMultipli:IMAGE }
END
WITH OBJECT oBrw2:aCols[ 3]
:cEditPicture := '@ €99,999.99'
:nFootStrAlign := AL_RIGHT
END
WITH OBJECT oBrw2:aCols[ 4]
:AddBitmap({ "BTN_PNG_TICK" ,"BTN_PNG_TICK_RED"})
:bBmpData := { || iif( oServiziMultipli:a4, 1, 2) }
:bStrData := { || "" }
END
WITH OBJECT oBrw2:aCols[ 5]
:AddBitmap({ "BTN_PNG_TICK" ,"BTN_PNG_TICK_RED"})
:bBmpData := { || iif( oServiziMultipli:pos, 1, 2) }
:bStrData := { || "" }
END
:lHscroll := .F.
:l2007 := .F.
:l2015 := .T.
:lRecordSelector := .f.
:nStretchCol := STRETCHCOL_WIDEST
:lAllowRowSizing := .F.
:lAllowColSwapping := .F.
:lAllowColHiding := .F.
:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
:SetoDBF( oServiziMultipli )
:CreateFromCode()
END
for n := 1 to len(oBrw2:aCols)
oBrw2:aCols[n]:lAllowSizing := .F.
next
@ 550,660 BTNBMP oBtnClose PROMPT "Ordina" ;
RESOURCE "BTN_PNG_ELEMENTIORD" FLAT;
SIZE 95,40 LEFT PIXEL OF oDlgServices ;
ACTION NIL
@ 550,760 BTNBMP oBtnOK PROMPT "Esci" ;
RESOURCE "BTN_PNG_USCITA" FLAT;
SIZE 95,40 LEFT PIXEL OF oDlgServices ;
ACTION oDlgServices:End()
@ 50,100 BTNBMP oBtnNew PROMPT "Nuovo" ;
RESOURCE "BTN_PNG_SERVIZI_NEW" FLAT;
SIZE 90,40 RIGHT PIXEL OF oDlgServices;
ACTION SeEdita(oBrw1, 1, , oDlgServices, ,cFilter1)
oBtnNew:oCursor:=cCursor
SetGradientBtnbmp(1999,oBtnNew)
@ 50,200 BTNBMP oBtnMod PROMPT "Modifica" ;
RESOURCE "BTN_PNG_SERVIZI_MOD" FLAT;
SIZE 90,40 RIGHT PIXEL OF oDlgServices;
ACTION SeEdita(oBrw1, 2, , oDlgServices, ,cFilter1)
oBtnMod:oCursor:=cCursor
SetGradientBtnbmp(1999,oBtnMod)
@ 50,300 BTNBMP oBtnCan PROMPT "Cancella" ;
RESOURCE "BTN_PNG_SERVIZI_DEL" FLAT;
SIZE 90,40 RIGHT PIXEL OF oDlgServices;
ACTION SeBorra(oBrw1)
oBtnCan:oCursor:=cCursor
SetGradientBtnbmp(1999,oBtnCan)
@ 50,480 BTNBMP oBtnNew1 PROMPT "Nuovo" ;
RESOURCE "BTN_PNG_MULTIPLI_NEW" FLAT;
SIZE 90,40 LEFT PIXEL OF oDlgServices;
ACTION SeMultiEdita(oBrw2, 1, , oDlgServices, ,cFilter2)
oBtnNew1:oCursor:=cCursor
SetGradientBtnbmp(1999,oBtnNew1)
@ 50,580 BTNBMP oBtnMod1 PROMPT "Modifica" ;
RESOURCE "BTN_PNG_MULTIPLI_MOD" FLAT;
SIZE 90,40 LEFT PIXEL OF oDlgServices;
ACTION SeMultiEdita(oBrw2, 2, , oDlgServices, ,cFilter2)
oBtnMod1:oCursor:=cCursor
SetGradientBtnbmp(1999,oBtnMod1)
@ 50,680 BTNBMP oBtnCan1 PROMPT "Cancella" ;
RESOURCE "BTN_PNG_MULTIPLI_DEL" FLAT;
SIZE 90,40 LEFT PIXEL OF oDlgServices;
ACTION SeBorra(oBrw2)
oBtnCan1:oCursor:=cCursor
SetGradientBtnbmp(1999,oBtnCan1)
oDlgServices:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570
oDlgServices:bResized := <||
local oRect := oDlgServices:GetCliRect()
local x := Int( oRect:nWidth / 2 )
oSay1:nWidth := x - 40
oSay2:nLeft := x
oSay2:nWidth := x - 40
oBrw1:nWidth := x - 40
oBrw2:nLeft := x + 40
oBrw2:nWidth := 200
oBtnClose:nLeft := oRect:nRight - 220
oBtnClose:nTop := oRect:nBottom - 50
oBtnOK:nLeft := oRect:nRight - 120
oBtnOK:nTop := oRect:nBottom - 50
oBtnNew:nTop := oRect:ntop + 50
oBtnNew:nLeft := x - 350
oBtnMod:nTop := oRect:ntop + 50
oBtnMod:nLeft := x - 250
oBtnCan:nTop := oRect:ntop + 50
oBtnCan:nLeft := x - 150
oBtnNew1:nTop := oRect:ntop + 50
oBtnNew1:nLeft := x + 100
oBtnMod1:nTop := oRect:ntop + 50
oBtnMod1:nLeft := x + 200
oBtnCan1:nTop := oRect:ntop + 50
oBtnCan1:nLeft := x + 300
return nil
>
ACTIVATE DIALOG oDlgServices CENTERED
RELEASE FONT oFont, oBold
return nil
//---------------------------------------------------------------------//
Function SeEdita(oGrid, nMode, oCont, oParent, cUtente,cFilter1)
return nil
//----------------------------------------------------------------------//
Function SeBorra(oGrid, oCont)
return nil
//----------------------------------------------------------------------//
Function SeMultiEdita(oGrid, nMode, oCont, oParent, cUtente,cFilter2)
return nil
//---------------------------------------------------------------------//
Function Db_Open(cDbf,lShare)
local oDbf
SET EXCLUSIVE OFF
SET AUTORDER TO 1
oDbf := TDatabase():Open( nil, cDbfPath+cDbf, ,lShare )
return oDbf
//----------------------------------------------//