public IActionResult Edit(int ID) { Treatment treatment = _treatmentService.FindByID(ID); Stay stay = _stayService.FindByID(treatment.StayID); var vm = new TreatmentViewModel() { Animal = _animalService.FindByID(stay.AnimalID), Treatment = treatment, Stay = stay }; return(View(vm)); }
public IActionResult Adopt(int AnimalID) { //Get user name var userName = User.FindFirstValue(ClaimTypes.Name); User user = _userService.FindByUsername(userName); var vm = new AdoptionViewModel { Animal = _animalService.FindByID(AnimalID), Stay = _stayService.FindRelatedStay(AnimalID), User = user }; return(View(vm)); }
public IActionResult Create(int AnimalID) { var vm = new CommentViewModel { Animal = _animalService.FindByID(AnimalID), Stay = _stayService.FindRelatedStay(AnimalID) }; return(View(vm)); }
public IActionResult Edit(int ID) { var stay = _stayService.FindByID(ID); var vm = new StayViewModel() { Lodges = _lodgingService.ReturnAvailableLocations(stay.AnimalID), // Only get lodges with proper type & those that have space left. Stay = stay, CurrentLodge = _lodgingService.FindByID(stay.LodgingLocationID), Animal = _animalService.FindByID(stay.AnimalID) }; return(View(vm)); }
public IActionResult Details(int ID) { Animal animal = _animalService.FindByID(ID); return(View(animal)); }
public IActionResult GetAnimal(int id) { Animal animal = _animalService.FindByID(id); return(Ok(animal)); }