473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Handling reoccurance appts in Scheduling application

I'm designing my db for a online Scheduling web application. How do you
suggest I handle reoccuring events?

In my appointments table should I just add 1 record for EACH time the
appointment will appear (and link all "related" appts with a key field)? Or
should I just have 1 record for each appointment, whether it's reoccuring or
not.

I downloaded the RadScheduler app and noticed in their sample db they had a
"RecurrenceRule" and "RecurrenceParent" column in their Appts table. But
didn't understnad the implementation. A sample RecurrenceRule data was:
DTSTART:20070330T063000Z
DTEND:20070330T073000Z
RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20070406T210000Z ;BYDAY=MO,TU,WE,TH,FR;

It looks like they use 1 record for each appt, whether its a one time or
recurring appt. But, I guess you would have to write to code figure out the
future "phantom" recurring appts????

Any advice would be appreciated.
Jun 27 '08 #1
4 1658

I'm sure there are other products that implement the standard, but here is
one:

http://www.aspose.com/categories/uti...t/default.aspx

If you're dealing with dates and rules, I'd pay the little bit of $$$ for
something like the iCalendar.

"Cirene" <ci****@nowhere.comwrote in message
news:eD**************@TK2MSFTNGP03.phx.gbl...
I'm designing my db for a online Scheduling web application. How do you
suggest I handle reoccuring events?

In my appointments table should I just add 1 record for EACH time the
appointment will appear (and link all "related" appts with a key field)?
Or should I just have 1 record for each appointment, whether it's
reoccuring or not.

I downloaded the RadScheduler app and noticed in their sample db they had
a "RecurrenceRule" and "RecurrenceParent" column in their Appts table.
But didn't understnad the implementation. A sample RecurrenceRule data
was:
DTSTART:20070330T063000Z
DTEND:20070330T073000Z
RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20070406T210000Z ;BYDAY=MO,TU,WE,TH,FR;

It looks like they use 1 record for each appt, whether its a one time or
recurring appt. But, I guess you would have to write to code figure out
the future "phantom" recurring appts????

Any advice would be appreciated.

Jun 27 '08 #2

What I did was keep a instance row in the db....and I had an internal cutoff
date.
Usually, up to 2 years.

The problem is ... when they say "never ends"...how far in the db do you
store them?

