public ActionResult Detail(int jobId) { var model = ijobBusiness.GetJob(jobId); if (model.Tasks.Count > 0) { var completedTaskTotalHours = model.Tasks.Where(row => row.Completed == 1).Sum(row => Convert.ToDecimal(row.BudgetedHours)); var totalHours = model.Tasks.Sum(row => Convert.ToDecimal(row.BudgetedHours)); ViewBag.progress = Convert.ToString(Convert.ToInt32(Math.Round(completedTaskTotalHours / totalHours, 2) * 100)) + "%"; model.Tasks = itaskBusiness.GetAll().Where(row => row.jobId == jobId).ToList(); } // ViewBag.jobFiles = JsonConvert.SerializeObject(model.JobFileUpload); return(View(model)); }
public async Task <IActionResult> GetAllTasks() { var tasks = await _taskManagerBusiness.GetAll(); return(Ok(tasks)); }