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

Updating non-custom Appointment via Custom App Form

7 Answers 78 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 03 May 2017, 07:28 PM

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);
        }

7 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 May 2017, 06:42 AM
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.
0
Daniel
Top achievements
Rank 1
answered on 05 May 2017, 12:31 PM

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!

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 May 2017, 01:14 PM
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 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.
0
Scott
Top achievements
Rank 1
answered on 09 May 2017, 08:14 PM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 12 May 2017, 05:58 AM
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.
0
Scott
Top achievements
Rank 1
answered on 12 May 2017, 03:15 PM

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.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 May 2017, 11:35 AM
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.
Tags
Scheduler and Reminder
Asked by
Daniel
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Daniel
Top achievements
Rank 1
Scott
Top achievements
Rank 1
Share this question
or