Example #1
0
        // Populate form with existing data
        private void populateData()
        {
            // Obtain dictionary of appointment information
            selectedAppointment = DataInterface.getAppointmentInfo(MainForm.selectedAppointmentID);

            // Populate customer ComboBox
            DataInterface.populateComboBox(appointmentCustomerComboBox);

            // Obtain data from form needed to update appointment
            appointmentIDTextBox.Text = selectedAppointment["ID"];
            appointmentCustomerComboBox.SelectedValue = Convert.ToInt32(selectedAppointment["customerID"]);
            appointmentTitleTextBox.Text       = selectedAppointment["Title"];
            appointmentLocationTextBox.Text    = selectedAppointment["Location"];
            appointmentContactTextBox.Text     = selectedAppointment["Contact"];
            appointmentURLTextBox.Text         = selectedAppointment["URL"];
            appointmentStartDate.Value         = DateTime.Parse(selectedAppointment["Start"]);
            appointmentEndDate.Value           = DateTime.Parse(selectedAppointment["End"]);
            appointmentDescriptionTextBox.Text = selectedAppointment["Description"];
        }