private void ok_Click(object sender, EventArgs e) { if (textBoxMrn.Text.Length == 0) { MessageBox.Show("Please enter a medical record number to add an appointment"); return; } if (!init) { init = true; this.Enabled = false; this._appointment.MRN = this.textBoxMrn.Text; this._appointment.Load(); frmAddEditAppointment addAppt; if (this._appointment.apptid.HasValue) { addAppt = new frmAddEditAppointment(frmAddEditAppointment.COPY, this._appointment.apptid.Value); addAppt.setClinic(this._clinicId); } else { addAppt = new frmAddEditAppointment(frmAddEditAppointment.ADD); addAppt.setUnitNum(this.textBoxMrn.Text); } addAppt.ShowDialog(); this.Close(); } }
private void editApptButton_Click(object sender, EventArgs e) { if (fastDataListView1.SelectedObject != null) { Appointment selectedAppt = ((Appointment)(fastDataListView1.SelectedObject)); User.setClinicID(((Clinic)comboBox2.SelectedItem).clinicID); frmAddEditAppointment addAppt = new frmAddEditAppointment(frmAddEditAppointment.EDIT, selectedAppt.apptID); addAppt.ShowDialog(); SessionManager.Instance.ClearActivePatient(); GetNewAppointmentList(); } else { MessageBox.Show("No appointment selected.", "RiskApps", MessageBoxButtons.OK, MessageBoxIcon.Error); } }