Exemple #1
0
 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));
 }
Exemple #2
0
        // 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));
        }
Exemple #3
0
        // 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));
        }