예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            videoGame videoGame = db.videoGames.Find(id);

            db.videoGames.Remove(videoGame);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Description,minimunRequirements,Price,Publiser,Developer")] videoGame videoGame)
 {
     if (ModelState.IsValid)
     {
         db.Entry(videoGame).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(videoGame));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "Id,Name,Description,minimunRequirements,Price,Publiser,Developer")] videoGame videoGame)
        {
            if (ModelState.IsValid)
            {
                db.videoGames.Add(videoGame);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(videoGame));
        }
예제 #4
0
        // GET: videoGames/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            videoGame videoGame = db.videoGames.Find(id);

            if (videoGame == null)
            {
                return(HttpNotFound());
            }
            return(View(videoGame));
        }