public ActionResult DeleteConfirmed(long id) { Suggeste suggeste = db.Suggestes.Find(id); db.Suggestes.Remove(suggeste); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Suggeset,FK_UserID")] Suggeste suggeste) { if (ModelState.IsValid) { db.Entry(suggeste).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.FK_UserID = new SelectList(db.Users, "Id", "Username", suggeste.FK_UserID); return(View(suggeste)); }
public ActionResult Create([Bind(Include = "Id,Suggeset,FK_UserID")] Suggeste suggeste) { if (ModelState.IsValid) { db.Suggestes.Add(suggeste); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.FK_UserID = new SelectList(db.Users, "Id", "Username", suggeste.FK_UserID); return(View(suggeste)); }
// GET: Suggestes/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Suggeste suggeste = db.Suggestes.Find(id); if (suggeste == null) { return(HttpNotFound()); } return(View(suggeste)); }
// GET: Suggestes/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Suggeste suggeste = db.Suggestes.Find(id); if (suggeste == null) { return(HttpNotFound()); } ViewBag.FK_UserID = new SelectList(db.Users, "Id", "Username", suggeste.FK_UserID); return(View(suggeste)); }