public void GetPatientTest() { UpdateManagement uM = UpdateManagement.GetInstance(); PatientenManagement pM = PatientenManagement.GetInstance(); Patient dummy = new Patient("Bilbo", "Beutlin", "X123457788", new DateTime(1985, 01, 01), "Onkologie", "Onkologie", new DateTime(2019, 04, 01), "m"); bool result = pM.PatientAnlegen(dummy, ZimmerManagement.GetInstance().suchePassendesBett(dummy)); Patient dummy2 = uM.GetPatient("X123456788"); pM.PatientLoeschen("X123457788"); Assert.IsTrue(dummy.Equals(dummy2)); }
// suche Patient private void sucheBtn_Click(object sender, EventArgs e) { if (!versNrSucheTxt.Text.Equals("")) //if textbox not empty { Patient patient = pUpdateManagement.GetPatient(versNrSucheTxt.Text); if (patient != null) //if patient exists { patAnzDGV.Rows.Clear(); if (patient.Station == "Onkologie") { patAnzDGV.Rows.Add(patient.Versicherungsnr, patient.Nachname, patient.Vorname, "On-" + patient.ZimmerNr + "-" + patient.Bett); } else if (patient.Station == "Orthopädie") { patAnzDGV.Rows.Add(patient.Versicherungsnr, patient.Nachname, patient.Vorname, "Or-" + patient.ZimmerNr + "-" + patient.Bett); } else if (patient.Station == "Pädiatrie") { patAnzDGV.Rows.Add(patient.Versicherungsnr, patient.Nachname, patient.Vorname, "P-" + patient.ZimmerNr + "-" + patient.Bett); } else if (patient.Station == "Innere Medizin") { patAnzDGV.Rows.Add(patient.Versicherungsnr, patient.Nachname, patient.Vorname, "IM-" + patient.ZimmerNr + "-" + patient.Bett); } else if (patient.Station == "Intensivstation") { patAnzDGV.Rows.Add(patient.Versicherungsnr, patient.Nachname, patient.Vorname, "Is-" + patient.ZimmerNr + "-" + patient.Bett); } else if (patient.Station == "Gynäkologie") { patAnzDGV.Rows.Add(patient.Versicherungsnr, patient.Nachname, patient.Vorname, "G-" + patient.ZimmerNr + "-" + patient.Bett); } } else { patientensucheMeldungTxt.ForeColor = Color.Red; patientensucheMeldungTxt.Text = "Die angegebene Versicherungsnummer existiert nicht"; } } }