private void visitorsToolStripMenuItem_Click(object sender, EventArgs e) { visitorsGrid visitors = new visitorsGrid(); visitors.Visible = true; this.Hide(); }
private void button2_Click(object sender, EventArgs e) { string currentID = ""; int count = 0; // make sure just 1 is selected since it wont take radio buttons foreach (DataGridViewRow row in volDGV.Rows) { if (row.Cells[0].Value != null && row.Cells[0].Value.Equals("true")) { count++; currentID = row.Cells[1].Value.ToString(); } } if (count == 0) { MessageBox.Show("Please select a patient.", "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (count != 1) { MessageBox.Show("Please select only one patient.", "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { foreach (PIMSController.Patient myPatient in patients) { if (currentID != null && myPatient.directory.patientID == currentID) { selectedPatient = myPatient; } } if (selectedPatient != null) { PimsMain.Program.currentPatient = selectedPatient; visitorsGrid visitors = new visitorsGrid(); visitors.Visible = true; this.Hide(); } else { MessageBox.Show("Selection Error, Please try again.", "Row selection error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void visitorListToolStripMenuItem_Click(object sender, EventArgs e) { visitorsGrid visitors = new visitorsGrid(); visitors.Visible = true; this.Hide(); }