public ActionResult AddTaskComments(TaskPresenter taskPresenter) { if (taskPresenter != null && taskPresenter.TaskDetails != null && taskPresenter.TaskDetails.TaskID > 0 && SessionData.Instance.UserInfo != null && SessionData.Instance.UserInfo.Developer != null) { string attachmentIds = null; if (!string.IsNullOrEmpty(taskPresenter.CommentAttachmentId)) { attachmentIds = taskPresenter.CommentAttachmentId; } this.taskService.TaskCommentInsert(taskPresenter.TaskDetails.TaskID, taskPresenter.Description, attachmentIds, SessionData.Instance.UserInfo.Developer.DeveloperID); taskPresenter.AssignTaskComments(this.taskService.RetrieveTaskComment(taskPresenter.TaskDetails.TaskID)); this.AssignTaskCommentAttachments(taskPresenter); taskPresenter.AssignTaskHistory(this.taskService.RetrieveTaskHistory(taskPresenter.TaskDetails.TaskID, DefaultValue, taskPresenter.Offset + TaskPresenter.NumberOfRecord)); return this.PartialView(TaskCommentsContainer, taskPresenter); } return this.Json(string.Empty); }
/// <summary> /// Tasks the details. /// </summary> /// <param name="projectId">The project id.</param> /// <param name="taskId">The task id.</param> /// <param name="includeInactive">The include inactive.</param> /// <param name="developerId">The developer id.</param> /// <param name="tabId">The tab id.</param> /// <param name="parentTaskId">The parent task identifier.</param> /// <returns> /// returns Task Details view /// </returns> public ActionResult TaskDetails(int? projectId, int? taskId, string includeInactive, string developerId, string tabId, int? parentTaskId) { var taskPresenter = new TaskPresenter { TabId = tabId, TaskId = taskId }; if (taskId == null) { return this.Redirect(Url.AccountAction()); } var taskInfos = this.taskService.RetrieveTask(taskId); List<string> features = new List<string>(); foreach (var item in taskInfos) { features.Add(item.FeatureID.ToString()); } taskPresenter.FeatureIds = string.Join(", ", features.ToArray()); var taskInfo = taskInfos.FirstOrDefault(); if (taskInfo == null) { return this.Redirect(this.Url.AccountAction()); } if (parentTaskId != null) { taskInfo.ParentTaskID = parentTaskId; } if (projectId != null) { taskPresenter.PortalName = Resources.ProjectDashboard; if (!string.IsNullOrWhiteSpace(includeInactive)) { taskPresenter.IncludeInactive = Convert.ToBoolean(includeInactive, CultureInfo.CurrentCulture); } this.AddBreadcrumbItem(Resources.ProjectDashboard, this.RetrieveProjectDashboardAddress(this.Url.ProjectDashboardAction(), projectId, includeInactive, taskPresenter.TabId)); } else if (!string.IsNullOrWhiteSpace(developerId)) { taskPresenter.SelectedDeveloper = int.Parse(developerId); this.AddBreadcrumbItem(Resources.TeamMemberDashboard, this.RetrieveTeamMemberDashboardAddress(this.Url.TeamDashboardAction(), developerId)); taskPresenter.SelectedDeveloper = Convert.ToInt32(developerId, CultureInfo.CurrentCulture); taskPresenter.PortalName = Resources.TeamMemberDashboard; } if (taskInfo.ParentTaskID != null) { taskPresenter.FromSubTaskDetailView = true; this.AddBreadcrumbItem(Resources.SubTaskDetail, string.Empty); } else { this.AddBreadcrumbItem(Resources.TaskDetails, string.Empty); } this.AssignBasicData(taskPresenter); taskPresenter.AssignTaskDetails(taskInfo); taskPresenter.AssignTaskComments(this.taskService.RetrieveTaskComment(taskId)); this.AssignTaskCommentAttachments(taskPresenter); taskPresenter.IsExpiredDueDate = taskInfo.TaskDueDate == null ? (bool?)null : taskInfo.TaskDueDate < DateTimeHelper.RetrieveCurrentDate(); taskPresenter.AssignSubTask(this.taskService.RetrieveSubtask(taskId)); taskPresenter.Offset = DefaultValue; taskPresenter.AssignTaskHistory(this.taskService.RetrieveTaskHistory(taskId, taskPresenter.Offset, TaskPresenter.NumberOfRecord)); this.AssignAttachmentList(taskPresenter); return this.View(taskPresenter); }