コード例 #1
0
        // GET: api/TaskManager
        public IEnumerable <Task> GetAllTasks()
        {
            TaskManagerBL taskManagerBL = new TaskManagerBL();
            List <Task>   lstTask       = new List <Task>();

            foreach (var task in taskManagerBL.ReadAllTask())
            {
                lstTask.Add(new Task()
                {
                    Name           = task.Task1,
                    EndDate        = task.End_Date.ToString("dd/MM/yyyy"),
                    ParentId       = task.Parent__ID,
                    StartDate      = task.Start_Date.ToString("dd/MM/yyyy"),
                    Priority       = task.Priority,
                    TaskId         = task.Task_ID,
                    ParentTaskName = task.Parent__ID == null ? "" : taskManagerBL.ReadParentTask(task.Parent__ID).Parent_Task
                });
            }
            return(lstTask);
        }