Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Exceptions
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Exceptions

 Post Reply Post Reply
Author
Message
WaaZ View Drop Down
Senior Member
Senior Member


Joined: 31 January 2006
Location: United Kingdom
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote WaaZ Quote  Post ReplyReply Direct Link To This Post Topic: Exceptions
    Posted: 08 May 2006 at 7:12am

Has there been any change in the process of addind exceptions programatically?

The way it was being done in the previous version (9.8.2) is not working now on version 10.1.1

Thanks

WaaZ

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2006 at 11:20am
Hmm...
As I can see, neither Recurrence structure nor exceptions were not significantly changed, may be only some small fixes.

However, there were a lot of other data related changes like adding resources and schedules concepts.

Anyway, a couple simple tests I've tried right now works fine for me. So far, we need more details on your problems to say something.


ps: I can suppose only one problem related to recent changes -- now, if you use schedules, you have to set ScheduleID property both for master recurrence event and for exception event as well (the same value of course).

--
WBR,
Serge
Back to Top
WaaZ View Drop Down
Senior Member
Senior Member


Joined: 31 January 2006
Location: United Kingdom
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote WaaZ Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2006 at 11:23am

The moment you were typing the reply.. i found out the difference.

if you do a ChangeEvent(masterEvent)... it overrides the exceptions.. This is causing problems whereby i want to change only details of the series.. like the title.. .and when i do a changeEvent.. i lose my exceptions.. There are work arounds.. but expensive in development time and execution time also.

In the previous version, it was alright

Quote

CalendarEvent masterEv = CalendarControl.DataProvider.CreateEvent();

//DateTime tempdate = DateTime.Now;

masterEv = CalendarControl.DataProvider.CreateEvent();

masterEv.Subject = "Master Ev";

masterEv.Location = "Master Loca";

masterEv.ScheduleID = 1;

CalendarRecurrencePattern RecurEv = masterEv.CreateRecurrence();

DateTime dtStart = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 13, 8, 0);

DateTime dtRecurencePattern_Start = new DateTime(DateTime.Now.Ticks);

// duration

// RecurEv.StartTime = DateTime.Now;

RecurEv.DurationMinutes = 60;

// period

dtRecurencePattern_Start = DateTime.Now.AddDays(-4);

RecurEv.StartDate = dtRecurencePattern_Start;

dtRecurencePattern_Start = DateTime.Now.AddDays(10);

RecurEv.StartTime = dtRecurencePattern_Start;

RecurEv.EndDate = dtRecurencePattern_Start;

RecurEv.Options.RecurrenceType = CalendarRecurrenceType.xtpCalendarRecurrenceDaily;

RecurEv.Options.DailyEveryWeekDayOnly = false;

RecurEv.Options.DailyIntervalDays = 1;

masterEv.UpdateRecurrence(RecurEv);

CalendarControl.DataProvider.AddEvent(masterEv);

// CalendarControl.DataProvider.ChangeEvent(masterEv);

/************/

/************/

// CalendarEvent excepEv = CalendarControl.DataProvider.CreateEventEx(masterEv.Id);

CalendarEvent excepEv = CalendarControl.DataProvider.CreateEvent();

excepEv.StartTime = dtRecurencePattern_Start.AddDays(-9);

excepEv.EndTime = dtRecurencePattern_Start.AddDays(-9).AddMinutes(60);

excepEv.Subject = "Excep Ev";

excepEv.ScheduleID = 2;

excepEv.MakeAsRExceptionEx(RecurEv.Id);

 

// excepEv.RExceptionEndTimeOrig = dtRecurencePattern_Start.AddDays(-10).AddMinutes(60);

//excepEv.RExceptionStartTimeOrig = dtRecurencePattern_Start.AddDays(-10);

excepEv.StartTime = dtRecurencePattern_Start.AddDays(-9).AddMinutes(180);

excepEv.EndTime = dtRecurencePattern_Start.AddDays(-9).AddMinutes(240);

//excepEv.RExceptionDeleted = true;

CalendarControl.DataProvider.ChangeEvent(excepEv);

// CalendarControl.DataProvider.ChangeEvent(masterEv);

excepEv = CalendarControl.DataProvider.CreateEvent();

excepEv.StartTime = dtRecurencePattern_Start.AddDays(-8);

excepEv.EndTime = dtRecurencePattern_Start.AddDays(-8).AddMinutes(60);

excepEv.Subject = "Excep Ev";

excepEv.MakeAsRExceptionEx(RecurEv.Id);

 

// excepEv.RExceptionEndTimeOrig = dtRecurencePattern_Start.AddDays(-10).AddMinutes(60);

//excepEv.RExceptionStartTimeOrig = dtRecurencePattern_Start.AddDays(-10);

excepEv.StartTime = dtRecurencePattern_Start.AddDays(-8).AddMinutes(-180);

excepEv.EndTime = dtRecurencePattern_Start.AddDays(-8).AddMinutes(-120);

//excepEv.RExceptionDeleted = true;

CalendarControl.DataProvider.ChangeEvent(excepEv);

CalendarControl.DataProvider.ChangeEvent(masterEv);

If you remove the last line, it will work...

Thanks

WaaZ

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2006 at 2:36pm
Ok, let me note once more about master events...
Here is a hierarchy:

<master event> - contains a recurrence pattern inside itself.
    <recurrence pattern> - contains exceptions events inside itself
        <exception events collection>

CalendarControl.DataProvider.AddEvent(masterEv);  - add master event with empty exceptions collection
    ....  
CalendarControl.DataProvider.ChangeEvent(excepEv); - add exception to master event in the storage only.
                                                          masterEv object is not updated!
 
CalendarControl.DataProvider.ChangeEvent(masterEv); - this master event object has empty exceptions collection. This line kills exceptions in the storage.

This works in the same way in all calendar versions.

--
WBR,
Serge
Back to Top
WaaZ View Drop Down
Senior Member
Senior Member


Joined: 31 January 2006
Location: United Kingdom
Status: Offline
Points: 103
Post Options Post Options   Thanks (0) Thanks(0)   Quote WaaZ Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2006 at 7:23am

But it was different from the previous version (9.8.1, 9.8.2)

ChangeEvent(masterEV) was not killing the exceptions in the storage. Now it is..

I manage to change the codes in my program to cater for that though.. it is alright now.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.186 seconds.