public DatabaseFacade() { PatientsDAO = new PatientsDAO(); DictionaryDAO = new DictionaryDAO(); EmployeesDAO = new EmployeesDAO(); UserDAO = new UserDAO(); OrderDAO = new OrdersDAO(); ProfilesDAO = new ProfilesDAO(); StudiesDAO = new StudiesDAO(); SamplesDAO = new SamplesDAO(); TestsDAO = new TestsDAO(); VerificationsDAO = new VerificationsDAO(); ResultsDAO = new ResultsDAO(); ResultUnitsDAO = new ResultUnitsDAO(); SessionsDAO = new SessionsDAO(); }
public void FindCompatibleDonorsTest() { //Arrange PatientsDAO patientsDAO = new PatientsDAO(); Patient patient = new Patient(); patient.PatientId = 1; patient.Name = "Test Patient"; patient.Email = "*****@*****.**"; patient.Password = "******"; patient.PhoneNumber = "0888123456"; patient.Diagnose = "test"; patient.BloodGroup = "B-"; bool result = true; List <int> ids = new List <int>() { 39, 40 }; //Act List <Donor> donors = patientsDAO.FindCompatibleDonors(patient); foreach (var donor in donors) { result &= ids.Contains(donor.DonorId); } //Assert Assert.IsTrue(result); }
public void PatientRegisterTest() { //Arrange PatientsDAO patientDAO = new PatientsDAO(); HomeDAO homeDAO = new HomeDAO(); Patient patient = new Patient { PatientId = 90, Name = "Test Patient 2", Email = "*****@*****.**", Password = "******", PhoneNumber = "0888123456", Diagnose = "test", BloodGroup = "B-" }; //Act bool result = homeDAO.PatientRegister(patient); //Assert Assert.IsTrue(result); //Clean-Up patientDAO.DeletePatient(patient); }
public PatientsController(IConfiguration _config) { config = _config; DentistsDAO = new DentistsDAO(config.GetSection("DB").GetSection("ConnectionString").Value); ProceduresDAO = new ProceduresDAO(config.GetSection("DB").GetSection("ConnectionString").Value); DiseasesDAO = new DiseasesDAO(config.GetSection("DB").GetSection("ConnectionString").Value); PatientsDAO = new PatientsDAO(config.GetSection("DB").GetSection("ConnectionString").Value); PatientRecordDAO = new PatientRecordDAO(config.GetSection("DB").GetSection("ConnectionString").Value); }
private void Button1_Click(object sender, RoutedEventArgs e) { var typedWord = SearchPatientsBox.Text; var filter = FilterPatientsComboBox.Text; var query = PatientsDAO.GetPatientsQuery(typedWord, filter); if (query != null) { PatientsGrid.ItemsSource = query.ToList(); } else { QueryPatientsResult.Content = "No result found!"; PatientsGrid.ItemsSource = null; } }
public void DeletePatientTest() { //Arrange HomeDAO homeDAO = new HomeDAO(); PatientsDAO patientsDAO = new PatientsDAO(); Patient testPatient = new Patient(); testPatient.PatientId = 102; testPatient.Name = "Test Patient 2"; testPatient.Email = "*****@*****.**"; testPatient.Password = "******"; testPatient.PhoneNumber = "0888123456"; testPatient.Diagnose = "test"; testPatient.BloodGroup = "A+"; //Act homeDAO.PatientRegister(testPatient); patientsDAO.DeletePatient(testPatient); //Assert Assert.IsTrue(homeDAO.PatientLogin(testPatient.Email, testPatient.Password) == null); }
public PatientController() { patientsDAO = new PatientsDAO(); donorsDAO = new DonorsDAO(); }
public DashboardController(IConfiguration _config) { config = _config; DentistsDAO = new DentistsDAO(config.GetSection("DB").GetSection("ConnectionString").Value); PatientsDAO = new PatientsDAO(config.GetSection("DB").GetSection("ConnectionString").Value); }