public ActionResult Edit([Bind(Include = "id_assetgenre,id_asset,id_genre,active,created_at,updated_at")] AssetGenre assetGenre) { if (ModelState.IsValid) { db.Entry(assetGenre).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_asset = new SelectList(db.Assets, "id_asset", "name", assetGenre.id_asset); ViewBag.id_genre = new SelectList(db.Genres, "id_genre", "name", assetGenre.id_genre); return(View(assetGenre)); }
// GET: AssetGenre/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AssetGenre assetGenre = db.AssetGenres.Find(id); if (assetGenre == null) { return(HttpNotFound()); } return(View(assetGenre)); }
// GET: AssetGenre/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AssetGenre assetGenre = db.AssetGenres.Find(id); if (assetGenre == null) { return(HttpNotFound()); } ViewBag.id_asset = new SelectList(db.Assets, "id_asset", "name", assetGenre.id_asset); ViewBag.id_genre = new SelectList(db.Genres, "id_genre", "name", assetGenre.id_genre); return(View(assetGenre)); }