public async Task GetProgress(int id, int stepNum, string action) { var step = await _repo.GetUpdateSteps(stepNum, id); var updatechecklist = await _repo.GetUpdate(step.Idupdate); step.Progress = action; switch (action) { case "Done": LogHistory(step, updatechecklist.Status, "Completed Step "); break; case "Skip": step.Progress = "Skip"; LogHistory(step, updatechecklist.Status, "Skipped Step "); break; case "": step.Progress = ""; LogHistory(step, updatechecklist.Status, "Unchecked Step "); break; } await _repo.SaveAll(); var percentage = Helpers.Helpers.GetPercentage(updatechecklist); await Clients.All.SendAsync("StepProgress", step.Progress, step.Step, step.Comment, percentage); }
public async Task <ActionResult> GetUpdate(int id) { var update = await _repo.GetUpdate(id); return(Ok(update)); }