ExceptionAction

5 posts, 0 answers
  1. Mark Jakes
    Mark Jakes avatar
    27 posts
    Member since:
    Feb 2010

    Posted 03 Jul 2011 Link to this post

    Hello

    I followed the Scheduler documentation to the letter to get ScheduleView working with RIA services and I am nearly there.  Currently I am trying to implement the code detailed in this page (http://www.telerik.com/help/silverlight/radscheduler-populating-with-data-ria-service-edit.html

    There are a few things I am having a problem with.
     
    1)   How do I gaurentee I get the master appointment as the demo code
     
    Appointment masterAppt = e.ExceptionOccurrence.Master as Appointment;

    I am currently using

    Appointment editedAppt = args.Appointment as Appointment;

    But I am not entirely convinced this is correct if I have just deleted an appointment in a recurrence set that is not the first (master) one.  Please advise.

    2)   How do I implement the demo code

    if ( e.ExceptionOccurrence == null )

    Currently I am using the GetOccurrenceWithoutExceptionsFromDateTimeRange helper thus...

    if (args.Appointment.GetOccurrencesWithoutExceptionsFromDateTimeRange(_visibleDateRangeSelected.Start, _visibleDateRangeSelected.End) == null)

    But again, I feel I am floundering around in the dark here.

    3)   The example code given in the help docs uses "switch (args.ExceptionAction)" but this does not exist in ScheduleView.  Please explain how to implement.

     

     

     

    switch (args.ExceptionAction)
    {
        case ExceptionAction.Add:
        case ExceptionAction.Delete:
        case ExceptionAction.Edit:
        {
            // Adding, deleting, and editing an exception are the same thing as far as
            //  RecurrenceExceptionHelper is concerned, since we are changing the exception set,
            //  all we need to do is update the serialized string and we're good to go!
            dbApptToEdit.ExceptionAppointments = RecurrenceExceptionHelper.MakeExceptionsString(masterAppt.RecurrenceRule.Exceptions.ToList<ExceptionOccurrence>());
            break;
        }
            case ExceptionAction.None:
        {
                // We're deleting or resetting the recurrence rule, so we need to reset the exceptions
                    //  *** This mimics the behavior of RadScheduler
                    dbApptToEdit.ExceptionAppointments = "";
                    break;
        }
    }


    I realise the help is for Scheduler and not ScheduleView, but there is little else to go on   :-)

    Can you explain or demonstrate how I implement that code block from the help page cited? 

    BTW, I followed the articles that use the M2M4Ria T4 templates, but this is not suitable for our project at this present time.  The example code is a better match and I am at the final stage now so would really like to get this going  :-)

    Many thanks

    Mark.
  2. Mark Jakes
    Mark Jakes avatar
    27 posts
    Member since:
    Feb 2010

    Posted 05 Jul 2011 Link to this post

    Knock Knock, anyone home?   ;-)

    I see point 1) has been answered in a similar post, http://www.telerik.com/community/forums/silverlight/scheduleview/getting-appointment-from-occurrence.aspx

    Can anyone help me with the other points?

    Mark.
  3. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 07 Jul 2011 Link to this post

    Hi Mark,

    We are working on this migration. However, it will be ready some time after the Q2 release, since now we are overwhelmed by the preparation for it.

    Thank you for your patience.

    All the best,
    Konstantina
    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!

  4. Mark Jakes
    Mark Jakes avatar
    27 posts
    Member since:
    Feb 2010

    Posted 07 Jul 2011 Link to this post

    Hi Konstantina

    Thanks for the reply, I understand you and your team are busy, is there any workaround or clue you can get me started on, or do I just have to wait for this functionality to be ported?

    Mark.
  5. Rosi
    Admin
    Rosi avatar
    2529 posts

    Posted 13 Jul 2011 Link to this post

    Hello Mark ,

    The type of the property e.Appointment in RadScheduleView is IOccurrence. Both Appointment and Occurrence classes implement this interface. That is why you can use the type of the e.Appointment to execute the task. If it is Occurrence the edited item is exception, if it is Appointment  the edited item is not exception.

    So you can try the code below:

    if  (e.Appointment  is IAppointment)
    {
    .....
    }



    All the best,
    Rosi
    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!

Back to Top