Print Page | Close Window

Drag Occurence

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=3637
Printed Date: 21 November 2024 at 8:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Drag Occurence
Posted By: WaaZ
Subject: Drag Occurence
Date 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=3609&PN=1

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

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

Thnx

WaaZ

 




Replies:
Posted By: sserge
Date 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




Posted By: WaaZ
Date Posted: 13 February 2006 at 9:50am

Thnks,

it works fine.



Posted By: WaaZ
Date 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



Posted By: sserge
Date 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


Posted By: WaaZ
Date Posted: 15 March 2006 at 7:01am

It works fine,

Thnk u




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net