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

Drag Occurence

 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: Drag Occurence
    Posted: 10 February 2006 at 6:03am

hi,

I have a master event and a recurrence pattern, which means that there is a series of occurences.

If I click and drag one of the occurences to another location, the occurence turns into an exception with a new date and time. I have stored this data in the database.

Note that the exception has a different date/time.

When I load the form on which my calendar is a next time.. I need to make my exception replace the occurence.. and have the exception represented on the new "date/time"

Can I have a sample code that deals with that also please, because I really need it and the representation of the exception is still a problem for me.

Related forums:

https://forum.codejock.com/forum_posts.asp?TID=3609&PN=1

https://forum.codejock.com/forum_posts.asp?TID=3595&PN=1

https://forum.codejock.com/forum_posts.asp?TID=3576&PN=1

Thnx

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: 11 February 2006 at 2:55am
Hi WaaZ,

Please find some more description on times below:

1. Normal event and occurrence event have Start/End times.
 
2. Exception event has Start/End times and Start/End times of the occurrence (RExceptionStartTimeOrig, RExceptionEndTimeOrig).
 
MakeAsRException performs 2 actions:
- change recurrence state to exception
  and
- copy times:
    RExceptionStartTimeOrig = StartTime
    RExceptionEndTimeOrig  = EndTime
 
This mean that for an exception you have to store 4 values of time (not 2):
   
    StartTime
    EndTime
    RExceptionStartTimeOrig
    RExceptionEndTimeOrig
 
There are 2 ways to restore exception time properties:
 
1. ------------------------------------------------------------ ---------------------
    excepEv.StartTime = <original ocurrence start time>
    excepEv.EndTime = <original ocurrence end time>
   
    excepEv.MakeAsRException()  // copy times to RExceptionStartTimeOrig, RExceptionEndTimeOrig
 
    excepEv.StartTime = <new exception start time>
    excepEv.EndTime = <new exception end time>
 
2. ------------------------------------------------------------ ---------------------
    excepEv.MakeAsRException()
 
    excepEv.RExceptionStartTimeOrig = <original ocurrence start time>
    excepEv.RExceptionEndTimeOrig = <original ocurrence end time>
   
    excepEv.StartTime = <new exception start time>
    excepEv.EndTime = <new exception end time>

--
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: 13 February 2006 at 9:50am

Thnks,

it works fine.

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: 22 February 2006 at 3:22pm

Hi again,

I click and drag an occurence and in the Event handler CalendarControl_EventChanged(object sender, AxXtremeCalendarControl._DCalendarControlEvents_EventChangedEvent e), I get hold of e.eventID.

The following code returns null;

CalendarHitTestInfo HitTest;

HitTest = CalendarControl.ActiveView.HitTest();

HitTest.ViewEvent  -- .ViewEvent is null

And also the following returns null:

CalendarControl.DataProvider.GetEvent(e.eventID);

Can you please tell me how I can get hold of the new exception created and the new date.

Thnks

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: 24 February 2006 at 3:44pm
Something like following:


g_LastEventID;
 
EventChanged (e)
{
    g_LastEventID = e.eventID;
}
 
PatternChanged (e)
{
    pPattern = CalendarControl.DataProvider.GetRecurrencePattern(e.patternI D)       
    // iterate pPattern.Exceptions
    // for
    // pPattern.Exceptions.EventID == g_LastEventID

}


--
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: 15 March 2006 at 7:01am

It works fine,

Thnk u

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.219 seconds.