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

More than one appointment with same ID

13 Answers 135 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 30 Jun 2011, 04:52 PM
Hi

I use telerik RadScheduler for application in which i have to make reservations using the scheduler.
The problem what i have is this. Due to our database design we have reservations that use multiple resources.
For example i have reservation in which i use Resource 1 and Resource 2.
Also the application is grouped by this resources: Resource 1, Resource 2, Resource 3  ...
In our database the relation between reservation - resource is many to many so when i make select to bind it to the scheduler i have the same reservation two times, one for Resource 1 and one for Resource 2. This reservation is show twice in the Resource 1 column and in Resource 2 column.
I have allowed drag and drop functionality. Before this on the scheduler everything worked fine.
When i drag and drop the reservation from Resource 1 to another time it's OK (Resource 1 is first column, than comes Resource 2 column). But when i try to drag the reservation from Resource 2 (this is basically the same reservation as that in Resource 1) appointment update method handler doesn't get executed.
I think this is because the two reservations (in the database is one reservation) have the same ID.
In the attachment you have the image of my scenario.

Can anybody tell me how to find work around this problem.

Thanks

13 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 30 Jun 2011, 06:16 PM
Hi

Basically i need this option that DevExpress controls have it
http://demos.devexpress.com/ASPxSchedulerDemos/Miscellaneous/ResourceSharing.aspx
You can create appointment that has more than one resource in it from the same type.

Thanks
0
Veronica
Telerik team
answered on 01 Jul 2011, 02:44 PM
Hello Goran,

Please take a look at this demo for an example of multiple resources. Please let me know if you have further questions.

Greetings,
Veronica Milcheva
the Telerik team

Browse the vast support resources we have to jump start 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.

0
Daniel
Top achievements
Rank 1
answered on 01 Jul 2011, 03:26 PM
Hi Veronika

In this example you allow multiple resources by Users. But you don't show the users on the scheduler grouped by Users.
Do you have example where you show the users grouped by user and than catch one appointment and drag it through the calendar.
I did implemented this in my project
protected void RadScheduler1_DataBound(object sender, EventArgs e)
        {
            RadScheduler1.ResourceTypes.FindByName("User").AllowMultipleValues = true;
            //RadScheduler1.ResourceTypes.FindByName("Room").AllowMultipleValues = false;
        }

but the problem is still there.
Did you see  the example from devexprees, that is what i need, do you have example like that?

Regards
0
Veronica
Telerik team
answered on 12 Jul 2011, 08:00 AM
Hi Goran,

Please accept my apologies for the late reply.

I've modified our multiple resources demo to display grouping. Please take a look at the attached .zip file and let me know if you have further questions.

All the best,
Veronica Milcheva
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Daniel
Top achievements
Rank 1
answered on 13 Jul 2011, 05:12 PM
Hi Veronika

In your example there is not option for drag and drop with update. can you implement that so i can see that it works.
On my project i show the reservations, but the problem occurs when drag and drop is done / update.
Drag and drop between different resources and different time slots.

Regards
0
Peter
Telerik team
answered on 19 Jul 2011, 11:34 AM
Hi Goran,

We reviewed the devexpress demo, but unfortunately we don't support this functionality. I will log it and we will consider it for the future.

Thank you for your question.

All the best,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Daniel
Top achievements
Rank 1
answered on 19 Jul 2011, 12:29 PM
Hi Peter

You want to tell me that there is no options with telerik scheduler when appointment with multiple resources from the same resource type, like in my scenario that i explained can't be drag & dropped? I don't need the both appintments to be selected as one. I want error not to occur. Because when i catch the first appointment everything is OK, but when i try to drag & drop the second appointment (i have explained in the previous post what mean by first and second) i get error.

Sorry for pushing it this, but it's very important request that we need to do.

Thanks in advance
0
Peter
Telerik team
answered on 19 Jul 2011, 04:18 PM
Hi Goran,

Here is some client code that could help improve the behavior of RadScheduler in this scenario:
<script type="text/javascript">
         var originalTimeSlotResourceKey;
         function OnClientAppointmentMoveStart(sender, args) {
 
             originalTimeSlotResourceKey = sender.get_activeModel().getTimeSlotFromDomElement($telerik.$(args.get_appointment().get_element()).parents("td").get(0)).get_resource().get_key()
 
         }
 
         function OnClientAppointmentMoveEnd(sender, args) {
 
             if (originalTimeSlotResourceKey != args.get_targetSlot().get_resource().get_key()) {
                 args.set_cancel(true);
             }
 
         }
     </script>

Other than that, I am afraid this scenario has been overlook by our developers and the best I can do right now is to log it as bug which will be fixed in the future.



Regards,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Krste
Top achievements
Rank 1
answered on 14 Sep 2016, 04:59 PM

Hi Telerik Support,

Have you ever been able to resolve this bug in some of your future versions? Our client has upgraded to the latest 2016 version and this issue is still not fixed.

Our system is in production for several years, its been a while since we reported the issue (the person that reported it was part of our team), and up until now our client was not using the application in a way in which the problem appears. Up until recently they only had reservations that were only including one resource of a type. But recently, as we expected while developing, they started offering reservations that are including more than one resource of the same type, and this issue is now crucial to resolve ASAP since they are not able to properly use the drag and drop in these occurrences causing them serious operational inconvenience.  

This is what happens when such scenario occurs (now in real live application):

http://prnt.sc/chzg8g

This is the error displayed in console: 

http://prntscr.com/chzld0

We really need to fix this fast. Are you able to give us instruction how to resolve it or an appropriate workaround?

