Ejemplo n.º 1
0
 public async Task <IActionResult> Edit(long?id, [Bind("FaixaID, Nome, Autor, DataLancamento,Volume ")] Faixa faixa)
 {
     if (id != faixa.FaixaID)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(faixa);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!FaixaExists(faixa.FaixaID))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(Index)));
     }
     return(View(faixa));
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ID")] Album album)
        {
            if (id != album.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(album);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AlbumExists(album.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(album));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,StreetNumber,StreetName,City,State,PostalCode,Phone")] Address address)
        {
            if (id != address.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(address);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AddressExists(address.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(address));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,SSN,FirstName,LastName")] Musician musician)
        {
            if (id != musician.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(musician);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MusicianExists(musician.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(musician));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Key")] Song song)
        {
            if (id != song.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(song);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SongExists(song.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(song));
        }
Ejemplo n.º 6
0
 public async Task <IActionResult> Edit(long?id, [Bind("MusicoId, Nome, Telefone, Endereço, Numero, Estado, Cidade, Bairro")] Musico musico)
 {
     /*
      * if (id != musico.MusicoID)
      * {
      *  return NotFound();
      * }*/
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(musico);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!MusicoExists(musico.MusicoID))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(Indexmusico)));
     }
     return(View(musico));
 }
Ejemplo n.º 7
0
 public async Task <IActionResult> Edit(long?id, [Bind("InstrumentoID, Nome, Marca, Modelo, Serie, Cor ")] Instrumento instrumento)
 {
     if (id != instrumento.InstrumentoID)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(instrumento);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!InstrumentoExists(instrumento.InstrumentoID))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(IndexInstrumento)));
     }
     return(View(instrumento));
 }
Ejemplo n.º 8
0
 public async Task <IActionResult> Edit(long?id, [Bind("AlbumID, Nome, DataAlbum, Formato,Foto,Genero")] Album album)
 {
     if (id != album.AlbumID)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         try
         {
             _context.Update(album);
             await _context.SaveChangesAsync();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!AlbumExists(album.AlbumID))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(IndexAlbum)));
     }
     return(View(album));
 }
Ejemplo n.º 9
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,MusicianID,SongID,Instrument")] Performance performance)
        {
            if (id != performance.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(performance);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PerformanceExists(performance.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MusicianID"] = new SelectList(_context.Musicians, "ID", "Discriminator", performance.MusicianID);
            ViewData["SongID"]     = new SelectList(_context.Songs, "ID", "ID", performance.SongID);
            return(View(performance));
        }