public ActionResult Workplace() { int userId = 0; string username = ""; if (Session["UserID"] != null) { userId = Convert.ToInt32(Session["UserID"]); username = Session["userName"].ToString(); } List <WatcherWorkplaceDetails> details = new List <WatcherWorkplaceDetails>(); List <WatherResponse> ss = new List <WatherResponse>(); using (var ibisaRepository = new IBISARepository()) { details = ibisaRepository.GetWorkplaceDetail(); ss = ibisaRepository.getTaskCompletDetail(userId); } foreach (var item in details) { foreach (var item1 in ss) { //var isans = ss.FirstOrDefault(i => i.QuestionId == item.quationsId); if (item1.QuestionId != 0 && item1.QuestionId == item.quationsId) { item.isAnswerd = true; break; } } } ViewBag.userName = username; return(View(details)); }
public ActionResult WatcherDashboard() { int userId = 0; string username = ""; if (Session["UserID"] != null) { userId = Convert.ToInt32(Session["UserID"]); username = Session["userName"].ToString(); } List <WatcherWorkplaceDetails> details = new List <WatcherWorkplaceDetails>(); List <WatherResponse> ss = new List <WatherResponse>(); using (var ibisaRepository = new IBISARepository()) { details = ibisaRepository.GetWorkplaceDetail(); ss = ibisaRepository.getTaskCompletDetail(userId); } ViewBag.taskNumber = details.Count(); ViewBag.countpercent = (ss.Count()) * 100 / details.Count(); return(View()); }