예제 #1
0
        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 }));
        }
예제 #2
0
        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 }));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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);
        }