Пример #1
0
        public async Task <IActionResult> Create([Bind("ID,MeetingDate,Presiding,Conducting,SpecialNotes,OpeningHymn,Invocation,SacamentHymn,IntermediateHymn,ClosingHymn,Benediction")] Meeting meeting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(meeting);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(meeting));
        }
        public async Task <IActionResult> Create([Bind("ID,MeetingID,SpeakerName,SpeakerTopic")] SpeakerAssignment speakerAssignment)
        {
            speakerAssignment.ID = 0;
            if (ModelState.IsValid)
            {
                _context.Add(speakerAssignment);
                await _context.SaveChangesAsync();

                var meeting = _context.Meeting.SingleOrDefaultAsync(s => s.ID == speakerAssignment.MeetingID);
                return(RedirectToAction(nameof(Index), new { id = speakerAssignment.MeetingID }));
            }
            ViewData["MeetingID"] = speakerAssignment.MeetingID;
            return(View(speakerAssignment));
        }