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

Problem with AppointmentUpdate event

1 Answer 75 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
ericc34
Top achievements
Rank 1
ericc34 asked on 01 Dec 2008, 01:16 PM
Hi, Here's my code. Actually, I call fresult = schedulingFacade.MoveVisit(ID, e.ModifiedAppointment.Start) in Case "1". The result is an error and Rollback my transaction and cancel AppointmentUpdate (e.Cancel). I don't know why but sometime (not always), appointment in calendar remains update. In my database, data is good (rollback is made) but in scheduler, appointment is not at the good place. Do you know why this append ?

Thanks

' get the facade we need

 

Dim schedulingFacade As ISchedulingFacade = SymoRequestContext.GetServiceLocator.GetService(Of ISchedulingFacade)("SchedulingFacade")

 

 

Dim ID As Guid = New Guid(e.Appointment.ID.ToString)

 

 

Dim fresult As FacadeResult = New FacadeResult

 

 

Try

 

TransactionManager.Instance.BeginTransaction()

 

Select Case e.Appointment.Attributes("aptType")

 

 

Case "0" 'Unavailability

 

fresult = schedulingFacade.MoveResourceUnavailability(ID, e.ModifiedAppointment.Start, e.ModifiedAppointment.End)

 

Case "1" 'Visit

 

fresult = schedulingFacade.MoveVisit(ID, e.ModifiedAppointment.Start)

 

Case "2" 'Stop point

 

fresult = schedulingFacade.MoveResourceStopPoint(ID, e.ModifiedAppointment.Start, e.ModifiedAppointment.End)

 

End Select

 

 

If fresult.IsValidResult Then

 

TransactionManager.Instance.CommitTransaction()

 

Else

 

TransactionManager.Instance.RollbackTransaction()

e.Cancel =

True

 

 

'Dim js As New System.Web.Script.Serialization.JavaScriptSerializer()

 

 

'Dim JsonErrorMessage As String = js.Serialize(fresult.ErrorMessage)

 

 

'Dim AjaxManager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)

 

 

'ScriptManager.RegisterStartupScript(Me, GetType(BaseController), "showAlerts", "showAlert(" + JsonErrorMessage + ");", True)

 

 

End If

 

UpdateCalendar()

 

Catch ex As Exception

 

m_logger.Error(ex.Message)

TransactionManager.Instance.RollbackTransaction()

e.Cancel =

True

 

 

End Try

 

1 Answer, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 01 Dec 2008, 05:08 PM
Hello,

The code you have shown here seems perfectly valid and it sounds weird for it to doesn't work 'sometimes'. Can you please open a support ticket and send us a sample project that reproduces the issue? This will greatly aid us in finding the problem and providing a solution quicker.

Thank you for your understanding.

Sincerely yours,
Dimitar Milushev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
ericc34
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Share this question
or