Ejemplo n.º 1
0
 public ActionResult Create([Bind(Include = "ID,Title,ReleaseDate,Genre,Rating,Description,Picture,Video")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Movies.Add(movie);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MoviesGenre = MoviesGenre.get();
     return(View(movie));
 }
Ejemplo n.º 2
0
        public ActionResult Edit(int?id)
        {
            ViewBag.MoviesGenre = MoviesGenre.get();
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Movie movie = db.Movies.Find(id);

            if (movie == null)
            {
                return(HttpNotFound());
            }
            return(View(movie));
        }
Ejemplo n.º 3
0
 public ActionResult Create()
 {
     ViewBag.MoviesGenre = MoviesGenre.get();
     return(View());
 }