public ActionResult DeleteConfirmed(int id) { tbMethod tbMethod = db.tbMethod.Find(id); db.tbMethod.Remove(tbMethod); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MethodId,UserId,Name,Type,IsClosed")] tbMethod tbMethod) { if (ModelState.IsValid) { db.Entry(tbMethod).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserId = new SelectList(db.tbUsers, "UserId", "FirstName", tbMethod.UserId); return(View(tbMethod)); }
// GET: Methods/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbMethod tbMethod = db.tbMethod.Find(id); if (tbMethod == null) { return(HttpNotFound()); } return(View(tbMethod)); }
// GET: Methods/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbMethod tbMethod = db.tbMethod.Find(id); if (tbMethod == null) { return(HttpNotFound()); } ViewBag.UserId = new SelectList(db.tbUsers, "UserId", "FirstName", tbMethod.UserId); return(View(tbMethod)); }