Exemplo n.º 1
0
        public ActionResult Index()
        {
            int        ownerId = GetCurrentUserId();
            List <Dog> dogs    = _dogRepo.GetDogsByOwnerId(ownerId);

            return(View(dogs));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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"));
            }
        }
Exemplo n.º 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));
        }