public void GetAppointmentById()
        {
            Appointment appt = AppointmentDao.GetAppointmentById(1);

            if (appt != null)
            {
                Assert.IsInstanceOfType(appt, typeof(Appointment));
            }
            else
            {
                Assert.IsNull(appt);
            }
        }
Exemple #2
0
        private void DeleteApptButton_Click(object sender, EventArgs e)
        {
            int  appointmentId = Convert.ToInt32(AppointmentsComboBox.SelectedValue);
            var  appt          = AppointmentDao.GetAppointmentById(appointmentId);
            bool deleted       = AppointmentDao.DeleteAppointment(appt);

            if (deleted == true)
            {
                MessageBox.Show("Deleted appointment successfully.");
                SetDefaults();
            }
            else
            {
                MessageBox.Show("Appointment wasn't able to be deleted.");
            }
        }