示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("Bid,BeautyName,BeautyPrice,BQty")] BeautynSpa beautynSpa)
        {
            if (id != beautynSpa.Bid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(beautynSpa);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BeautynSpaExists(beautynSpa.Bid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(beautynSpa));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("Hid,HotelName,HotelPrice,HDateCheckInDate,HDateCheckOutDate,HQty")] Hotel hotel)
        {
            if (id != hotel.Hid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(hotel);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HotelExists(hotel.Hid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(hotel));
        }
示例#3
0
        public async Task <IActionResult> Edit(int id, [Bind("Rid,RestName,RestPrice,RDateCheckInDate,RDateCheckOutDate,RQty")] Restaurant restaurant)
        {
            if (id != restaurant.Rid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(restaurant);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RestaurantExists(restaurant.Rid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(restaurant));
        }
示例#4
0
        public async Task <IActionResult> Edit(int id, [Bind("Actid,ActName,ActPrice,AQty")] Activity activity)
        {
            if (id != activity.Actid)
            {
                return(NotFound());
            }

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