I have a timetable view calendar and can add an appointment and save it to a database without any problems.
I have modified on the fly the AppointmentForm to show a new textbox and a button which will allow the user to save a contact against the current appointment.
I can save the appointment which is created in the drag_drop event as a local variable to that event without problem.
I can create a contact via my custom button on the AppointmentForm and save it.
However the two are not linked?
I look in my database and I see the appointment in the Item table and the contact in the Contact table but nothing in the ItemContact table which I believe links the two?
Here is the contact creation code:
Private Sub EditContact(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim frm As ContactDialog = New ContactDialog
frm.ShowDialog()
If frm.DialogResult = Windows.Forms.DialogResult.OK Then
Dim c As Contact = New Contact
c.FirstName = frm.txtCarrier.Text
c.LastName = frm.txtContact.Text
c.Phone = frm.txtTelephone.Text
c.Email = frm.txtEmail.Text
Me.calTimeTableView.Schedule.Contacts.Add(c)
End If
End Sub
How do I find the required appointment in the Calendar to asscociate the newly created (or to be edited) contact?
Thnx