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 IActionResult Update(Models.Employee employee) { if (employee != null) { _emprepo.UpdateEmployee(employee); } return(RedirectToAction("Index", "Employee")); }
public IActionResult UpdateEmployee(EmpDetails emp) { try { _repo.UpdateEmployee(emp); return(Ok()); } catch (Exception e) { return(Ok(e.InnerException.Message)); } }
public void UpdateEmployee(EmpDetails emp) { _repo.UpdateEmployee(emp); }
public async Task EditEmployee(Emp emp) { _empRepository.UpdateEmployee(emp); await _empRepository.SaveAsync(); }