public async Task EditVacation(Vacation vacation, int id) { var vac = await _vacationRepository.GetVacation(id); var emp = await _empRepository.GetEmp(vac.EmpId); emp.Vacations = new List <Vacation>(); emp.Vacations.Add(vacation); _empRepository.UpdateEmployee(emp); await _empRepository.SaveAsync(); }
public async Task <IActionResult> SeeLeaveDetails(int id) { ViewBag.Rcount = _leaveRepository.leaveRecomCount(); ViewBag.Acount = _leaveRepository.leaveAppCount(); var data = await _empRepository.GetEmp(id); return(View(data)); }
public async Task <Emp> GetEmp(int Id) { return(await _empRepository.GetEmp(Id));; }