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

[Solved] Can not move appointment to one resource to another resource by drag and drop

3 Answers 138 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
palak
Top achievements
Rank 1
palak asked on 17 Jun 2011, 10:11 AM

Dear telerik,

I've customized scheduleview, adding appointments dynamically and assign them to particular resources. Now when i edit apppointment via editappointment dialog window, it's working perfectly and moving to specified resource, but when i do drag and drop any appointment via mouse from one resource to another resource, it's now working. Everything is updating like start time, end time but resource stays same.

i've put my code into appointmentedited event. check below code. and kindly share what i need to do to move appointments from one resource to another resource by drag and drop functionality.

private void SchedulerView_AppointmentEdited(object sender, AppointmentEditedEventArgs e)
       {
           busyIndicator.IsBusy = true;
           ResourceAppointment editedAppointment = e.Appointment as ResourceAppointment;
           SP.ListItem listItem = _ResourceAppointment.GetItemById(editedAppointment.AppointmentId);
           listItem["Title"] = editedAppointment.Subject.ToString();
           listItem["EventDate"] = Convert.ToDateTime(editedAppointment.Start).ToLocalTime();
           listItem["EndDate"] = Convert.ToDateTime(editedAppointment.End).ToLocalTime();
           listItem["Description"] = editedAppointment.Body.ToString();
 
           if (editedAppointment.Resources[0].ResourceName != string.Empty)
           {
               foreach (SP.ListItem roomListItem in _RoomItemCol)
               {
                   if (roomListItem["Title"] == editedAppointment.Resources[0].ResourceName)
                   {
                       FieldLookupValue roomLookUp = new FieldLookupValue();
                       roomLookUp.LookupId = Convert.ToInt16(roomListItem["ID"]);
                       listItem["Rooms"] = roomLookUp;
                   }
               }
           }
 
           if (editedAppointment.Resources[1].ResourceName != string.Empty)
           {
               foreach (SP.ListItem resourceListItem in _ResourcesItemCol)
               {
                   if (resourceListItem["Title"] == editedAppointment.Resources[1].ResourceName)
                   {
                       FieldLookupValue resourceLookUp = new FieldLookupValue();
                       resourceLookUp.LookupId = Convert.ToInt16(resourceListItem["ID"]);
                       listItem["Resources"] = resourceLookUp;
                   }
               }
           }
           if (editedAppointment.Resources[2].ResourceName != string.Empty)
           {
               foreach (SP.ListItem bookingStatusListItem in _BookingStatusItemCol)
               {
                   if (bookingStatusListItem["Title"] == editedAppointment.Resources[2].ResourceName)
                   {
                       FieldLookupValue bookingStatusLookUp = new FieldLookupValue();
                       bookingStatusLookUp.LookupId = Convert.ToInt16(bookingStatusListItem["ID"]);
                       listItem["BookingStatus"] = bookingStatusLookUp;
                   }
               }
           }
 
           listItem.Update();
           _Context.Load(_ResourceAppointment, list => list.Title);
           _Context.ExecuteQueryAsync(OnEditItemToListSucceeded, OnEditItemToListFailed);
       }

3 Answers, 1 is accepted

Sort by
0
palak
Top achievements
Rank 1
answered on 21 Jun 2011, 05:30 AM
Guys i resolved my problem. needed some conditions for resourcetypes.

why telerik guys at least don't respond my threads ? shall i expect it .

thank you

regards
0
Yana
Telerik team
answered on 21 Jun 2011, 08:10 AM
Hello Palak,

I'm glad that you've managed to fix the issue. 

Note that the forums are community resource and although we monitor them, we do not guarantee a timely reply there.  Thank you for the understanding.

Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
palak
Top achievements
Rank 1
answered on 21 Jun 2011, 01:57 PM
yes i understand & appreciate your support & work.

regards
Tags
ScheduleView
Asked by
palak
Top achievements
Rank 1
Answers by
palak
Top achievements
Rank 1
Yana
Telerik team
Share this question
or