Exemplo n.º 1
0
        public IActionResult RegisterPet(PetsUserViewModel vm)
        {
            var user = authProvider.GetCurrentUser();

            vm.User       = userDAL.GetUserById(user.Id);
            vm.Pet.UserId = vm.User.Id;
            petDAO.AddPet(vm.Pet);

            return(RedirectToAction("Index", "Account"));
        }
Exemplo n.º 2
0
        public ActionResult AddPet(Pet pet)
        {
            bool result = petDAO.AddPet(pet);

            if (result)
            {
                return(Ok());
            }
            else
            {
                return(BadRequest());
            }
        }