private void buttonReschedule_Click(object sender, EventArgs e) { Appointment appointment = new Appointment(); appointment.AppointmentID = textBoxAppointmentID.Text; appointment.AppointmentDate = Convert.ToDateTime(dateTimePicker1.Value.ToString("yyyy-MM-dd")); appointment.TimeslotID = Convert.ToInt32(comboBoxslots.SelectedValue.ToString()); appointment.DoctorID = Convert.ToInt32(comboBoxDoctor.SelectedValue.ToString()); appointment.PatientID = Convert.ToInt32(comboBoxpatient.SelectedValue.ToString()); DatabaseOps update = new DatabaseOps(); int oldslotid = update.gettimeslotidfromappointment(appointment.AppointmentID); update.updatetimeslotavailability(oldslotid, 1); update.update(appointment); update.updatetimeslotavailability(appointment.TimeslotID, 0); display(); }
private void button1_Click(object sender, EventArgs e) { Appointment appointment = new Appointment(); appointment.AppointmentDate = dateTimePicker1.Value; appointment.TimeslotID = Convert.ToInt32(comboBoxslots.SelectedValue.ToString()); appointment.DoctorID = Convert.ToInt32(comboBoxDoctor.SelectedValue.ToString()); appointment.PatientID = Convert.ToInt32(comboBoxpatient.SelectedValue.ToString()); DatabaseOps insert = new DatabaseOps(); insert.insert(appointment); insert.updatetimeslotavailability(appointment.TimeslotID, 0); display(); }
private void buttonCancelAppointment_Click(object sender, EventArgs e) { if (textBoxAppointmentID.Text.Length != 0) { DatabaseOps databaseOps = new DatabaseOps(); int oldslotid = databaseOps.gettimeslotidfromappointment(textBoxAppointmentID.Text); databaseOps.updatetimeslotavailability(oldslotid, 1); databaseOps.delete("APPOINTMENT", textBoxAppointmentID.Text); display(); } else { MessageBox.Show("Unable to Cancel Appointment, Select a row which you want to Cancel", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }