public async Task <IActionResult> PutUsers(int id, Users users) { if (id != users.Id) { return(BadRequest()); } users.Password = BC.HashPassword(users.Password); _context.Entry(users).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutNews(int id, News news) { if (id != news.Id) { return(BadRequest()); } _context.Entry(news).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NewsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "Id,Name,Type,SaleStarts,SaleEnds,Status")] Event @event) { if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(@event)); }
public ActionResult Edit(Medications medications) { if (ModelState.IsValid) { db.Entry(medications).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(medications)); }
public ActionResult Edit(WeeklyDietEntry weeklydietentry) { if (ModelState.IsValid) { db.Entry(weeklydietentry).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(weeklydietentry)); }
public ActionResult EditWorkout(WorkoutDescription workouts) { if (ModelState.IsValid) { wdb.Entry(workouts).State = EntityState.Modified; wdb.SaveChanges(); return(RedirectToAction("Index")); } return(View(workouts)); }
public ActionResult Edit(Appointments appointments) { if (ModelState.IsValid) { appDb.Entry(appointments).State = EntityState.Modified; appDb.SaveChanges(); return(RedirectToAction("Index")); } return(View(appointments)); }
public ActionResult Edit([Bind(Include = "UserId,EventId")] UserFavorite userFavorite) { if (ModelState.IsValid) { db.Entry(userFavorite).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(userFavorite)); }
public ActionResult DailyEntryEdit(DailyDietEntry dailydietentry) { if (ModelState.IsValid) { ddeb.Entry(dailydietentry).State = EntityState.Modified; ddeb.SaveChanges(); return(RedirectToAction("Index")); } return(View(dailydietentry)); }
public ActionResult Edit(Doctor doctor) { if (ModelState.IsValid) { db.Entry(doctor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(doctor)); }