public List <TaskViewModel> GetParentTasks(int id)
        {
            TaskManagerDAL       taskDAL = new TaskManagerDAL();
            List <TaskViewModel> tasks   = taskDAL.GetParentTasks(id);

            return(tasks);
        }
        // GET: api/TaskManager/5
        public TaskViewModel GetTaskById(int id)
        {
            TaskManagerDAL taskDAL = new TaskManagerDAL();
            TaskViewModel  task    = taskDAL.GetTaskById(id);

            return(task);
        }
        // GET: api/TaskManager
        public List <TaskViewModel> GetAllTasks()
        {
            TaskManagerDAL       taskDAL = new TaskManagerDAL();
            List <TaskViewModel> tasks   = taskDAL.GetAllTasks();

            return(tasks);
        }
Exemple #4
0
        public void Setup(BenchmarkContext context)
        {
            taskMgr = new TaskManagerDAL();

            taskVM = new TaskViewModel
            {
                TaskDescription = "Perf testing",
                Priority        = 10,
                StartDate       = DateTime.Today,
                EndDate         = DateTime.Today.AddDays(2)
            };
        }
        //Method to Get All Tasks
        public List <Task> GetAllTasks()
        {
            dalObj = new TaskManagerDAL();
            List <Task> allTasks   = dalObj.GetAllTasks();
            List <Task> finalTasks = new List <Task>();

            foreach (Task task in allTasks)
            {
                if (task.Parent == null)
                {
                    task.Parent = new Task {
                        Task_ID = 0, TaskName = "", Parent = null, Parent_ID = 0, Priority = 0
                    };
                }
                finalTasks.Add(task);
            }
            return(finalTasks);
        }
        public bool DeleteTask(int id)
        {
            TaskManagerDAL taskDAL = new TaskManagerDAL();

            return(taskDAL.DeleteTask(id));
        }
        // POST: api/TaskManager
        public bool CompleteTask(TaskViewModel model)
        {
            TaskManagerDAL taskDAL = new TaskManagerDAL();

            return(taskDAL.CompleteTask(model.TaskId));
        }
        // POST: api/TaskManager
        public bool Save(TaskViewModel model)
        {
            TaskManagerDAL taskDAL = new TaskManagerDAL();

            return(taskDAL.SaveTask(model));
        }
 //Method to Delete task
 public void DeleteTask(int id)
 {
     dalObj = new TaskManagerDAL();
     dalObj.DeleteTask(id);
 }
 //Method to Update task
 public void UpdateTask(Task editTask)
 {
     dalObj = new TaskManagerDAL();
     dalObj.UpdateTask(editTask);
 }
 //Method to Add task
 public void AddTask(Task newTask)
 {
     dalObj = new TaskManagerDAL();
     dalObj.AddTask(newTask);
 }
 //Method to Get specific task
 public Task GetTaskById(int Id)
 {
     dalObj = new TaskManagerDAL();
     return(dalObj.GetTaskById(Id));
 }