Пример #1
0
        public ActionResult Index()
        {
            int        ownerId = GetCurrentUserId();
            List <Dog> dogs    = _dogRepo.GetDogsByOwnerId(ownerId);

            return(View(dogs));
        }
Пример #2
0
        // GET: HomeController1/Details/5
        public ActionResult Details(int id)
        {
            Owner         owner   = _ownerRepo.GetOwnerById(id);
            List <Dog>    dogs    = _dogRepo.GetDogsByOwnerId(owner.Id);
            List <Walker> walkers = _walkerRepo.GetWalkersByNeighborhoodId(owner.NeighborhoodId);

            OwnerProfileViewModel profileVM = new OwnerProfileViewModel()
            {
                Owner   = owner,
                Dogs    = dogs,
                Walkers = walkers
            };

            if (owner == null)
            {
                return(NotFound());
            }
            return(View(profileVM));
        }
Пример #3
0
        // GET: OwnersController/Details/5
        public ActionResult Details(int id)
        {
            ProfileViewModel vm = new ProfileViewModel();

            vm.Dogs  = _dogRepo.GetDogsByOwnerId(id);
            vm.Owner = _ownerRepo.GetOwnerById(id);
            if (vm.Owner == null)
            {
                return(NotFound());
            }
            vm.Walkers = _walkerRepo.GetWalkersInNeighborhood(vm.Owner.NeighborhoodId);

            return(View(vm));
        }
Пример #4
0
        // GET: OwnersController

        public ActionResult Index()
        {
            try
            {
                int   ownerId = GetCurrentUserId();
                Owner owner   = _ownerRepo.GetOwnerById(ownerId);

                List <Dog>    dogs    = _dogRepo.GetDogsByOwnerId(owner.Id);
                List <Walker> walkers = _walkerRepo.GetWalkersInNeighborhood(owner.NeighborhoodId);


                ProfileViewModel vm = new ProfileViewModel()
                {
                    Owner   = owner,
                    Dogs    = dogs,
                    Walkers = walkers
                };
                return(View(vm));
            }
            catch
            {
                return(RedirectToAction("Create", "Owner"));
            }
        }
Пример #5
0
        // GET: Owners/Details/5
        public ActionResult Details(int id)
        {
            Owner         owner   = _ownerRepo.GetOwnerById(id);
            List <Dog>    dogs    = _dogRepo.GetDogsByOwnerId(owner.Id);
            List <Walker> walkers = _walkerRepo.GetWalkersInNeighborhood(owner.NeighborhoodId);

            ProfileViewModel vm = new ProfileViewModel()
            {
                Owner   = owner,
                Dogs    = dogs,
                Walkers = walkers
            };

            return(View(vm));
        }