Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(string id, [Bind("Id,Name,CarNo,CarType,Colour")] User user)
        {
            if (id != user.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("CarId,CarNo,CarColor,CarType")] Car car)
        {
            if (id != car.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(car);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CarExists(car.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(car));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Address,Date,Day,Amount,Vacuum,Leatherconditioner,Polish,Freshner,Amortires,Enginewash,CarId,TypesId,Payment,Answer,Comment,Latitude,Longitude")] Reservation reservation)
        {
            if (id != reservation.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(reservation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReservationExists(reservation.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ReservationsController.GetReservation), "Reservations"));
            }
            ViewData["CarId"]   = new SelectList(_context.Car, "Id", "CarNo", reservation.CarId);
            ViewData["TypesId"] = new SelectList(_context.Types, "Id", "Services", reservation.TypesId);
            return(View(reservation));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,DateTime,Day,Latitude,Longitude,UserId")] Location location)
        {
            if (id != location.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(location);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LocationExists(location.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.User, "Id", "Id", location.UserId);
            return(View(location));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Services,Prices")] Types types)
        {
            if (id != types.Id)
            {
                return(NotFound());
            }

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