public listPatient loadlist(string idPat) { pats = connector.loadListPatient(idPat); return(pats); }
public listPatient loadListPatient(string numberP) { listPatient patients = new listPatient(); if (numberP != "") { command.CommandText = "Select * from [patient] where [NumberP] = '" + numberP + "'"; } else { command.CommandText = "Select * from [patient]"; } using (OleDbDataReader reader = command.ExecuteReader()) { while (reader.Read()) { patientData pat = new patientData(); pat.Id = reader.GetValue(0).ToString().Trim(); pat.Surname = reader.GetValue(2).ToString().Trim(); pat.Name = reader.GetValue(3).ToString().Trim(); pat.MiddleName = reader.GetValue(4).ToString().Trim(); patients.Add(pat); } } return(patients); }
public patientControl() { data = new patientData(); connector = new dataBase(); pats = new listPatient(); }