Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DBI ctSchedule doesn't actually clear time bars
Message
De
03/12/2013 12:32:37
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01589161
Message ID:
01589191
Vues:
45
SSchedule - 40 (40+ was the name of the exe to install).

I am using version 8.0. I am also having problems with setting bar text. No error- the bar text just never gets set. You are certainly welcome to examine the code and point out something that I may be missing:
LPARAMETERS toScheduleObject
LOCAL lnBarColor, liStartTime, liEndTime , liStartDate, liEndDate, lnI, lnBarNdx, liItmNdx
*** Clear the time bars just in case the user selected a new start date
*** Or Checks one of the boxes that says "View this event only" etc.
*** The documentation says that the following should work, but in practice
*** it does not - the call to ClearTimeBars() returns true, but they remain 
*** visible in the scheduler, so get out the sledge hammer
*!*	FOR lnI = 1 TO toScheduleObject.ListCount
*!*		toScheduleObject.ClearTimeBars(lnI)
*!*	ENDFOR 
toScheduleObject.ClearSchedule()
Thisform.Initializelistbar(toScheduleObject)
DO CASE 
	CASE toScheduleObject = Thisform.pgfSchedule.pgEvents.oSchedule.object
		*** Get all the items in the list bar into a cursor in the same order that they are in the list bar
		IF Thisform.chkThisEvent.value		
			SELECT DISTINCT FullName FROM SchedulerService_V WHERE SrvEvtID = Thisform.CurrentEventID INTO CURSOR qTmp NOFILTER 
		ELSE 
			SELECT DISTINCT FullName FROM SchedulerService_V ORDER BY FullName INTO CURSOR qTmp NOFILTER 		
		ENDIF
		SCAN
			liItmNdx = INT(RECNO('qTmp'))
			*** Process all the events for that person
			SELECT * FROM SchedulerService_V WHERE FullName == qTmp.Fullname INTO CURSOR Fred NOFILTER 
			SCAN 
				*** Need to add the case for "Non-Service" once I figure out what the heck that means
				DO CASE 
					CASE Fred.SrvEvtID = Thisform.CurrentEventID
						lnBarColor = Thisform.shpThisEvent.BackColor
					CASE Fred.ServiceID = Thisform.CurrentServiceid  
						lnBarColor = Thisform.ShpThisService.BackColor
					OTHERWISE
						lnBarColor = Thisform.shpOtherService.BackColor
				ENDCASE  
				*** Make sure we actually have a scheduled event
				IF NOT EMPTY(Fred.EvtTimeBeg) AND NOT EMPTY(SchedulerService_V.EvtTimeEnd) AND ;
					NOT EMPTY(NVL(SchedulerService_V.EvtDateBeg, {})) AND NOT EMPTY(NVL(Fred.EvtDateEnd, {}))
					*** Make the the event falls within the selected date range
					liStartTime = (VAL(GETWORDNUM(Fred.EvtTimeBeg, 1, ':')) * 60) + VAL(GETWORDNUM(Fred.EvtTimeBeg, 2, ':'))
					liEndTime = (VAL(GETWORDNUM(Fred.EvtTimeEnd, 1, ':')) * 60) + VAL(GETWORDNUM(Fred.EvtTimeEnd, 2, ':'))
					liStartDate = Fred.EvtDateBeg - {^1900-01-01}
					liEndDate = Fred.EvtDateEnd - {^1900-01-01}				
					*** Make sure that at least part of the event occurs within the specified date range
					IF liStartDate <= toScheduleObject.DateEnd AND liEndDate >= toScheduleObject.DateStart
						IF NOT Thisform.chkThisEvent.Value
							lnBarNdx = toScheduleObject.AddColorBar(liStartTime, liEndTime, liStartDate, liEndDate, lnBarColor, liItmNdx)
							toScheduleObject.BarCargo[liItmNdx, lnBarNdx] = PADL(Fred.SrvEvtID, 10, ' ')
							toScheduleObject.BarText[liItmNdx, lnBarNdx] = ALLTRIM(Fred.EvtTypeDesc)
						ELSE 
							IF Fred.SrvEvtID = Thisform.CurrentEventID
								lnBarNdx = toScheduleObject.AddColorBar(liStartTime, liEndTime, liStartDate, liEndDate, lnBarColor, liItmNdx)
								toScheduleObject.BarCargo[liItmNdx, lnBarNdx] = PADL(Fred.SrvEvtID, 10, ' ')
								toScheduleObject.BarText[liItmNdx, lnBarNdx] = ALLTRIM(Fred.EvtTypeDesc)
							ENDIF 
						ENDIF 
					ENDIF  
				ENDIF 
			ENDSCAN
			SELECT qTmp
		ENDSCAN 
ENDCASE 
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform