/// <summary> /// 判断是否有子task 决定页面上是否可折叠 /// </summary> protected bool IsHasSubTask(long taskId) { var result = false; var subList = stDal.GetTaskByParentId(taskId); if (subList != null && subList.Count > 0) { result = true; } return(result); }
/// <summary> /// 判断是否有子task 决定页面上是否可折叠 /// </summary> protected bool IsHasSubTask(long taskId) { var result = false; var subList = stDal.GetTaskByParentId(taskId); if (subList != null && subList.Count > 0) { switch (pageShowType) { case "phase": // 只显示阶段 var phaseList = subList.Where(_ => _.type_id == (int)DicEnum.TASK_TYPE.PROJECT_PHASE).ToList(); if (phaseList != null && phaseList.Count > 0) { result = true; } break; case "TaskComplete": // w完成的task var taskComList = subList.Where(_ => _.status_id == (int)DicEnum.TICKET_STATUS.DONE).ToList(); if (taskComList != null && taskComList.Count > 0) { result = true; } break; case "TaskNoComplete": // 未完成的task var taskNoComList = subList.Where(_ => _.status_id != (int)DicEnum.TICKET_STATUS.DONE).ToList(); if (taskNoComList != null && taskNoComList.Count > 0) { result = true; } break; case "ExpiredTask": // 过期的任务和问题 var longTimeNow = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now); var expTaskList = subList.Where(_ => (long)_.estimated_end_time >= longTimeNow).ToList(); if (expTaskList != null && expTaskList.Count > 0) { result = true; } break; // 不能按时完成 case "Issues": // 只显示问题类型的task var issTaskList = subList.Where(_ => _.type_id == (int)DicEnum.TASK_TYPE.PROJECT_ISSUE).ToList(); if (issTaskList != null && issTaskList.Count > 0) { result = true; } break; case "phaseBudHours": var phaseBudList = subList.Where(_ => _.type_id == (int)DicEnum.TASK_TYPE.PROJECT_PHASE).ToList(); if (phaseBudList != null && phaseBudList.Count > 0) { result = true; } break; default: result = true; break; } var purchaseList = subList.Where(_ => _.type_id == (int)DicEnum.TASK_TYPE.PROJECT_PHASE).ToList(); if (purchaseList != null && purchaseList.Count > 0) { result = true; } } return(result); // todo 根据pageShowType进行过滤,只考虑阶段或者状态相关 }