Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("DogID,UserID,ImageUrl,Breed,FirstName,LastName,Birthday,SpecialRemarks,Misc")] OwnerDog ownerDog)
        {
            if (id != ownerDog.DogID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ownerDog);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OwnerDogExists(ownerDog.DogID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(ownerDog));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(string id, [Bind("ImageUrl,Breed,HealthConcerns,HypoAllergenic,GroomingRequirements,Size,ExerciseRequirement,FamilyFriendly,DogFriendly,FoodTypes")] DogBreed dogBreed)
        {
            if (id != dogBreed.Breed)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(dogBreed);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DogBreedExists(dogBreed.Breed))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(dogBreed));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("UserID,UserName,Password,FirstName,LastName,PhoneNumber,Email")] UserAccount userAccount)
        {
            if (id != userAccount.UserID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(userAccount);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserAccountExists(userAccount.UserID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(userAccount));
        }