Example #1
0
 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");
 }
Example #2
0
 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");
 }
Example #3
0
        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);
        }
Example #4
0
 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);
 }