Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,PR_NAME")] Producer producer)
        {
            if (id != producer.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(producer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProducerExists(producer.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(producer));
        }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,AL_NAME,AL_YEAR")] ALBUMS 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,IN_NAME")] Type_of_instruments type_of_instruments)
        {
            if (id != type_of_instruments.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(type_of_instruments);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Type_of_instrumentsExists(type_of_instruments.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(type_of_instruments));
        }
Пример #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,MS_ID,GR_ID,MUC_YEAR,MUS_LYEAR")] Musicians_in_groups musicians_in_groups)
        {
            if (id != musicians_in_groups.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(musicians_in_groups);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Musicians_in_groupsExists(musicians_in_groups.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(musicians_in_groups));
        }
Пример #5
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,GR_NAME,PR_ID")] Group @group)
        {
            if (id != @group.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(@group);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GroupExists(@group.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(@group));
        }
Пример #6
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,MS_NAME,MS_YEAR,MS_SEX,MS_BIRTH_DATE")] 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));
        }
Пример #7
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,SN_NAME,SN_YEAR,GR_ID,AL_ID")] 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));
        }