public ActionResult Assign(Task task) { Task updated_task = context.Tasks.Single(x => x.ID == task.ID); updated_task.UserProfileID = task.UserProfileID; context.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Complete(Task task) { Task updated_task = context.Tasks.Single(x => x.ID == task.ID); updated_task.WordCount = task.WordCount; updated_task.TimeTaken = task.TimeTaken; updated_task.Completed = true; context.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Create(Task task) { if (ModelState.IsValid) { context.Tasks.Add(task); context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleRequests = context.Requests; ViewBag.PossibleUserProfiles = context.UserProfiles; return View(task); }
public ActionResult Edit(Task task) { if (ModelState.IsValid) { context.Entry(task).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } ViewBag.PossibleRequests = context.Requests; ViewBag.PossibleUserProfiles = context.UserProfiles; return View(task); }