コード例 #1
0
        public IActionResult Edit(int id, [Bind("CustomerId,EmailAddress,CustomerFN,CustomerLN,StreetAddress,City,State,Zip,PhoneNumber")] CustomerAccount customerAccount)
        {
            if (id != customerAccount.CustomerId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    Salon.EditAccount(customerAccount);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Salon.CustomerAccountExists(customerAccount.CustomerId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(customerAccount));
        }