search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How do you link events on a child resource where one id is linked on the child resource and the other id on the parent resource?

Asked by Warren
3 years ago.

Here is my table structure. I have a parent table of cement jobs. Child resources are cement pour types and events are the individual cement pours that include the pour type id, job id, start date and end date. The only way I have been able to link the events to the parent is to (in sql select) append both JobID + PourTypeID for the child resources and then append in sql the same for the events . I call the field GroupID.

Parent Jobs (jobs table)
-JobId
-JobName

Child Resource Pour Types (pour type table)
-PourTypeID
-PourType
-GroupID = (jobid + “-“ + pourtypeid)

Event Cement Pours (pour table)

  • PourID
  • JobDateStart
  • JobDateEnd
  • JobID
  • PourTypeID
  • GroupID = (jobid + “-“ + pourtypeid)

<DayPilot:DayPilotScheduler ID="DayPilotScheduler1"
DataStartField="JobDateStart"
DataEndField="JobDateEnd"
DataTextField="PourType"
DataValueField="PourID"
DataResourceField="GroupID"

I’m using the latest Daypilot pro version and coding in asp\vb.net.

Answer posted by Dan Letecky [DayPilot]
3 years ago.

There are two ways to approach it:

1. Create an on-the-fly composite id for the child resources - this is what you do.
2. Create a unique record for every job-pour type link in the database and use these links as child resources.

I see nothing wrong with your approach.

I would probably opt for #2 when designing the database from scratch because it would provide greater flexibility (e.g. custom order of child resources set individually for each job, different child resources for each job).

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.