Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,SpeakerId,SponsorId,DiscussionId,ScheduledTime")] Schedule schedule)
        {
            if (id != schedule.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(schedule);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ScheduleExists(schedule.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DiscussionId"] = new SelectList(_context.Discussion, "Id", "Id", schedule.DiscussionId);
            ViewData["SpeakerId"]    = new SelectList(_context.Set <Speaker>(), "Id", "Id", schedule.SpeakerId);
            ViewData["SponsorId"]    = new SelectList(_context.Set <Sponsor>(), "Id", "Id", schedule.SponsorId);
            return(View(schedule));
        }
Exemple #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Email")] Sponsor sponsor)
        {
            if (id != sponsor.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sponsor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SponsorExists(sponsor.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sponsor));
        }
Exemple #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Topic,Description")] Discussion discussion)
        {
            if (id != discussion.Id)
            {
                return(NotFound());
            }

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