public async Task <IActionResult> Edit(int id, [Bind("ConsumerId,FirstName,LastName,Address,Zip,Email,PhoneNumber")] Consumer consumer) { if (id != consumer.ConsumerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(consumer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConsumerExists(consumer.ConsumerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(consumer)); }
public async Task <IActionResult> Edit(int id, [Bind("BarberId,FirstName,LastName,BarberAddress,Zip")] Barber barber) { if (id != barber.BarberId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(barber); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BarberExists(barber.BarberId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(barber)); }
public async Task <IActionResult> Edit(int id, [Bind("RatingId,BarberId,ConsumerId,RatingNumber,Comments")] Ratings ratings) { if (id != ratings.RatingId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ratings); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RatingsExists(ratings.RatingId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BarberId"] = new SelectList(_context.Barber, "BarberId", "BarberId", ratings.BarberId); ViewData["ConsumerId"] = new SelectList(_context.Consumer, "ConsumerId", "ConsumerId", ratings.ConsumerId); return(View(ratings)); }
public async Task <IActionResult> Edit(int id, [Bind("Zip1,City,State,Country")] Zip zip) { if (id != zip.Zip1) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(zip); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ZipExists(zip.Zip1)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(zip)); }
public async Task <IActionResult> Edit(int id, [Bind("BarberId,PhoneNumber,OperationHours,DaysOfWeek,PolicyInfo")] BarberDetails barberDetails) { if (id != barberDetails.BarberId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(barberDetails); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BarberDetailsExists(barberDetails.BarberId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BarberId"] = new SelectList(_context.Barber, "BarberId", "BarberId", barberDetails.BarberId); return(View(barberDetails)); }
public async Task <IActionResult> Edit(int id, [Bind("AppointmentId,BarberId,ConsumerId,Date")] Appointments appointments) { if (id != appointments.AppointmentId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(appointments); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppointmentsExists(appointments.AppointmentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BarberId"] = new SelectList(_context.Barber, "BarberId", "BarberId", appointments.BarberId); ViewData["ConsumerId"] = new SelectList(_context.Consumer, "ConsumerId", "ConsumerId", appointments.ConsumerId); return(View(appointments)); }
public async Task <IActionResult> Edit(int id, [Bind("BarberId,ServiceTitle,ServiceDescription")] Services services) { if (id != services.BarberId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(services); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ServicesExists(services.BarberId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BarberId"] = new SelectList(_context.Barber, "BarberId", "BarberId", services.BarberId); return(View(services)); }