public static void SetNewLeader(Guid leaderId, Guid employeeId) { var employee = AccessBDStaff.Get(employeeId); var lead = AccessBDStaff.Get(leaderId); lead.Underlings.Add(employee.Id); employee.Leader = leaderId; AccessBDStaff.Update(employee); AccessBDStaff.Update(lead); }
public void AddLeader(Guid leaderId, Guid employee) { if (GetEmployee(employee).IsTeamLead) { var newEmployee = GetEmployee(employee); newEmployee.IsTeamLead = false; AccessBDStaff.Update(newEmployee); } SetNewLeader(leaderId, employee); }