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

Web Service Binding - AppointmentData.Start problems

1 Answer 52 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Scott R
Top achievements
Rank 1
Scott R asked on 09 Nov 2010, 12:02 AM
I am using Web Service binding but have not implemented a "provider". Instead, I'm simply trying to code the web service methods directly. I'm not sure if this is causing my problem or not.

Let's take a simple example:

[WebMethod(EnableSession=true)]
public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo)
{
    List<AppointmentData> result = new List<AppointmentData>();
    var q = from c in WebUtils.User.Merchant.Appointments
            where c.ServiceDateTime >= schedulerInfo.ViewStart
                && c.ServiceDateTime <= schedulerInfo.ViewEnd
                && c.CancelDate == null
            select c;
    foreach (WWS.BLL.Appointment a in q.ToList())
    {
        AppointmentData ad = new AppointmentData();
        ad.Description = a.Service.Category.Description + " - " + a.Service.Description;
        ad.ID = a.Id;
        ad.Start = a.ServiceDateTime.ToUniversalTime();
        ad.End = a.ServiceDateTime.AddMinutes(a.Duration).ToUniversalTime();
        ad.Subject = a.Service.Description;
        result.Add(ad);
    }
      
    return result;
}

The above code runs without exception and returns appointments which appear on the scheduler. The only problem is that they don't appear in the right time slot on the scheduler. For example, when I inspect "ad.Start" in the debugger it says "{11/8/2010 10:27:58 PM}" but when the appointment appears on the scheduler it is on 11/9/2010 and in the 1am time slot. If I edit the appointment the editor says the start time is 1:27 AM.

Incidentally, I also get a javascript error when trying to edit the appointment:

Microsoft JScript runtime error: 'this._appointment.get_recurrenceRule()' is null or not an object

I'm guessing that I'm missing something rather obvious, but I don't know what it is.

Thanks,
Scott

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 16 Nov 2010, 10:56 AM
Hi Scott,

This problem can occur if you set the TimeZoneOffset property. Can you test your sample without this property.

As for the javascript error, please set the RecurrenceRule to an empty string in the GetAppointments method -  ad.RecurrenceRule = string.Empty;


Kind regards,
Peter
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Scheduler
Asked by
Scott R
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or