public ActionResult Edit(int? id) { var t = _db.tForumThemes.Find(id); if (t == null) return HttpNotFound(); var m = new tForumThemes_Edit { tForumThemes_name = t.tForumThemes_name, tForumThemes_desc = t.tForumThemes_desc }; ViewData["tForumThemes_name"] = t.tForumThemes_name; ViewData["tForumThemes_id"] = t.Id; return View(m); }
public ActionResult Edit([Bind(Include = "tForumThemes_desc,tForumThemes_Name")] int id, tForumThemes_Edit t) { var d = _db.tForumThemes.Find(id); if (d == null) return HttpNotFound(); d.tForumThemes_name = t.tForumThemes_name; d.tForumThemes_desc = t.tForumThemes_desc; _db.Entry(d).State = EntityState.Modified; _db.SaveChanges(); return RedirectToAction("Index", "ForumThemes", new { id = d.tForumList.Id }); }