public async Task <IActionResult> Create([Bind("Id,Name,Pic,Summary,Address,StartDate,EndDate,Current")] Meeting meeting) { if (ModelState.IsValid) { _context.Add(meeting); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(meeting)); }
public async Task <IActionResult> Create([Bind("Title,TeacherId,StartTime,EndTime,MeetingId")] Subject subject) { if (ModelState.IsValid) { _context.Add(subject); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(RedirectToAction("MeetingSubjects", new { id = subject.MeetingId })); }
public async Task <IActionResult> Create([Bind("Id,Name,Title,Photo")] Teacher teacher) { if (ModelState.IsValid) { _context.Add(teacher); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(teacher)); }