Updating non-custom Appointment via Custom App Form

8 posts, 0 answers
  1. Daniel
    Daniel avatar
    9 posts
    Member since:
    Feb 2017

    Posted 03 May 2017 Link to this post

    Using the "Email" example(s) I have successfully added a custom field into a new Custom Appointment form.  I also needed to have some custom code run when the user hits OK and exits out of the form.  That works as well.

    However when I edit an Appointment and try to change the Summary or Location, that information is not getting propagated back to the Scheduler. I haven't changed any of the textbox names (don't think that's even possible), but the data doesn't seem to be getting back to the scheduler.

    Any ideas?

    Here are my LoadSettingsFromEvent/ApplySettingsToEvent methods:

        protected override void LoadSettingsFromEvent(IEvent sourceEvent)
            {
                base.LoadSettingsFromEvent(sourceEvent);

                var appointmentWithChiroDetails = sourceEvent as AppointmentWithChiroDetails;
                if (appointmentWithChiroDetails != null)
                {
                    if (Globals.currentCustomer != 0)
                    {
                        this.txtpat_id.Text = Globals.currentCustomer.ToString();
                    }
                }
            }

            protected override void ApplySettingsToEvent(IEvent targetEvent)
            {
                var appointmentWithChiroDetails = targetEvent as AppointmentWithChiroDetails;
                if (appointmentWithChiroDetails != null)
                {
                    appointmentWithChiroDetails.CustomerPK = Convert.ToInt32(this.txtpat_id.Text);
                }

                base.ApplySettingsToEvent(targetEvent);
            }

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3047 posts

    Posted 05 May 2017 Link to this post

    Hello Daniel, 

    Thank you for writing.  

    I have prepared a sample project for your reference. RadScheduler uses custom appointments with a new Email field. A sample backup file of my database is also attached in the zip file. The email field is successfully stored in the database when pressing the save button and after restarting the application, the new value is displayed.

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Daniel
    Daniel avatar
    9 posts
    Member since:
    Feb 2017

    Posted 05 May 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    A lot of the code you have in the attached project isn't in the current documentation for Winforms.  You are passing the mainform to the Custom Form and then calling a public save method from inside the Custom form; the sample Email project doesn't contain any of that.

    I apologize for posting twice; I consider the forum a public venue and the Support Tickets private so I did not see the harm.  When you have deadlines to meet you resort to anything.

    There's a few tweaks I need to do with this newer code to make it work for me, since I cannot call a public save method because of how I convert the datasets into something else) but this answers my question.  Thank you the help as always!

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3047 posts

    Posted 08 May 2017 Link to this post

    Hello Daniel, 

    Thank you for writing back. 

    I am glad that the provided sample project was useful. The save method implementation is available in the last section of the following help article: http://docs.telerik.com/devtools/winforms/scheduler/data-binding/data-binding-walkthrough

    It is up to you when is the appropriate moment to save the changes to your database. Usually, it is executed on a button's Click event. However, for the test purpose, the save operation is performed when the edit dialog is closed. It is just a sample approach how you can implement the save functionality.

    I hope this information helps. If you have any additional questions, please let me know. 

    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Scott
    Scott avatar
    34 posts
    Member since:
    Dec 2015

    Posted 09 May 2017 Link to this post

    I am having a similar problem getting exception Appointments in that the new Exception appointment will show up on the radscheduler active view.  But when I close and re-open the radcheduler, the new Exception appointment is gone.  However...  If, after creating the new exception appointment, I select another, different appointment; then the radscheduler saves to the DB just fine.

    How can I call, programmatically, whatever is happening when I select a different, existing appointment in the active view?

    Thank you.

    -Scott

  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3047 posts

    Posted 12 May 2017 Link to this post

    Hello Scott, 

    Thank you for writing.  

    According to the provided information, it seems that the problem you are facing is related to the following known issues: https://feedback.telerik.com/Project/154/Feedback/Details/215657-fix-radscheduler-changes-are-not-stored-to-database
    https://feedback.telerik.com/Project/154/Feedback/Details/214638-fix-radscheduler-entity-framework-business-object-not-saving-appointment-upo

    We will do our best to introduce the fixes as soon as possible. Meanwhile, feel free to use the suggested workarounds in the items.

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Scott
    Scott avatar
    34 posts
    Member since:
    Dec 2015

    Posted 12 May 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dess-

    I just got it working working.  For the following events:

    radScheduler1_AppointmentAdded

    radScheduler1_AppointmentChanged

    I added the following code:
                var rarg = radScheduler1.Appointments[0];
                if (rarg != null)
                {
                    radScheduler1.SelectionBehavior.SelectAppointment(rarg, true);
                    radScheduler1.SelectionBehavior.SelectAppointment(e.Appointment, true);
                    radScheduler1.Update();
                    dbscheduler.SaveChanges();
                }

    For the radScheduler1_AppointmentDeleted event, I added:
                radScheduler1.Update();
                dbscheduler.SaveChanges();

    I tested and passed the following use cases:

    Create a New One Time Appointment
    Open & Edit One Time Appointment to new route and time
    Drag and Drop One Time Appointment to new route and time
    Open & Edit One Time Appointment to new day, route and time
    Drag and Drop One Time Appointment to new day, route and time
    Delete One-Time Appointment
    Create a New Recurring Appointment
    Open & Edit  Recurring Appointment to new route and time(All)
    Drag and Drop Recurring Appointment to new route and time(All)
    Open & Edit Recurring Appointment to new day, route and time(All)
    Drag and Drop Recurring Appointment to new day, route and time(All)
    Open & Edit  Recurring Appointment to new route and time(Exception)
    Drag and Drop Recurring Appointment to new route and time(Exception)
    Open & Edit Recurring Appointment to new day, route and time(Exception)
    Drag and Drop Recurring Appointment to new day, route and time(Exception)
    Delete Recurring Appointment



    Hope this helps.
  8. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3047 posts

    Posted 15 May 2017 Link to this post

    Hello Scott, 

    Thank you for writing back. 
     
    I am glad that the provided information was useful for handling your case. If you have any additional questions, please let me know.

    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top