I know there's a couple of posts on this topic already, but I have questions still.
I have to pass the current user ID that is creating the appointment to the Insert method of the web service so that attribute can be saved to the appointment.
I have this set up here in MySchedulerInfo.cs
public int UserID { get; set; }
public MySchedulerInfo(ISchedulerInfo baseInfo, int doctorID, int userID) : base(baseInfo) {
UserID = userID;
}
public MySchedulerInfo() {
}
And then on the front end, I have this:
protected void radAppointmentsDoctors_AppointmentInsert(Object sender, AppointmentInsertEventArgs e) {
e.SchedulerInfo = new MySchedulerInfo(e.SchedulerInfo, c_user_id);
}
So then in MyDbSchedulerProvider,cs , I have:
public override void Insert(RadScheduler owner, Appointment appointmentToInsert) {
if (!PersistChanges) {
return;
}
bvAppointmentDoctor a = new bvAppointmentDoctor();
a.AssignedTo = int.Parse(appointmentToInsert.Resources.GetResourceByType("Doctor").Key.ToString());
a.UserId = ?????
^^^ here's the problem. How do I get access to the schedulerinfo UserID property from within this method?
// Then Assign other object properties here and save object
I have to pass the current user ID that is creating the appointment to the Insert method of the web service so that attribute can be saved to the appointment.
I have this set up here in MySchedulerInfo.cs
public int UserID { get; set; }
public MySchedulerInfo(ISchedulerInfo baseInfo, int doctorID, int userID) : base(baseInfo) {
UserID = userID;
}
public MySchedulerInfo() {
}
And then on the front end, I have this:
protected void radAppointmentsDoctors_AppointmentInsert(Object sender, AppointmentInsertEventArgs e) {
e.SchedulerInfo = new MySchedulerInfo(e.SchedulerInfo, c_user_id);
}
So then in MyDbSchedulerProvider,cs , I have:
public override void Insert(RadScheduler owner, Appointment appointmentToInsert) {
if (!PersistChanges) {
return;
}
bvAppointmentDoctor a = new bvAppointmentDoctor();
a.AssignedTo = int.Parse(appointmentToInsert.Resources.GetResourceByType("Doctor").Key.ToString());
a.UserId = ?????
^^^ here's the problem. How do I get access to the schedulerinfo UserID property from within this method?
// Then Assign other object properties here and save object