public ActionResult DeleteConfirmed(int id) { Pyetja pyetja = db.Pyetjas.Find(id); db.Pyetjas.Remove(pyetja); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PyetjaID,Pyejta,Opcioni1,Opcioni2,Opcioni3,Opcioni4,PergjigjjaESakte")] Pyetja pyetja) { if (ModelState.IsValid) { db.Entry(pyetja).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pyetja)); }
public ActionResult Create([Bind(Include = "PyetjaID,Pyejta,Opcioni1,Opcioni2,Opcioni3,Opcioni4,PergjigjjaESakte")] Pyetja pyetja) { if (ModelState.IsValid) { db.Pyetjas.Add(pyetja); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pyetja)); }
// GET: Pyetjas/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pyetja pyetja = db.Pyetjas.Find(id); if (pyetja == null) { return(HttpNotFound()); } return(View(pyetja)); }