Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Creating a Recurrence (Read 3855 times)
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Creating a Recurrence
Jan 23rd, 2008 at 5:14pm
Print Post  
I am trying to do this without my joy!

I have changed my code to open the built in appointment form and click the recurrence button and then save the changes but nothing gets written to my dataset and thus there is nothing to write back to the database.

I have looked at the Stock froms sample but all is says is the after calling .invalidate the changes are save?

I need to watch the changes that get saved to the Recurrence table so I can determine the values so as to help decide which recurrence types we want to use.

Any tips please?

Thanks

  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Creating a Recurrence
Reply #1 - Jan 24th, 2008 at 5:48am
Print Post  
Have you enabled saving recurrences by setting the appropriate data members in the Calendar control (that is, RecurrencesDataMember, RecurrenceExceptionsDataMember etc.)?

Meppy
  
Back to top
 
IP Logged
 
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Re: Creating a Recurrence
Reply #2 - Jan 24th, 2008 at 6:26pm
Print Post  
Hi, thanks yes I have that set, but I have now seen and using the stock form demo to work through this topic and making steady progress!

Sorry I should have looked there first!
  
Back to top
 
IP Logged
 
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Re: Creating a Recurrence
Reply #3 - Jan 28th, 2008 at 7:40am
Print Post  
Hi, I have a number of issues regarding the creating and maintaining of recurrences, as follows:

1.
After I have made all the required entries to a new recurrence I set the items recurrence like this:

myItem.Recurrence = myNewRecurrence

The calendar is correctly updated with the recurrence details.

When I step thru the code myItem.Recurrence correctly displays the newly created recurrence.

But when I save the data back to the table the data is saved correctly to each table except the Recurrence field in the Item table remains null (nothing)?

The recurrencestate field displays 3 instead of 0 signally to me that it knows it has a recurrence?

Is this happening because in the call to the SaveToDataSource method the Recurrence table is updated AFTER the Item table meaning at point of save there is no Key present in the Recurrence value to save to the Item table?

2.
As soon as I assign the recurrence to the item.recurrence property the calendar automatically updates to display an appointment for each occurence.

But none of the methods of the calendar get called to signal an appointment has been created?  This means my month view calendar does not display highlights on each day a occurence recurs?

3.
The user guide refers to fields that do not appear in a Recurrence object, namely:

recurrence.StartHour
recurrence.StartMinute
recurrence.EndHour
recurrence.EndMinute

Am I missing something as my version does not have these fields?

4.
Currently I get 1 row for an appointment in the Item table and 1 row for a recurrence in the Recurrence table.

If I have a daily recurrence to recur 3 times and I then edit the 2nd occurence to start at a different time where is this diffence stored as I cannot see in the Recurrence table how it would store multiple start and end times in a single row?

Sorry for the mass of questions ..... Sad

Thanks
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Creating a Recurrence
Reply #4 - Jan 28th, 2008 at 12:56pm
Print Post  
1. As far as I understand it, you are having problems saving recurrent appointments to the database. I will test this here and let you know of the results. It will help if you can send me your project and database through e-mail or at least tell me which data members you have set.

2. The occurrences of a recurrent item are only temporary created at the time they are displayed and immediately disposed after that. Thats why no events are raised for such items. If you want to obtain all items within a particular time interval (in order to update the data cells containing them, for example), you can use the Calendar.Schedule.GetAllItems(...) method.

3. The properties you have specified have been removed in version 4.1 of Planner.NET. You have to obtain a newer version of the documentation. A complete documentation can be found in the most recent setup, which can be downloaded here: https://mindfusion.eu/PlannerTrial.zip

The values of these properties are now automatically obtained from the master item of the recurrence.

4. Modified recurrent items are automatically transformed into recurrence exceptions. Exceptions are saved in a separate table in the database, as specified in the Calendar.RecurrenceExceptionsDataMember property.

Hope it helps,

Meppy
  
Back to top
 
IP Logged
 
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Re: Creating a Recurrence
Reply #5 - Jan 28th, 2008 at 1:53pm
Print Post  
1.

Here is the code I use to populate the recurrence:

