This is a migrated thread and some comments may be shown as answers.

How to get ID of the last exception appointment

2 Answers 110 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
brian
Top achievements
Rank 1
brian asked on 19 Oct 2011, 12:19 AM
Hi,

I have customized implementation of Scheduler and there are some tables in the back end I need to update after appointment dragged and dropped by the user. To have that custom tables update done I need to have newly added ID of exception appointment. To get that ID I handle this event in following way:

  Private Sub RadScheduler1_RecurrenceExceptionCreated(sender As Object, e As Telerik.Web.UI.RecurrenceExceptionCreatedEventArgsHandles RadScheduler1.RecurrenceExceptionCreated
 
        RadScheduler1.DataBind()
        Dim NewAppID As Integer = GetLastAddedAppointmentID(RadScheduler1) 'my own function
 
    End Sub

This is my workaround of what might be a much more straightforward process. 
Moreover, with that approach there can be some issues with concurrency when more than one user are working
on the same scheduler.

So the question is what would be better way to extract that newly added ID of exception appointment?
Please advise.

Thanks!




2 Answers, 1 is accepted

Sort by
0
brian
Top achievements
Rank 1
answered on 19 Oct 2011, 06:56 PM
Please disregard my question above. I found solution. Insert event of the data source should be handled to get that last added id upon drag and drop of existing recurrent appointment. My data source is LINQ, so I have that handler as follows:

Private Sub LinqDataSource1_Inserted(sender As Object, 
e As System.Web.UI.WebControls.LinqDataSourceStatusEventArgsHandles LinqDataSource1.Inserted
   
        Dim result As yourLINQEntity.YourLINQObjects = e.Result
        Dim NewAppID As Integer = result.ID
 
	(more code here for update of the back end tables)

End Sub


Thanks!
0
Peter
Telerik team
answered on 20 Oct 2011, 04:58 PM
Hi Brian,

Thank you for sharing your solution in the forum.

We are glad that you were able to solve the problem yourself and apologize that we could not help you right away. 

Don't hesitate to contact us if you have other questions. 

Best wishes,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Scheduler
Asked by
brian
Top achievements
Rank 1
Answers by
brian
Top achievements
Rank 1
Peter
Telerik team
Share this question
or