Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Shows,CinemaId,MovieId,Kids_CollectionId,Available_Shows,Ticket_Price")] Show show)
        {
            if (id != show.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(show);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShowExists(show.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CinemaId"]          = new SelectList(_context.Cinema, "Id", "Address", show.CinemaId);
            ViewData["Kids_CollectionId"] = new SelectList(_context.Kids_Collection, "Id", "Director", show.Kids_CollectionId);
            ViewData["MovieId"]           = new SelectList(_context.Movie, "Id", "Director", show.MovieId);
            return(View(show));
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Director,Producer")] Kids_Collection kids_Collection)
        {
            if (id != kids_Collection.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(kids_Collection);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Kids_CollectionExists(kids_Collection.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(kids_Collection));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Website,Phone,Address")] Cinema cinema)
        {
            if (id != cinema.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cinema);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CinemaExists(cinema.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cinema));
        }