コード例 #1
0
ファイル: AnimalController.cs プロジェクト: Wouter-J/SSWDI
        public IActionResult PlaceAnimal(int ID)
        {
            var vm = new AnimalViewModel()
            {
                Lodgings = _lodgingService.ReturnAvailableLocations(ID), // Only get lodges with proper type & those that have space left.
                Animal   = _animalService.FindByID(ID),
                Stay     = _stayService.FindByID(ID),
                Lodge    = _lodgingService.FindByID(ID)
            };

            return(View(vm));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public IActionResult Details(int ID)
        {
            Lodging lodging = _lodgingService.FindByID(ID);

            return(View(lodging));
        }