Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving Multiple Values Into One Record of a Table
Message
De
20/12/2007 08:51:28
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
20/12/2007 08:35:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01276751
Message ID:
01276794
Vues:
30
Thanks, just what I was thinking. I was just trying to update my post when you responded.

I think I may have to create "sets" of rules using multiple records in the other table. I could tie them together with an AppointmentTypeCode. When I save from the entry, it checks the set and deletes/adds/updates accordingly. Mutliple records per set. Any good suggestions on how to handle that?


>multiple values should not be saved in one record. Create a child table to hold the values.
>
>>I create a cursor that has the rows/values below. Hours, Minutes (intervals) and then the days of the week (logicals). The user is basically creating an appointment type rule and these are the options that will be presented on the form. They can check any logical to block out time for whatever reason. If they want to block out each Wednesday from 9am to 12pm, then they just click on the appropriate checkboxes in the intervals for Monday. Choosing the FromDate and ToDate sets the start and end dates for the rule.
>>
>>My current issue is how to save their choices into one record of another table. That table is what will be used to actually go out and block out the times in our scheduling program. The record in that table contains a key field, AppointmentTypeCode, DOW, the start and end times for the block, and also the FromDate and ToDate values for the rule.
>>
>>I think there is a basic flaw, or at least a challange, that on this entry form, the user can enter multiple blocks of time, on various days. This means that there would be multiple records in the other table. I'm not sure how to handle that. I think it will mean selecting from the cursor below for any days/times that have a logical checked and then creating as many records/rules as there are days. I think...
>>
>>Any thoughts or questions welcome. Thanks!
>>
>>
>>       Hour    Minutes   SMTWTFS
>>
>>          8          0   FFFFFFF
>>          8         15   FFFFFFF
>>          8         30   FFFFFFF
>>          8         45   FFFFFFF
>>          9          0   FFFFFFF
>>          9         15   FFFFFFF
>>          9         30   FFFFFFF
>>          9         45   FFFFFFF
>>         10          0   FFFFFFF
>>         10         15   FFFFFFF
>>         10         30   FFFFFFF
>>         10         45   FFFFFFF
>>          .          .   .......
>>          .          .   .......
>>          .          .   .......
>>          6          0   FFFFFFF
>>          6         15   FFFFFFF
>>          6         30   FFFFFFF
>>          6         45   FFFFFFF
>>          7          0   FFFFFFF
>>          7         15   FFFFFFF
>>          7         30   FFFFFFF
>>          7         45   FFFFFFF
>>
>>
>>Code that creates the cursor:
>>
>>
>>
>>
>>CLOSE ALL
>>CLEAR
>>
>>CREATE CURSOR WeeklyPickList (;
>>	HOUR I, ;
>>	MINUTE I, ;
>>	SUNDAY L, ;
>>	MONDAY L, ;
>>	TUESDAY L, ;
>>	WEDNESDAY L, ;
>>	THURSDAY L, ;
>>	FRIDAY L, ;
>>	SATURDAY L)
>>
>>SELECT WeeklyPickList
>>
>>m.Interval = 15 && This will be populated from MB_Office (or something)
>>m.StartingHour = 8 && This will be populated from MB_Office (or something)
>>
>>m.TimeSlotsPerHour = (1440/m.Interval)/24 && 1,440 is the number of minutes in 24 hours
>>
>>FOR iHour = m.StartingHour TO 24 + (m.StartingHour -1)
>>	APPEND BLANK
>>	REPLACE WeeklyPickList.Hour WITH IIF(iHour>24,iHour-24,iHour)
>>	REPLACE WeeklyPickList.Minute WITH 0
>>	FOR iMinutes = 1 TO m.TimeSlotsPerHour -1
>>		APPEND BLANK
>>		REPLACE WeeklyPickList.Hour WITH IIF(iHour>24,iHour-24,iHour)
>>		REPLACE WeeklyPickList.Minute WITH iMinutes * m.Interval
>>	ENDFOR
>>ENDFOR
>>
>>BROWSE LAST
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform