public IList<Status?> GetAllStatus(TransferModel transferModel) { return new List<Status?> { Status.BeginWork, Status.Publish, Status.Pause }; }
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:任务编辑页面提交时显示错误信息" } }; }
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); }
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"); }
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; }
public IList<Status?> GetAllStatus(TransferModel transferModel) { IQueryable<Task> tasks = get(transferModel); return tasks.GroupBy(t => t.CurrentStatus) .Select(g => g.Key) .Cast<Status?>() .ToList() ; }
public IList<TransferItemModel> GetTasks(TransferModel transferModel) { IQueryable<Task> tasks = get(transferModel); IList<TransferItemModel> models = null; return Mapper.Map(tasks.ToList(), models); }