I have a derived version of the SchedulerInfo class that is properly being populated in my GetAppointments Web Service Call...
However I noticed when the CreateRecurrenceException web service call is made it DOES send my custom scheduler info to the web service call but once it hits the Update method in my overridden SchedulerProvider it appears cast as type SchedulerInfo.
Note that also when I update a schedule item which is not recurring the Update method is called with the CustomSChedulerInfo.
An exert of my overriden SchedulerProvider
An Exert of the web service
[WebMethod(EnableSession =
true
)]
public
IEnumerable<AppointmentData> GetAppointments(CustomSchedulerInfo schedulerInfo)
{
return
Controller.GetAppointments(schedulerInfo);
}
However I noticed when the CreateRecurrenceException web service call is made it DOES send my custom scheduler info to the web service call but once it hits the Update method in my overridden SchedulerProvider it appears cast as type SchedulerInfo.
Note that also when I update a schedule item which is not recurring the Update method is called with the CustomSChedulerInfo.
An exert of my overriden SchedulerProvider
public
class
SchedulerProvider : DbSchedulerProviderBase
{
public
override
IEnumerable<Appointment> GetAppointments(ISchedulerInfo schedulerInfo)
{
var scheduleInfo = schedulerInfo
as
CustomSchedulerInfo;
}
public
override
void
Update(ISchedulerInfo schedulerInfo, Appointment appointmentToUpdate)
{
var scheduleInfo = schedulerInfo
as
CustomSchedulerInfo;
//NOTE: When this is called from the CreateRecurrenceException web service call that
scheduleInfo is cast as null. When this is called from the UpdateAppointment web service call
scheduleInfo is properly cast.
}
}
An Exert of the web service
[WebService(Namespace =
"http://tempuri.org/"
)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(
false
)]
[System.Web.Script.Services.ScriptService]
public
class
Scheduling : WebService, IRequiresSessionState
{
private
WebServiceAppointmentController _controller;
public
const
string
ProviderSessionKey =
"SchedulerWebServiceData"
;
private
WebServiceAppointmentController Controller
{
get
{
SchedulerProvider provider;
if
((Session[ProviderSessionKey] ==
null
))
{
provider =
new
SchedulerProvider();
Session[ProviderSessionKey] = provider;
}
else
{
provider = (SchedulerProvider)Session[ProviderSessionKey];
}
if
(_controller ==
null
)
{
_controller =
new
WebServiceAppointmentController(provider);
}
return
_controller;
}
}
[WebMethod(EnableSession =
true
)]
public
IEnumerable<AppointmentData> GetAppointments(CustomSchedulerInfo schedulerInfo)
{
return
Controller.GetAppointments(schedulerInfo);
}
[WebMethod(EnableSession =
true
)]
public
IEnumerable<AppointmentData> InsertAppointment(CustomSchedulerInfo schedulerInfo, AppointmentData appointmentData)
{
return
Controller.InsertAppointment(schedulerInfo, appointmentData);
}
[WebMethod(EnableSession =
true
)]
public
IEnumerable<AppointmentData> UpdateAppointment(CustomSchedulerInfo schedulerInfo, AppointmentData appointmentData)
{
return
Controller.UpdateAppointment(schedulerInfo, appointmentData);
}
[WebMethod(EnableSession =
true
)]
public
IEnumerable<AppointmentData> CreateRecurrenceException(CustomSchedulerInfo schedulerInfo, AppointmentData recurrenceExceptionData)
{
return
Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData);
}
[WebMethod(EnableSession =
true
)]
public
IEnumerable<AppointmentData> RemoveRecurrenceExceptions(CustomSchedulerInfo schedulerInfo, AppointmentData masterAppointmentData)
{
return
Controller.RemoveRecurrenceExceptions(schedulerInfo, masterAppointmentData);
}
[WebMethod(EnableSession =
true
)]
public
IEnumerable<AppointmentData> DeleteAppointment(CustomSchedulerInfo schedulerInfo, AppointmentData appointmentData,
bool
deleteSeries)
{
return
Controller.DeleteAppointment(schedulerInfo, appointmentData, deleteSeries);
}
[WebMethod(EnableSession =
true
)]
public
IEnumerable<ResourceData> GetResources(CustomSchedulerInfo schedulerInfo)
{
return
Controller.GetResources(schedulerInfo);
}
}