Code
Select All
 With grecRecurrence

		    ' daily = 0,  weekly = 1, monthly = 2

		    .Pattern = mindRecurrencePattern

		    .MonthlyRecurrence = MonthlyRecurrence.ByDayNumber

		    .YearlyRecurrence = YearlyRecurrence.ByDayType

		    ' the starting date of the recurrence

		    .StartDate = Me.dtmRangeStartDate.Value

		    ' the end pattern of the recurrence

		    .RecurrenceEnd = mindRecurrenceEnd

		    ' number of time recurrence will recur

		    .NumOccurrences = Me.updRangeReccurence.Value

		    ' the end date of this recurrence

		    .EndDate = Me.dtmRangeEndDate.Value

		    ' every day = 0,  every week day = 1,  every weekend day = 2

		    .DailyRecurrence = mindDailyRecurrence

		    ' the number of days between recurrences

		    .Days = Me.updPatternRecurrence.Value

		    ' set to 1 as this is only used when set to a monthly recurrence

		    .DayOfMonth = 1

		    ' set to 1 as this is only used when set to a weekly recurrence

		    .Weeks = 1

		    ' the day of week that the recurrence starts on

		    .DaysOfWeek = mindDaysOfWeek

		    ' set to 1 as this is only used when set to a weekly recurrence

		    .Months = 1

		    .Occurrence = Occurrence.First

		    .Day = DayOfWeekType.AnyDay
end with
 



then I do myItem.Recurrence = grecRecurrence and it all matches etc.

The calendar displays the recurrence correctly even after I close and reopen the app so the data is getting saved only the recurrence field does not get populated with the recurrence key?

2.

I will look into the getallitems method and see what happens thanks.

3.

I have a full registered copy and the help file came with that?  Has an update been released that I have not been informed about?

4.

Ah I see, I have not got that far into it yet!

Thanks

  
Back to top
 
IP Logged
 
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Re: Creating a Recurrence
Reply #6 - Jan 28th, 2008 at 2:54pm
Print Post  
Regarding point 3.

I have version 4.3 of planner.net install, registered copy and the help file that comes with that as well as that in the trial .msi both refer to the mentioned fields.

The help file needs updating?

  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Creating a Recurrence
Reply #7 - Jan 29th, 2008 at 6:06am
Print Post  
Here is a link to the most recent version of Planner.NET Documentation:

https://mindfusion.org/_planner/_Planner.NET_help.zip

As for point 1, I can't seem to understand what is the problem if recurrences save and load fine from the database. Any more details?

Meppy
  
Back to top
 
IP Logged
 
elpuerco
Junior Member
**
Offline


Time?  What's time matta
to a pig?

Posts: 94
Joined: Oct 2nd, 2007
Re: Creating a Recurrence
Reply #8 - Jan 29th, 2008 at 6:42am
Print Post  
Hi, yes this is the exact same copy of the help I already have which is out of date as you say the

.StartHour, .StartMinute etc are no longer relevant?

Here is an extract from the help for the recurrence property of an item:

Dim recurrence As New Recurrence()
recurrence.Pattern = RecurrencePattern.Daily
recurrence.Days = 2
recurrence.StartDate = item.StartTime
recurrence.RecurrenceEnd = RecurrenceEnd.Never
recurrence.StartHour = item.StartTime.Hour
recurrence.StartMinute = item.StartTime.Minute
recurrence.EndHour = item.EndTime.Hour
recurrence.EndMinute = item.EndTime.Minute

' Associate the recurrence with the item by simply setting the Recurrence property
item.Recurrence = recurrence

This is no longer relevant and thus confused me as 4.3 does not have these settings?


Regarding point 1 in my post what I dont understand is that according to the current help file the field recurrence in the item table should hold the key to the related recurrence in the recurrence table.  This would be the same as the location field in the item table holding the key of the location from the location table.

The confusion is that after I save the tables to the database using SaveToDataSource the recurrence field in the item table remains NULL which from what I understand in the help should hold the key value from the recurrence table?

However just stepping thru the code again and I see that the the field Master in the recurrence table is the link between the item and recurrence table?

The help file for the item lead me astray....
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Creating a Recurrence
Reply #9 - Jan 29th, 2008 at 10:38am
Print Post  
Indeed, it appears that some of the sample code snippets within documentation have not been updated to reflect the recent changes in Planner.NET. We will search for such snippets and update them accordingly.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint