Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Movie_ID,Movie_Name,Movie_Release_Date,Movie_Language,Movie_Running_Time")] Movie_details movie_details)
        {
            if (id != movie_details.Movie_ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(movie_details);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Movie_detailsExists(movie_details.Movie_ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(movie_details));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Movie_details movie_details = db.Movie_Details.Find(id);

            db.Movie_Details.Remove(movie_details);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Movie_ID,Movie_Name,Movie_Release_Date,Movie_Language,Movie_Running_Time")] Movie_details movie_details)
        {
            if (ModelState.IsValid)
            {
                _context.Add(movie_details);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(movie_details));
        }
 public ActionResult Edit([Bind(Include = "Movie_details_id,Actor_Id,Producer_Id,Movie_Id")] Movie_details movie_details)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie_details).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Actor_Id    = new SelectList(db.actors, "Actor_Id", "Actor_name", movie_details.Actor_Id);
     ViewBag.Movie_Id    = new SelectList(db.movie, "Movie_Id", "Movie_name", movie_details.Movie_Id);
     ViewBag.Producer_Id = new SelectList(db.producers, "Producer_Id", "Producer_name", movie_details.Producer_Id);
     return(View(movie_details));
 }
        // GET: Movie_details/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Movie_details movie_details = db.Movie_Details.Find(id);

            if (movie_details == null)
            {
                return(HttpNotFound());
            }
            return(View(movie_details));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Movie_details = await _context.Movie_details.FirstOrDefaultAsync(m => m.Movie_ID == id);

            if (Movie_details == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Movie_details = await _context.Movie_details.FindAsync(id);

            if (Movie_details != null)
            {
                _context.Movie_details.Remove(Movie_details);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
        // GET: Movie_details/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Movie_details movie_details = db.Movie_Details.Find(id);

            if (movie_details == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Actor_Id    = new SelectList(db.actors, "Actor_Id", "Actor_name", movie_details.Actor_Id);
            ViewBag.Movie_Id    = new SelectList(db.movie, "Movie_Id", "Movie_name", movie_details.Movie_Id);
            ViewBag.Producer_Id = new SelectList(db.producers, "Producer_Id", "Producer_name", movie_details.Producer_Id);
            return(View(movie_details));
        }