Ejemplo n.º 1
0
        public ViewComponentResult AddNewTask(Tasks model)
        {
            m_Task = new Tasks(model.BoardID, model.ColumnID, model.ColumnName, model.TaskContent);
            m_context.Add(m_Task);
            m_context.SaveChanges();

            return ViewComponent("Task", m_Task);
        }
Ejemplo n.º 2
0
 public void Add_Task()
 {
     // Act
      Tasks testTask = new Tasks(m_ParentBoardID, m_ParentColumnID, m_ColumnName, "New testTask content");
      int initalTaskCount = m_ScrumToolDBContext.Tasks.Count();
      // Arrange
      m_TaskController.AddNewTask(testTask);
      // Assert
      m_ScrumToolDBContext.Tasks.Should().NotBeNullOrEmpty()
      		.And.HaveCount(initalTaskCount + 1, "Number of inital coloumns + 1");
      m_ScrumToolDBContext.Tasks.Last().ShouldBeEquivalentTo(testTask, options =>
             options.Excluding(t => t.ID)
                      .Excluding(t=> t.DueDate), "The last Task object in the table should be the testTask");
 }
Ejemplo n.º 3
0
 public IViewComponentResult Invoke(Tasks model)
 {
     return View(model);
 }
Ejemplo n.º 4
0
        public IActionResult Information(int p_TaskID)
        {
            var taskList = m_context.Tasks.ToList();
            var labelList = m_context.Labels.ToList();
            var commentList = m_context.Comments.ToList();
            foreach (Tasks t in taskList)
            {
                if (t.ID == p_TaskID)
                {
                    t.LabelList = new List<Labels>();
                    foreach (Labels label in labelList)
                    {
                        if (t.ID == label.TaskID)
                        {
                            t.LabelList.Add(label);
                        }
                    }

                    t.CommentList = new List<Comments>();
                    foreach (Comments comment in commentList)
                    {
                        if (t.ID == comment.TaskID)
                        {
                            t.CommentList.Add(comment);
                        }

                    }
                    m_Task = t;
                    break;
                }
            }
            return PartialView("_Information", m_Task);
        }
Ejemplo n.º 5
0
 public TaskController(ScrumToolDB p_context)
 {
     m_context = p_context;
     m_Task = null;
 }
Ejemplo n.º 6
0
        public ViewComponentResult MovedTask(string p_NewColumnName, int p_NewColumnID, int p_TaskID)
        {
            var tasks = m_context.Tasks.ToList();

            foreach (Tasks t in tasks)
            {
                if (t.ID == p_TaskID)
                {
                    t.ColumnName = p_NewColumnName;
                    t.ColumnID = p_NewColumnID;
                    m_Task = t;
                    m_context.SaveChanges();
                    break;
                }
            }

            return ViewComponent("Task", m_Task);
        }