public async Task Update(Employee employee)
        {
            var primarySkill = _context.Employees.Where(x => x.EmployeeNumber.Equals(employee.EmployeeNumber)).Select(x => x.PrimarySkill).FirstOrDefault();

            if (employee.PrimarySkill != primarySkill)
            {
                EmployeeWorkstation employeeWorkstation = new EmployeeWorkstation {
                };
                employeeWorkstation.EmployeeNumber    = employee.EmployeeNumber;
                employeeWorkstation.WorkstationNumber = employee.PrimarySkill;

                _context.EmployeeWorkstations.Update(employeeWorkstation);
                await _context.SaveChangesAsync();
            }
            _context.Update(employee);
            await _context.SaveChangesAsync();
        }
 public async Task Update(Absence absence)
 {
     _context.Update(absence);
     await _context.SaveChangesAsync();;
 }
Esempio n. 3
0
 public async Task Update(Supervisor supervisor)
 {
     _context.Update(supervisor);
     await _context.SaveChangesAsync();
 }
 public async Task Update(DisciplineStage disciplineStage)
 {
     _context.Update(disciplineStage);
     await _context.SaveChangesAsync();
 }
Esempio n. 5
0
 public async Task Update(Comment comment)
 {
     _context.Update(comment);
     await _context.SaveChangesAsync();
 }