Beispiel #1
0
 public ActionResult Edit(SubTask subtask)
 {
     if (ModelState.IsValid)
     {
         _controller.Put(0, subtask);
         return RedirectToAction("Details", "Task", new { id = subtask.TaskId });
     }
     return View(subtask);
 }
Beispiel #2
0
 public void UpdateSubTask(SubTask subTask)
 {
     _repository.Update(subTask);
     var task = _taskRepository.All().FirstOrDefault(x => x.Id == subTask.TaskId);
     var allSubTasks = _repository.All().Where(x => x.TaskId == subTask.TaskId);
     if (allSubTasks.Count() == allSubTasks.Where(x => x.Completed).Count())
     {
         if (task != null)
             task.Completed = true;
     }
     else
         if (task != null)
             if (task.Completed)
                 task.Completed = false;
     _taskRepository.SaveChanges();
     _repository.SaveChanges();
 }
Beispiel #3
0
 public void AddSubTask(SubTask subTask)
 {
     _repository.Add(subTask);
     _repository.SaveChanges();
 }
Beispiel #4
0
 public PartialViewResult _SubmitForm(int id = 0)
 {
     var model = new SubTask { TaskId = id };
     return PartialView(model);
 }
Beispiel #5
0
        public PartialViewResult _Submit(SubTask subtask)
        {
            if (ModelState.IsValid)
            {
                _controller.Post(subtask);
            }

            ViewBag.TaskId = subtask.TaskId;
            var subTasks = GetSubTasksForTask(subtask.TaskId);
            return PartialView("_GetSubTasks", subTasks);
        }