public ActionResult DeleteConfirmed(int id) { BeachVoice beachVoice = db.BeachVoices.Find(id); db.BeachVoices.Remove(beachVoice); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BeachVoiceId,Question,QuestionCategory,Answer,BUserId")] BeachVoice beachVoice) { if (ModelState.IsValid) { db.Entry(beachVoice).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BUserId = new SelectList(db.Students, "UserId", "FName", beachVoice.BUserId); return(View(beachVoice)); }
// GET: BeachVoice/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BeachVoice beachVoice = db.BeachVoices.Find(id); if (beachVoice == null) { return(HttpNotFound()); } return(View(beachVoice)); }
// GET: BeachVoice/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BeachVoice beachVoice = db.BeachVoices.Find(id); if (beachVoice == null) { return(HttpNotFound()); } ViewBag.BUserId = new SelectList(db.Students, "UserId", "FName", beachVoice.BUserId); return(View(beachVoice)); }