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

Do not load the resource at the appointment

3 Answers 134 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Emmanuel
Top achievements
Rank 1
Emmanuel asked on 08 Oct 2018, 04:12 PM

Hello,

I did all the steps in the documentation, I do not load the selected resource of the appointment, but if they are saving in the database the 3 tables

I need help, what am I doing wrong

I leave the code and attach images

 

        public radForm1()
        {
            InitializeComponent();

            AppointmentsTableAdapter appointmentsTableAdapter = new AppointmentsTableAdapter();
            appointmentsTableAdapter.Fill(testDataSet.Appointments);

            ResourcesTableAdapter resourcesTableAdapter = new ResourcesTableAdapter();
            resourcesTableAdapter.Fill(testDataSet.Resources);

            AppointmentsResourcesTableAdapter appointmentsResourcesTableAdapter = new AppointmentsResourcesTableAdapter();
            appointmentsResourcesTableAdapter.Fill(testDataSet.AppointmentsResources);

        }

  private void radButtonSave_Click(object sender, EventArgs e)
        {
            AppointmentsTableAdapter appointmentsTableAdapter = new AppointmentsTableAdapter();
            AppointmentsResourcesTableAdapter appointmentsResourcesTableAdapter = new AppointmentsResourcesTableAdapter();

            TestDataSet.AppointmentsResourcesDataTable deletedChildRecords =
                this.testDataSet.AppointmentsResources.GetChanges(DataRowState.Deleted)
                as TestDataSet.AppointmentsResourcesDataTable;

            TestDataSet.AppointmentsResourcesDataTable newChildRecords =
              this.testDataSet.AppointmentsResources.GetChanges(DataRowState.Added)
              as TestDataSet.AppointmentsResourcesDataTable;

            TestDataSet.AppointmentsResourcesDataTable modifiedChildRecords =
            this.testDataSet.AppointmentsResources.GetChanges(DataRowState.Modified)
            as TestDataSet.AppointmentsResourcesDataTable;

            try
            {
                if (deletedChildRecords != null)
                {
                    appointmentsResourcesTableAdapter.Update(deletedChildRecords);
                }
                appointmentsTableAdapter.Update(this.DataSet.Appointments);

                if (newChildRecords != null)
                {
                    appointmentsResourcesTableAdapter.Update(newChildRecords);
                }

                if (modifiedChildRecords != null)
                {
                    appointmentsResourcesTableAdapter.Update(modifiedChildRecords);
                }

                this.DataSet.AcceptChanges();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (deletedChildRecords != null)
                    deletedChildRecords.Dispose();

                if (newChildRecords != null)
                    newChildRecords.Dispose();

                if (modifiedChildRecords != null)
                    modifiedChildRecords.Dispose();

            }
        }

 

3 Answers, 1 is accepted

Sort by
0
Emmanuel
Top achievements
Rank 1
answered on 08 Oct 2018, 05:56 PM
Only the appointment does not link the correct resource but the list of resources is filled.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 10 Oct 2018, 01:07 PM
Hello, Emmanuel, 

One possible problem for not matching the appointments with the respective resource is if the resource id in the appointment doesn't match the type  of the id for the resource itself. For such cases, RadScheduler offers SchedulerMapping where you can convert the value of the id to an EventId. I have attached a sample project for your reference. There is also a back up file of my sample database included in the zip.

If you are still experiencing any further difficulties, feel free to submit a support ticket from your account and our support staff will gladly assist you in resolving this case.

I hope this information helps.

 Regards,
Dess
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Emmanuel
Top achievements
Rank 1
answered on 10 Oct 2018, 01:21 PM

Thanks for answering, I have already solved this.

Con solo colocarle este metodo this.schedulerBindingDataSource1.Rebind();

         public radForm1 ()
         {
             InitializeComponent ();

             AppointmentsTableAdapter nightsTableAdapter = new AppointmentsTableAdapter ();
             lettersTableAdapter.Fill (testDataSet.Appointments);

             ResourcesTableAdapter resourcesTableAdapter = new ResourcesTableAdapter ();
             resourcesTableAdapter.Fill (testDataSet.Resources);

             AppointmentsResourcesTableAdapterpointmentResourcesTableAdapter = new AppointmentsResourcesTableAdapter ();
             creditsResourcesTableAdapter.Fill (testDataSet.AppointmentsResources);

             this.schedulerBindingDataSource1.Rebind ();
         }

Tags
Scheduler and Reminder
Asked by
Emmanuel
Top achievements
Rank 1
Answers by
Emmanuel
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or