private void btnExpandDoctor_Click(object sender, EventArgs e) { if (selectedRow < 0) { return; } string sql_select = "SELECT DISTINCT Patient.FirstName + ' ' + Patient.LastName as PatientName, " + "CAST(PatientRegistration.[Year] as varchar(10)) " + "+ ' ' + CAST(PatientRegistration.Month as varchar(10)) " + "+ ' ' + CAST(PatientRegistration.Day as varchar(10)) as Admitted " + "FROM PatientRegistration, Consultant, Patient " + "WHERE Consultant.PatientRegNum = PatientRegistration.RegistrationNumber " + "AND Patient.PID = PatientRegistration.PID " + "AND Consultant.DoctorID = "; object contents = dgDoctor.Rows[selectedRow].Cells[0].Value; sql_select += contents.ToString(); string name = dgDoctor.Rows[selectedRow].Cells[1].Value.ToString() + " " + dgDoctor.Rows[selectedRow].Cells[2].Value.ToString(); SubQueryForm sqf = new SubQueryForm(name + "'s Patient History", sql_select); sqf.Show(); }
private void btnExpandDept_Click(object sender, EventArgs e) { if (selectedRow < 0) { return; } string sql_select = "SELECT Doctor.FirstName + ' ' + Doctor.LastName as Name " + "FROM Doctor " + "WHERE Doctor.DepartmentID = "; object contents = dgDepartment.Rows[selectedRow].Cells[0].Value; sql_select += contents.ToString(); SubQueryForm sqf = new SubQueryForm("Doctors in Department #" + contents.ToString(), sql_select); sqf.Show(); }
private void btnExpandPatient_Click(object sender, EventArgs e) { if (selectedRow < 0) { return; } string sql_select = "SELECT ConInfo.ContactType, ConInfo.Contact, ConInfo.Description " + "FROM PatientContactInfo as ConInfo " + "WHERE ConInfo.PID = "; object contents = dgPatient.Rows[selectedRow].Cells[0].Value; sql_select += contents.ToString(); string name = dgPatient.Rows[selectedRow].Cells[1].Value.ToString() + " " + dgPatient.Rows[selectedRow].Cells[2].Value.ToString(); SubQueryForm sqf = new SubQueryForm(name + "'s Contact Information", sql_select); sqf.Show(); }
private void btnExpandWard_Click(object sender, EventArgs e) { if (selectedRow < 0) { return; } string sql_select = "SELECT Patient.FirstName + ' ' + Patient.LastName as PatientName, " + "CAST(PReg.[Year] as varchar(10)) " + "+ ' ' + CAST(PReg.Month as varchar(10)) " + "+ ' ' + CAST(PReg.Day as varchar(10)) as Admitted " + "FROM Patient, Ward, PatientRegistration as PReg " + "WHERE PReg.WardID = Ward.WardID " + "AND Patient.PID = PReg.PID " + "AND PReg.WardID = "; object contents = dgWards.Rows[selectedRow].Cells[0].Value; sql_select += contents.ToString(); SubQueryForm sqf = new SubQueryForm("Patients in Ward " + contents.ToString(), sql_select); sqf.Show(); }