// POST: api/TaskManager
        public void AddTask([FromBody] Task task)
        {
            ProjectManagerBL taskManagerBL = new ProjectManagerBL();

            taskManagerBL.AddTask(new DA.Task()
            {
                Task1      = task.Name,
                Parent__ID = task.ParentId,
                Priority   = task.Priority,
                End_Date   = Convert.ToDateTime(task.EndDate),
                Start_Date = Convert.ToDateTime(task.StartDate),
                Project_ID = task.ProjectId,
            });
        }
Exemplo n.º 2
0
        public void AddTaskTest()
        {
            Tasks newTask = new Tasks()
            {
                TaskId = 7, Task = "Task 6", ParentTaskId = 0, Priority = 5, StartDate = new DateTime(), EndDate = new DateTime(), IsEnded = true, ProjectId = 1, UserId = 3
            };
            ProjectManagerBL tb     = new ProjectManagerBL(dbContext.Object);
            string           result = tb.AddTask(newTask);

            Assert.AreEqual(result, "Task Added Successfully");

            Tasks confirmResult = tb.GetTaskById(7);

            Assert.AreEqual(confirmResult, newTask);
        }
Exemplo n.º 3
0
        public void TestMethod7_AddTask()
        {
            TaskModel obj = new TaskModel()
            {
                TaskID = 100, IsParentTask = true, Project = new ProjectModel()
                {
                    ProjectID = 100
                }, TaskName = "Task1", StartDate = DateTime.Now, EndDate = DateTime.Now, Priority = 10
            };
            Mock <IProjectDbService> mock   = new Mock <IProjectDbService>();
            ProjectManagerBL         projBL = new ProjectManagerBL(mock.Object);

            projBL.AddTask(obj);
            mock.Verify(c => c.AddTask(It.IsAny <Task>()), Times.Once);
        }
Exemplo n.º 4
0
        public void Post([FromBody] Taskset item)
        {
            Task task = new Task();

            task.TaskName   = item.TaskName;
            task.Parent_ID  = item.Parent_ID;
            task.Priority   = item.Priority;
            task.Project_ID = item.Project_ID;
            task.Priority   = item.Priority;
            task.Start_Date = item.Start_Date;
            task.End_Date   = item.End_Date;
            task.Status     = item.Status;
            int taskid = pbl.AddTask(task);

            pbl.UpdateUserTaskId(item.User_ID, taskid);
        }
        public void AddTaskTest()
        {
            Mock <ProjectManagerDBEntities> mockContext = MockDataSetList();
            var  projectManagerBL = new ProjectManagerBL(mockContext.Object);
            Task model            = new Task()
            {
                Task_ID    = 1,
                TaskName   = "Task 1",
                Parent_ID  = 1,
                Priority   = 10,
                Start_Date = DateTime.Now.Date,
                End_Date   = DateTime.Now.AddDays(10)
            };
            int result = projectManagerBL.AddTask(model);

            Assert.IsTrue(result == -1);
        }
Exemplo n.º 6
0
        public IHttpActionResult AddTask(Tasks task)
        {
            ProjectManagerBL obj = new ProjectManagerBL(_db);

            return(Ok(obj.AddTask(task)));
        }