Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Idea: Appointment Booking
Message
De
02/09/2005 06:12:24
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Need Idea: Appointment Booking
Divers
Thread ID:
01046135
Message ID:
01046135
Vues:
67
Dear All,

Thanks for the member of UT, I successfully formulated an appointment book, based on a series of shape, labels to form the background of the appointment book, i.e. the date of week, and time of each timeslot.

By reference to each shape's tag information, the date and time were calculated, then an editbox is added programmatically on the form, however, the problem is When TWO or more appointment occupied the same time slot e.g.

Appointment A: 9:30-10:30
Appointment B: 10:00-10:30

The editbox of Appointment B will be completely covered by Appointment A. My thought is that: if there is a double booking, the editbox of Appointment B move to right for 5 pixels, so that the right border is visible to user, but I can't think of anyway to detect.
SELECT appt
FOR iRec = 1 TO RECCOUNT('appt')
	Thisform.AddObject("A"+ALLTRIM(STR(appt_id)),'neditbox')
	loLabel = evaluate([Thisform.A]+TRANSFORM(appt_id))
	FOR x = 1 TO 7		&& Day
		cDayLabel = EVALUATE([Thisform.DayLabel]+TRANSFORM(x))
		IF cDayLabel.tag =	DTOC(TTOD(appt.appttime1))
			nLeft = cDayLabel.left
			nWidth = cDayLabel.width
			EXIT
		ENDIF
	ENDFOR
	FOR y = 1 TO 12		&& ApptTime1 (Start of the appointment)
		cTimeSlot1 = EVALUATE([Thisform.TimeSlot]+TRANSFORM(y))
		IF cTimeSlot1.tag = ALLTRIM(STR(HOUR(appt.appttime1)))
			nTop = cTimeSlot1.Top+MINUTE(appt.appttime1)/60*cTimeSlot1.Height
			EXIT
		ENDIF
	ENDFOR
	FOR y = 1 TO 12		&& AppTime2 (End of the Appointment)
		cTimeSlot2 = EVALUATE([Thisform.TimeSlot]+TRANSFORM(y))
		IF cTimeSlot2.tag = ALLTRIM(STR(HOUR(appt.appttime2)))
			nHeight = cTimeSlot2.Top+MINUTE(appt.appttime2)/60*cTimeSlot2.Height - nTop
			EXIT
		ENDIF
	ENDFOR
	WITH loLabel
		.visible = .T.
		.value = IIF(!EMPTY(pt_name),ALLTRIM(pt_name),"")+IIF(!EMPTY(case_no)," ("+ALLTRIM(case_no)+")","")+;
			IIF(!EMPTY(pt_tel)," ["+ALLTRIM(pt_tel)+"]","")+IIF(!EMPTY(TxRemark)," "+ALLTRIM(txRemark),"")
		.left = nLeft + 2
		.width = nWidth - 15
		.top = nTop
		.height = nHeight
	ENDWITH
	SKIP IN appt
ENDFOR

Thisform.LockScreen= .F.
Best regards,

Aaron Chu

********************************************************

Working with Visual FoxPro is a lot of FUN!

********************************************************
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform