private void btnAdmit_Click(object sender, EventArgs e) { if (dgvAppointment.Rows.Count >= 1) { DialogResult dr = MessageBox.Show("Are you sure you want to admit this patient?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { try { string sql = "UPDATE tblAppointmentDetails " + "SET strAppointmentStatus = 'DONE' " + "WHERE tblAppointmentDetails.strAppointmentCode = '" + patientList[6][dgvAppointment.CurrentRow.Index] + "';"; MySqlCommand cmd = new MySqlCommand(sql, conn); cmd.ExecuteNonQuery(); } catch (MySqlException me) { Integrity.GetExceptionDetails(me); } catch (Exception ex) { Integrity.GetExceptionDetails(ex); } FormAdmission admission = new FormAdmission(conn, userID, patientList[0][dgvAppointment.CurrentRow.Index]); admission.ShowDialog(); } } }
private void btnAdmit_Click(object sender, EventArgs e) { if (dgvTagged.Rows.Count > 0) { try { string sql = "UPDATE tblTag " + "SET strStatus = 'APPROVED' " + "WHERE strStatus = 'PENDING' AND " + "strStaffID = '" + userID + "';"; MySqlCommand cmd = new MySqlCommand(sql, conn); cmd.ExecuteNonQuery(); sql = "UPDATE tblLogIn " + "SET strDoctStatus = 'OFF'" + "WHERE strStaffID = '" + userID + "';"; cmd = new MySqlCommand(sql, conn); cmd.ExecuteNonQuery(); } catch (MySqlException me) { Integrity.GetExceptionDetails(me); } catch (Exception ex) { Integrity.GetExceptionDetails(ex); } FormAdmission admission = new FormAdmission(conn, userID, patientList[0][dgvTagged.CurrentRow.Index]); admission.ShowDialog(); dgvTagged.Rows.Clear(); } }