More than one appointment with same ID

14 posts, 0 answers
  1. Daniel
    Daniel avatar
    7 posts
    Member since:
    Jun 2010

    Posted 30 Jun 2011 Link to this post

    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
  2. Daniel
    Daniel avatar
    7 posts
    Member since:
    Jun 2010

    Posted 30 Jun 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 01 Jul 2011 Link to this post

    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.

  5. Daniel
    Daniel avatar
    7 posts
    Member since:
    Jun 2010

    Posted 01 Jul 2011 Link to this post

    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
  6. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 12 Jul 2011 Link to this post

    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!

  7. Daniel
    Daniel avatar
    7 posts
    Member since:
    Jun 2010

    Posted 13 Jul 2011 Link to this post

    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
  8. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 19 Jul 2011 Link to this post

    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!

  9. Daniel
    Daniel avatar
    7 posts
    Member since:
    Jun 2010

    Posted 19 Jul 2011 Link to this post

    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
  10. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 19 Jul 2011 Link to this post

    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!

  11. Krste
    Krste avatar
    6 posts
    Member since:
    Nov 2010

    Posted 14 Sep Link to this post

    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

     

  12. Krste
    Krste avatar
    6 posts
    Member since:
    Nov 2010

    Posted 14 Sep in reply to Krste Link to this post

    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

  13. Peter Milchev
    Admin
    Peter Milchev avatar
    142 posts

    Posted 19 Sep Link to this post

    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.
  14. Bobi
    Bobi avatar
    3 posts
    Member since:
    Jan 2012

    Posted 19 Sep in reply to Peter Milchev Link to this post

    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>

  15. Peter Milchev
    Admin
    Peter Milchev avatar
    142 posts

    Posted 22 Sep Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017