public async Task <IActionResult> PutTasks([FromRoute] int id, [FromBody] Tasks tasks) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tasks.TaskID) { return(BadRequest()); } _context.Entry(tasks).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TasksExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Create([Bind("TaskID,UserID")] Assignments assignments) { if (ModelState.IsValid) { _context.Add(assignments); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(assignments)); }
public async Task <IActionResult> Create([Bind("UserID,FirstName,LastName")] Users users) { if (ModelState.IsValid) { _context.Add(users); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(users)); }
public async Task <IActionResult> Create([Bind("TaskID,Title,BeginDateTime,DeadlineDateTime,Requirements")] Tasks tasks) { if (ModelState.IsValid) { _context.Add(tasks); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tasks)); }