public string GetTaskDisplayValue(int taskId, string value, string propname) { Worktask task = this.worktaskRepository.Detail(taskId); if (task != null) { if (propname.Equals("Status")) { int id = (int)(task.WorkflowInstance.WorkflowID == null ? 0 : task.WorkflowInstance.WorkflowID); return(WorkflowService.GetInstance().GetState(id, int.Parse(value)).Name); } else if (propname.Equals("Priority")) { return(CategoryService.GetInstance().GetCategoryName(int.Parse(value), Contain.CatType.Priority)); } else if (propname.Equals("TaskType")) { return(CategoryService.GetInstance().GetCategoryName(int.Parse(value), Contain.CatType.Category)); } else if (propname.Equals("BoardID")) { return(task.Board.Title); } else if (propname.Equals("Assignee")) { return(AccountHelper.GetUserFullname(task.AssigneeAcc.UserName)); } else if (propname.Equals("Reporter")) { return(AccountHelper.GetUserFullname(task.ReporterAcc.UserName)); } } return(value); }
public static void Initialize() { ICategoryRepository catRepository = (ICategoryRepository)System.Web.Mvc.DependencyResolver.Current.GetService(typeof(ICategoryRepository)); IAccountRepository accRepository = (IAccountRepository)System.Web.Mvc.DependencyResolver.Current.GetService(typeof(IAccountRepository)); IBoardRepository boardRepository = (IBoardRepository)System.Web.Mvc.DependencyResolver.Current.GetService(typeof(IBoardRepository)); IWorkflowRepository workflowRepository = (IWorkflowRepository)System.Web.Mvc.DependencyResolver.Current.GetService(typeof(IWorkflowRepository)); IWorktaskRepository worktaskRepository = (IWorktaskRepository)System.Web.Mvc.DependencyResolver.Current.GetService(typeof(IWorktaskRepository)); CategoryService catService; UserPermissionService userService; KanbanService kanbanService; WorkflowService workflowService; BoardService boardService; WorktaskService worktaskService; if (CategoryService.GetInstance() == null) { catService = new CategoryService(catRepository); } else { catService = CategoryService.GetInstance(); } if (UserPermissionService.GetInstance() == null) { userService = new UserPermissionService(accRepository); } else { userService = UserPermissionService.GetInstance(); } if (KanbanService.GetInstance() == null) { kanbanService = new KanbanService(boardRepository, accRepository); } else { kanbanService = KanbanService.GetInstance(); } if (WorkflowService.GetInstance() == null) { workflowService = new WorkflowService(workflowRepository); } else { workflowService = WorkflowService.GetInstance(); } if (BoardService.GetInstance() == null) { boardService = new BoardService(boardRepository); } else { boardService = BoardService.GetInstance(); } if (WorktaskService.GetInstance() == null) { worktaskService = new WorktaskService(worktaskRepository, catRepository); } else { worktaskService = WorktaskService.GetInstance(); } }