Exemple #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Email")] Sponsor sponsor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sponsor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sponsor));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("Id,Topic,Description")] Discussion discussion)
        {
            if (ModelState.IsValid)
            {
                _context.Add(discussion);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(discussion));
        }
Exemple #3
0
        public async Task <IActionResult> Create([Bind("Id,SpeakerId,SponsorId,DiscussionId,ScheduledTime")] Schedule schedule)
        {
            if (ModelState.IsValid)
            {
                _context.Add(schedule);
                await _context.SaveChangesAsync();

                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));
        }