public async Task <IActionResult> Create([Bind("UserId,UserName,IsParent")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Create([Bind("DeadlineId,DeadlineTitle,DeadlineDate,DeadlineNotes,IsCompleted,UserId")] Deadline deadline) { if (ModelState.IsValid) { _context.Add(deadline); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.User, "UserId", "UserName", deadline.UserId); return(View(deadline)); }
public async Task <IActionResult> Create([Bind("ApptId,ApptTitle,ApptDate,ApptLocation,ApptDuration,ApptNotes,UserId")] Appointment appointment) { if (ModelState.IsValid) { _context.Add(appointment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.User, "UserId", "UserName", appointment.UserId); return(View(appointment)); }