public async Task <IActionResult> ViewTimeSheet(DateTime Date, int Search) { ViewBag.count = _taskRepository.TaskRecomendCount(); ViewBag.Emps = new SelectList(await _empRepository.GetEmps(), "EmpId", "EmpFullName"); if (Date == DateTime.MinValue && Search == 0) { ViewBag.Empty = true; return(View()); } else { ViewBag.Date = Date; ViewBag.TotalHours = _taskRepository.GetTotalHours(Search, Date); var data = await _taskRepository.GetTimeSheet(Search, Date); if (data != null) { ViewBag.Empty = false; return(View(data)); } else { ViewBag.Empty = true; return(View()); } } }
public async Task <IActionResult> EmpIndex() { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); ViewBag.photo = Currentuser.PhotoURL; ViewBag.Rcount = _leaveRepository.leaveRecomCount(); ViewBag.Acount = _leaveRepository.leaveAppCount(); ViewBag.Attcount = _attendenceRepository.AttendenceCount(); ViewBag.Taskcount = _taskRepository.TaskRecomendCount(); return(View()); }