Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("CoId,CoName")] Countries countries)
        {
            if (id != countries.CoId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(countries);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CountriesExists(countries.CoId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(countries));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("PrId,PrName,PrYear,PrInfo")] Performance performance)
        {
            if (id != performance.PrId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(performance);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PerformanceExists(performance.PrId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(performance));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("AuId,AuName,AuDateb,AuDated,AuCt,AuInfo")] Authors authors)
        {
            if (id != authors.AuId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(authors);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AuthorsExists(authors.AuId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AuCt"] = new SelectList(_context.Cities, "CtId", "CtName", authors.AuCt);
            return(View(authors));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("CtId,CtName,CoId")] Cities cities)
        {
            if (id != cities.CtId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cities);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CitiesExists(cities.CtId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CoId"] = new SelectList(_context.Countries, "CoId", "CoName", cities.CoId);
            return(View(cities));
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("ThId,ThName,ThCt,ThWebsite,ThInfo")] Theaters theaters)
        {
            if (id != theaters.ThId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(theaters);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TheatersExists(theaters.ThId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ThCt"] = new SelectList(_context.Cities, "CtId", "CtName", theaters.ThCt);
            return(View(theaters));
        }