Example #1
0
        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));
     }
 }
Example #4
0
 public void UpdateEmployee(EmpDetails emp)
 {
     _repo.UpdateEmployee(emp);
 }
Example #5
0
 public async Task EditEmployee(Emp emp)
 {
     _empRepository.UpdateEmployee(emp);
     await _empRepository.SaveAsync();
 }