public async Task <IActionResult> ViewTimeS(DateTime Date) { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); ViewBag.photo = Currentuser.PhotoURL; int id = Currentuser.EmpId; if (Date == DateTime.MinValue) { ViewBag.Empty = true; return(View()); } else { ViewBag.Date = Date; ViewBag.TotalHours = _taskRepository.GetTotalHours(id, Date); var data = await _taskRepository.GetTimeSheet(id, Date); if (data != null) { ViewBag.Empty = false; return(View(data)); } else { ViewBag.Empty = true; return(View()); } } }
public async Task <IActionResult> ViewTimeS(DateTime Date, int Search) { 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()); } } }