public ActionResult AddVet(int patientId, int vetId) { Patient patient = Patient.Find(patientId); Vet vet = Vet.Find(vetId); patient.AddVet(vet); return(RedirectToAction("Show", new { id = patientId })); }
public ActionResult AddPatient(int vetId, int patientId) { Vet vet = Vet.Find(vetId); Patient patient = Patient.Find(patientId); vet.AddPatient(patient); return(RedirectToAction("Show", new { id = vetId })); }
public ActionResult Show(int id) { Dictionary <string, object> model = new Dictionary <string, object>(); Vet selectedVet = Vet.Find(id); List <Patient> vetPatients = selectedVet.GetPatients(); List <Patient> allPatients = Patient.GetAll(); model.Add("vet", selectedVet); model.Add("vetPatients", vetPatients); model.Add("allPatients", allPatients); return(View(model)); }
public void Find_ReturnsVetInDatabase_Vet() { //Arrange Vet testVet = new Vet("Doctor Bill", "Buttstuff"); testVet.Save(); //Act Vet foundVet = Vet.Find(testVet.Id); //Assert Assert.AreEqual(testVet, foundVet); }