public async Task <IActionResult> ReviewDash() { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); int id = Currentuser.EmpId; var data = await _taskRepository.GetAllTaskList2(id); double quality = 0; foreach (var task in data) { quality += ((task.AllocatedHours - task.TakenHours) / task.AllocatedHours) * 100; } Double dc = Math.Round((Double)quality, 0); ViewBag.qulity = dc; // efficiency int count = _taskRepository.GetWorkQualityCount(id); if (count != 0) { Double WorkQ = _taskRepository.GetWorkQualitySum(id) / count; Double Work = Math.Round((Double)WorkQ, 0); ViewBag.Workqulity = Work; // work quality } else { ViewBag.Workqulity = 0; } int count1 = _taskRepository.GetCommunicationCount(id); if (count1 != 0) { Double ComQ = _taskRepository.GetComSum(id) / count1; Double com = Math.Round((Double)ComQ, 0); ViewBag.Communication = com; // work quality } else { ViewBag.Communication = 0; } return(View()); }