public async Task <ActionResult> Card(int?id) { if (!id.HasValue) { return(HttpNotFound()); } var task = await TaskClaim.Get(id.Value); ViewBag.StateHistory = await task.GetStateHistoryAsync(); if (CurUser.Is(AdGroup.TaskTrackerManager, AdGroup.TaskTrackerProg)) { ViewBag.Checkpoints = await TaskCheckpoint.GetListAsync(id.Value); ViewBag.TaskFiles = await TaskFile.GetListAsync(id.Value); ViewBag.TaskComments = await TaskComment.GetListAsync(id.Value); return(View("CardPerf", task)); } else { return(View("CardUser", task)); } }
public async Task <JsonResult> GetTaskCheckpointCount(int taskId) { var list = await TaskCheckpoint.GetListAsync(taskId); int all = list.Count(); int done = list.Count(x => x.Done); int undone = list.Count(x => !x.Done); return(Json(new { all = all, done = done, undone = undone })); }