예제 #1
0
 public IList<Status?> GetAllStatus(TransferModel transferModel)
 {
     return new List<Status?> 
     { 
         Status.BeginWork, Status.Publish, Status.Pause 
     };
 }
예제 #2
0
 public IList<TransferItemModel> GetTasks(TransferModel transferModel)
 {
     return new List<TransferItemModel>
     {
         new TransferItemModel
         { 
             CurrentStatus = Status.Publish,
             Id = 23,
             Title = "根据文档,显示正确的页面信息"
         },
         new TransferItemModel
         { 
             CurrentStatus = Status.Publish,
             Id = 24,
             Title = "bug:任务编辑页面提交时显示错误信息"
         }
     };
 }
예제 #3
0
        public ActionResult Transfer(int userId, Role role, int projectId, Status? status)
        {
            TransferModel model = new TransferModel
            {
                LeaverId = userId,
                ProjectId = projectId,
                CurrentRole = role,
                SelectedStatus = status
            };

            model.Predecessor = _userService.GetUser(userId);

            model.Tasks = _teamService.GetTasks(model);
            model.AllStatus = _teamService.GetAllStatus(model);

            return View(model);
        }
예제 #4
0
        public ActionResult Transfer(TransferModel model, Role role)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            int succesorId = _registerService.GetUserByName(model.SuccessorName);

            if (succesorId == 0)
            {
                ModelState.AddModelError("SuccessorName", "* 用户名不存在");
                return View(model);
            }

            foreach (var task in model.Tasks)
            {
                if (task.Selected)
                {
                    _teamService.HandOver(task, role, succesorId, userHelper.CurrentUserId.Value);
                }
            }

            return RedirectToAction("Transfer");
        }
예제 #5
0
        private IQueryable<Task> get(TransferModel transferModel)
        {
            IQueryable<Task> tasks = null;
            switch (transferModel.CurrentRole)
            {
                case Role.Publisher:
                    tasks = _taskQuery.AsPublisher(transferModel.LeaverId);
                    break;
                case Role.Owner:
                    tasks = _taskQuery.AsOwner(transferModel.LeaverId);
                    break;
                case Role.Accepter:
                    tasks = _taskQuery.AsAccepter(transferModel.LeaverId);
                    break;
            }
            tasks = tasks.GetInProject(transferModel.ProjectId).InFilter(
                new FFLTask.SRV.ViewModel.Task.FilterModel{ 
                    SelectedStage = (int?)transferModel.SelectedStatus});

            return tasks;
        }
예제 #6
0
 public IList<Status?> GetAllStatus(TransferModel transferModel)
 {
     IQueryable<Task> tasks = get(transferModel);
     return tasks.GroupBy(t => t.CurrentStatus)
         .Select(g => g.Key)
         .Cast<Status?>()
         .ToList()
         ;
 }
예제 #7
0
        public IList<TransferItemModel> GetTasks(TransferModel transferModel)
        {
            IQueryable<Task> tasks = get(transferModel);

            IList<TransferItemModel> models = null;
            return Mapper.Map(tasks.ToList(), models);
        }