Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("OnOrdID,LastName,FirstName,Email,PhoneNumber,CheeseBurger,Lasagna,TiriMisu,CheeseCake,FrenchFries,Pepsi,Sprite,Water,BillAddress,BillCity,BillState,BillZip,CreditCardNum,CCV,ExpDate")] OnOrd onOrd)
        {
            if (id != onOrd.OnOrdID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(onOrd);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OnOrdExists(onOrd.OnOrdID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(onOrd));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ReservationID,LastName,FirstName,Email,PhoneNumber,NumOfGuests,Reasons,Other,SpecialRequests,CustomerDate")] Reservation reservation)
        {
            if (id != reservation.ReservationID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(reservation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReservationExists(reservation.ReservationID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(reservation));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("CustomerID,CustomerDate,NumOfGuests")] Customer customer)
        {
            if (id != customer.CustomerID)
            {
                return(NotFound());
            }

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