I picked a 2 year max (configurable # years, but something besides
"forever".

THEN I had a IsSoftDeleted column...because if they removed an instance, but
you reran the rule....the removed instance would reappear.

Thus I used to IsSoftDeleted flag to know the difference and avoid the
re-generation.

I hope that makes sense.

...

"Cirene" <ci****@nowhere.comwrote in message
news:eD**************@TK2MSFTNGP03.phx.gbl...
I'm designing my db for a online Scheduling web application. How do you
suggest I handle reoccuring events?

In my appointments table should I just add 1 record for EACH time the
appointment will appear (and link all "related" appts with a key field)?
Or should I just have 1 record for each appointment, whether it's
reoccuring or not.

I downloaded the RadScheduler app and noticed in their sample db they had
a "RecurrenceRule" and "RecurrenceParent" column in their Appts table.
But didn't understnad the implementation. A sample RecurrenceRule data
was:
DTSTART:20070330T063000Z
DTEND:20070330T073000Z
RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20070406T210000Z ;BYDAY=MO,TU,WE,TH,FR;

It looks like they use 1 record for each appt, whether its a one time or
recurring appt. But, I guess you would have to write to code figure out
the future "phantom" recurring appts????

Any advice would be appreciated.

Jun 27 '08 #3
So, if they created a new appt with a reocurrence of every 2 weeks, you
would create all the future records with a little "tag" to show that they
are all grouped together? That makes sense and that's kind of what I was
planning to do.

But, if they come back and edit the appts from every 2 weeks, to every 3
days, but only M, T, and S, then you would delete the "group" and recalc?

Something like that?

Thanks!!!

"sloan" <sl***@ipass.netwrote in message
news:e0**************@TK2MSFTNGP06.phx.gbl...
>
What I did was keep a instance row in the db....and I had an internal
cutoff date.
Usually, up to 2 years.

The problem is ... when they say "never ends"...how far in the db do you
store them?

I picked a 2 year max (configurable # years, but something besides
"forever".

THEN I had a IsSoftDeleted column...because if they removed an instance,
but you reran the rule....the removed instance would reappear.

Thus I used to IsSoftDeleted flag to know the difference and avoid the
re-generation.

I hope that makes sense.

..

"Cirene" <ci****@nowhere.comwrote in message
news:eD**************@TK2MSFTNGP03.phx.gbl...
>I'm designing my db for a online Scheduling web application. How do you
suggest I handle reoccuring events?

In my appointments table should I just add 1 record for EACH time the
appointment will appear (and link all "related" appts with a key field)?
Or should I just have 1 record for each appointment, whether it's
reoccuring or not.

I downloaded the RadScheduler app and noticed in their sample db they had
a "RecurrenceRule" and "RecurrenceParent" column in their Appts table.
But didn't understnad the implementation. A sample RecurrenceRule data
was:
DTSTART:20070330T063000Z
DTEND:20070330T073000Z
RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20070406T210000 Z;BYDAY=MO,TU,WE,TH,FR;

It looks like they use 1 record for each appt, whether its a one time or
recurring appt. But, I guess you would have to write to code figure out
the future "phantom" recurring appts????

Any advice would be appreciated.


Jun 27 '08 #4

I use the EventInstance.RemoveDate as the "IsSoftDelete" flag.
If it is null, then I assume its legit, if it is populated, I assume it was
softdeleted.
This is 2 year old code, so don't ask too many detailed questions about it.

My soft delete "IsRemoved" case statement in sql server looks like this:

Select
--EventDefinitionID ,
EventDefinitionUUID ,
CAST(EDTS as int) as EDTS ,
EventDefinitionTypeUUID ,
EventDefinitionName ,
EventICalendarExpression ,
EventMasterStartTime ,
EventMasterEndTime ,
CreateDate ,
UpdateDate ,
LastInstanceUpdateDate ,
RemoveDate ,

'IsRemoved' =
CASE
WHEN RemoveDate IS NULL THEN 0
ELSE 1
END

From
dbo.EventDefinition ed


Here is my DDL. I can't help much beyond this, I never finished everything
myself.

if exists (select * from sysobjects
where id = object_id('EventInstance'))
DROP TABLE EventInstance

if exists (select * from sysobjects
where id = object_id('EventDefinition'))
DROP TABLE EventDefinition

if exists (select * from sysobjects
where id = object_id('EventDefinitionType'))
DROP TABLE EventDefinitionType

CREATE TABLE dbo.EventDefinitionType (

--EventDefinitionTypeID int IDENTITY (1,1) PRIMARY KEY NONCLUSTERED, --self
explanatory
EventDefinitionTypeUUID uniqueidentifier NOT NULL DEFAULT NEWID() PRIMARY
KEY NONCLUSTERED ,
EventDefinitionTypeName varchar(128) NOT NULL UNIQUE ,

CONSTRAINT edt_key UNIQUE ( EventDefinitionTypeUUID )
)

CREATE TABLE dbo.EventDefinition (

--EventDefinitionID int IDENTITY (1,1) PRIMARY KEY NONCLUSTERED, --self
explanatory
EventDefinitionUUID uniqueidentifier NOT NULL DEFAULT NEWID() PRIMARY KEY
NONCLUSTERED ,
EDTS timestamp null ,
EventDefinitionTypeUUID uniqueidentifier NOT NULL FOREIGN KEY
(EventDefinitionTypeUUID) REFERENCES
EventDefinitionType(EventDefinitionTypeUUID) DEFAULT
'00000000-0000-0000-0000-000000000000', --

EventDefinitionName varchar(128) NOT NULL UNIQUE ,
EventICalendarExpression varchar(1024) NULL , --NULL for manual entries
EventMasterStartTime varchar(24) NULL DEFAULT '00:00:00' ,
EventMasterEndTime varchar(24) NULL DEFAULT '00:00:00' ,
CreateDate datetime NOT NULL DEFAULT getDate(),
UpdateDate datetime NOT NULL DEFAULT getDate() ,

LastInstanceUpdateDate datetime NULL ,

RemoveDate datetime NULL ,

CONSTRAINT ed_key UNIQUE ( EventDefinitionUUID )
)
if exists (select * from sysobjects
where id = object_id('EventInstance'))
DROP TABLE EventInstance

CREATE TABLE dbo.EventInstance (

--EventInstanceID int IDENTITY (1,1) PRIMARY KEY NONCLUSTERED, --self
explanatory
EventInstanceUUID uniqueidentifier NOT NULL DEFAULT NEWID() PRIMARY KEY
NONCLUSTERED ,
EITS timestamp null ,

EventDefinitionUUID uniqueidentifier NOT NULL FOREIGN KEY
(EventDefinitionUUID) REFERENCES EventDefinition(EventDefinitionUUID), --

OccurenceDate datetime NOT NULL ,

EventInstanceStartTime varchar(24) NULL ,
EventInstanceEndTime varchar(24) NULL ,

Notes varchar(1024) NULL ,
ManualEntry bit NOT NULL DEFAULT 0 ,

CreateDate datetime NOT NULL DEFAULT getDate(),
UpdateDate datetime NOT NULL DEFAULT getDate() ,
RemoveDate datetime NULL ,
CONSTRAINT ei_key UNIQUE ( EventInstanceUUID )
)

GO

INSERT INTO dbo.EventDefinitionType ( EventDefinitionTypeUUID ,
EventDefinitionTypeName )
VALUES ( '00000000-0000-0000-0000-000000000000' , 'Unknown' )

INSERT INTO dbo.EventDefinitionType ( EventDefinitionTypeUUID ,
EventDefinitionTypeName )
VALUES ( '00000000-0000-0000-0000-000000000001' , 'No Rule' )

INSERT INTO dbo.EventDefinitionType ( EventDefinitionTypeUUID ,
EventDefinitionTypeName )
VALUES ( '00000000-0000-0000-0000-000000000002' , 'Simple Rule' )
INSERT INTO dbo.EventDefinitionType ( EventDefinitionTypeUUID ,
EventDefinitionTypeName )
VALUES ( '00000000-0000-0000-0000-000000000003' , 'Complex Rule' )

GO
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Newbie | last post by:
Could somebody please tell me whether it is possible to create a custom .NET application capable of scheduling Crystal Reports to execute at a certain point in time? I have a book explaining how...
3
by: Muscha | last post by:
Hi, In our application we need to have a high performance scheduling framework. We want to be able to say for item 21 do an update on such and such time. We will have around 1 million items of...
3
by: mirek | last post by:
Hello, My ASP.NET application must have additional functionality which isn't typical for ordinary web use. It is: - connecting to the other server using specified protocol (an option to...
3
by: Alphonse Giambrone | last post by:
Can anyone point me toward a good example of an asp.net scheduling app? Preferrably in vb.net. TIA -- Alphonse Giambrone Email: a-giam at customdatasolutions dot us
1
by: Majed | last post by:
hi I'm planing to make scheduling app and need your advice on the best way to do that,and how to save the tasks to be executed and retrive their data at the right time. your input will be highly...
0
by: Lemune | last post by:
Hello. I need some help on building my sms services application (using modem). My application is to do some scheduling task based on daily, weekly and monthly. On the daily the choice are everyday,...
4
by: Dinsdale | last post by:
I'm looking at adding scheduling features to an application and I wanted to ask the community about any experience with scheduling components, either open source like from code project or from a...
2
Ritchie
by: Ritchie | last post by:
Please can anyone help me with d programs in C for CPU scheduling: WAP to show FCFS scheduling algorithm. WAP to show SJF scheduling algorithm. WAP to show Priority scheduling algorithm. WAP...
1
by: amundsen | last post by:
I need to build a scheduling program. It will need to schedule a chain of resources. I'm wondering if anyone is aware of an existing framework that might help me to code this application. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.