Esempio n. 1
0
        /// <summary>
        /// GetTaskById
        /// </summary>
        /// <param name="taskId"></param>
        /// <returns></returns>
        public TaskMangerContext GetTaskById(int taskId)
        {
            TaskMangerContext taskData = new TaskMangerContext();
            Task_Master       task     = (dataAccess.GetTaskById(taskId));

            taskData.Task_ID     = task.Task_ID;
            taskData.Parent_ID   = task.Parent_ID;
            taskData.Task        = task.Task;
            taskData.StartDate   = task.StartDate;
            taskData.EndDate     = task.EndDate;
            taskData.Priority    = task.Priority;
            taskData.IsTaskEnded = task.IsTaskEnded;
            taskData.ParentTask  = task.ParentTask;
            taskData.Start_Date  = task.StartDate.Value.ToShortDateString();
            taskData.End_Date    = task.EndDate.Value.ToShortDateString();
            return(taskData);
        }
Esempio n. 2
0
        /// <summary>
        /// UpdateTask
        /// </summary>
        /// <param name="task"></param>
        /// <param name="parentTask"></param>
        /// <returns></returns>
        public bool UpdateTask(TaskMangerContext task, ParentTaskMangerContext parentTask)
        {
            Task_Master tmContext = new Task_Master();

            tmContext.Task_ID     = task.Task_ID;
            tmContext.Parent_ID   = task.Parent_ID;
            tmContext.Task        = task.Task;
            tmContext.StartDate   = task.StartDate;
            tmContext.EndDate     = task.EndDate;
            tmContext.Priority    = task.Priority;
            tmContext.IsTaskEnded = task.IsTaskEnded;
            tmContext.ParentTask  = task.ParentTask;

            ParentTask_Master pmContext = new ParentTask_Master();

            pmContext.Parent_ID   = (int)task.Task_ID;
            pmContext.Parent_Task = task.Task;
            bool IsTaskUpdated;

            IsTaskUpdated = dataAccess.UpdateTask(tmContext, pmContext);
            return(IsTaskUpdated);
        }
        /// <summary>
        /// UpdateTask
        /// </summary>
        /// <param name="task"></param>
        /// <param name="parentTask"></param>
        /// <returns></returns>
        public bool UpdateTask(TaskMangerContext task, ParentTaskMangerContext parentTask)
        {
            Task_Master tmContext = new Task_Master();

            tmContext.Task_ID     = task.Task_ID;
            tmContext.Parent_ID   = task.Parent_ID;
            tmContext.Task        = task.Task;
            tmContext.Start_Date  = task.StartDate;
            tmContext.End_Date    = task.EndDate;
            tmContext.Priority    = task.Priority;
            tmContext.isTaskEnded = task.IsTaskEnded;
            tmContext.ParentTask  = task.ParentTask;
            tmContext.Project_ID  = Convert.ToInt32(task.ProjectID);
            tmContext.userID      = task.EmployeeId;
            ParentTask_Master pmContext = new ParentTask_Master();

            pmContext.Parent_ID   = (int)task.Task_ID;
            pmContext.Parent_Task = task.Task;
            bool IsTaskUpdated;

            IsTaskUpdated = dataAccess.UpdateTask(tmContext, pmContext);
            return(IsTaskUpdated);
        }
Esempio n. 4
0
        /// <summary>
        /// AddTask
        /// </summary>
        /// <param name="task"></param>
        /// <param name="parentTask"></param>
        /// <returns></returns>
        public bool AddTask(TaskMangerContext task, ParentTaskMangerContext parentTask)
        {
            bool IsTaskAdded;

            Task_Master tmContext = new Task_Master();

            tmContext.Task_ID     = task.Task_ID;
            tmContext.Parent_ID   = Convert.ToInt32(task.ParentTask);
            tmContext.Task        = task.Task;
            tmContext.StartDate   = task.StartDate;
            tmContext.EndDate     = task.EndDate;
            tmContext.Priority    = task.Priority;
            tmContext.IsTaskEnded = task.IsTaskEnded;
            tmContext.ParentTask  = task.ParentTask;

            ParentTask_Master pmContext = new ParentTask_Master();

            //pmContext.Parent_ID =(int) parentTask.Parent_ID;
            pmContext.Parent_Task = parentTask.Parent_Task;

            IsTaskAdded = dataAccess.AddTask(tmContext, pmContext);
            return(IsTaskAdded);
        }