We really appreciate your help and your great product

 

Thanks

 

0
Krste
Top achievements
Rank 1
answered on 14 Sep 2016, 05:03 PM

I apologize, I didn't format the links to the screenshots in the text above:

This is what happens when such scenario occurs (now in real live application):
http://prnt.sc/chzg8g
This is the error displayed in console: 
http://prntscr.com/chzld0

0
Peter Milchev
Telerik team
answered on 19 Sep 2016, 11:09 AM
Hello, 

Please find attached the project we used to recreate your scenario and were unable to reproduce the error you receive. The project uses the Multiple resources demo as a base and has enabled grouping by resource. The version of the controls is the latest official: 2016.3.914.

Would you please check if the provided example reproduces the issue and if yes, provide us more details on reproducing it? 

If the attached project does not recreate your scenario, would you please modify it accordingly and send it back to us in an official support ticket?

Regards,
Peter Milchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Bobi
Top achievements
Rank 1
answered on 19 Sep 2016, 02:20 PM

Hi Peter,

Thank you very much for your response. We really appreciate your time and interest to help us. You should be able to reproduce the issue using the attached XML as data source. I was able to get the same error, and I believe you will get it as well if you try to drag and drop the second reservation. It is a slightly modified version of your original data source that matches our database structure. No changes in code or markup are needed. We hope there is a workaround that will not require changes in our database structure. That will be an overkill at this point (having the system in production for many years)

Regards

 

<?xml version="1.0" encoding="utf-8"?>
<Appointments>
    <NextID>5</NextID>
    <Resources>
        <Room>
            <Key>1</Key>
            <Text>Meeting room 101</Text>
        </Room>
        <Room>
            <Key>2</Key>
            <Text>Meeting room 201</Text>
        </Room>
        <User>
            <Key>1</Key>
            <Text>Alex</Text>
        </User>
        <User>
            <Key>2</Key>
            <Text>Bob</Text>
        </User>
        <User>
            <Key>3</Key>
            <Text>Charlie</Text>
        </User>
    </Resources>
    <Appointment>
        <ID>1</ID>
        <Subject>Meeting with customers.</Subject>
        <Start>2012-04-16T06:00Z</Start>
        <End>2012-04-16T08:00Z</End>
<ServiceTypeValue>1</ServiceTypeValue>
        <Resources>
            <User Key="2" />
            <User Key="3" />
            <Room Key="1" />
        </Resources>
        <Attribute Key="Annotations" Value="Sample note" />
    </Appointment>
    <Appointment>
        <ID>2</ID>
        <Subject>Take the car to the service.</Subject>
        <Start>2012-04-16T09:00Z</Start>
        <End>2012-04-16T10:30Z</End>
<ServiceTypeValue>1</ServiceTypeValue>
        <Resources>
            <User Key="1" />
        </Resources>
    </Appointment>
    <Appointment>
        <ID>3</ID>
        <Subject>Guided tour for the investors.</Subject>
        <Start>2012-04-17T06:00Z</Start>
        <End>2012-04-17T08:00Z</End>
<ServiceTypeValue>1</ServiceTypeValue>
        <Resources>
            <User Key="2" />
        </Resources>
    </Appointment>
    <Appointment>
        <ID>4</ID>
        <Subject>Construction documentation review.</Subject>
        <Start>2012-04-19T08:00Z</Start>
        <End>2012-04-19T10:00Z</End>
<ServiceTypeValue>1</ServiceTypeValue>
        <Resources>
            <User Key="1" />
        </Resources>
    </Appointment>
    <Appointment>
        <ID>4</ID>
        <Subject>Construction documentation review.</Subject>
        <Start>2012-04-19T08:00Z</Start>
        <End>2012-04-19T10:00Z</End>
<ServiceTypeValue>1</ServiceTypeValue>
        <Resources>
            <User Key="2" />
        </Resources>
    </Appointment>
</Appointments>

0
Peter Milchev
Telerik team
answered on 22 Sep 2016, 10:24 AM
Hello Bobi,

I was able to receive the error using your XML as a datasource. The problem is caused by the fact that appointments are with the same ID. I am afraid that we were unable to come up with a workaround for your case and you should update your database so that there are all appointments have unique IDs. You should merge the appointments with identical IDs and single resources:

<Appointment>
  <ID>4</ID>
  <Subject>Construction documentation review.</Subject>
  <Start>2012-04-19T08:00Z</Start>
  <End>2012-04-19T10:00Z</End>
  <ServiceTypeValue>1</ServiceTypeValue>
  <Resources>
    <User Key="1" />
  </Resources>
</Appointment>
<Appointment>
  <ID>4</ID>
  <Subject>Construction documentation review.</Subject>
  <Start>2012-04-19T08:00Z</Start>
  <End>2012-04-19T10:00Z</End>
  <ServiceTypeValue>1</ServiceTypeValue>
  <Resources>
    <User Key="2" />
  </Resources>
</Appointment>


To a single appointment with multiple resources:

<Appointment>
  <ID>4</ID>
  <Subject>Construction documentation review.</Subject>
  <Start>2012-04-19T08:00Z</Start>
  <End>2012-04-19T10:00Z</End>
  <ServiceTypeValue>1</ServiceTypeValue>
  <Resources>
    <User Key="1" />
    <User Key="2" />
  </Resources>
</Appointment>


Regards,
Peter Milchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Scheduler
Asked by
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
Veronica
Telerik team
Peter
Telerik team
Krste
Top achievements
Rank 1
Peter Milchev
Telerik team
Bobi
Top achievements
Rank 1
Share this question
or