public void UpdateEmployee(string name, string email, string Role, string UserId) { var employee = GetEmployee(UserId); if (Role == "Driver") { var driver = DriverRepository.GetById(employee.Id); driver.SetName(name); driver.SetEmail(email); DriverRepository.Update(driver); } else if (Role == "Supervisor") { var supervisor = SupervisorRepository.GetById(employee.Id); supervisor.SetEmail(email); supervisor.SetName(name); SupervisorRepository.Update(supervisor); } else if (Role == "Dispatcher") { var dispatcher = DispatcherRepository.GetById(employee.Id); dispatcher.SetName(name); dispatcher.SetEmail(email); DispatcherRepository.Update(dispatcher); } }
// GET: Supervisors/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var supervisorDetailViewModel = _mapper.Map <SupervisorDetailViewModel>(await _supervisorRepository.GetById(id)); if (supervisorDetailViewModel == null) { return(NotFound()); } return(View(supervisorDetailViewModel)); }
public SupervisorVM GetSupervisors(int Id) { return(_supervisorRepository.GetById(Id)); }
public Supervisor GetById(int id) { return(repo.GetById(id)); }