public static EmployeeUser SetEmployeeUser(EmployeeUser empUser) { EmployeeUser user = null; user = employeeCache.AddOrUpdate(empUser.EmployeeId, empUser, UpdateEmployeeUserFunc); return(user); }
public static EmployeeUser GetEmployeeUser(Guid userId) { EmployeeUser empUser = null; if (employeeCache.TryGetValue(userId, out empUser)) { return(empUser); } return(null); }
public static EmployeeUser ToEmployeeUser(this IUserData userData) { EmployeeUser empUser = UserManager.GetEmployeeUser(userData.UserId); if (empUser == null) { EmployeeLogic empLogic = new EmployeeLogic(); Employee emp = empLogic.GetEmployeeById(userData.UserId); empUser = new EmployeeUser(userData) { EmployeeId = userData.UserId, Birthday = emp.Birthday, CellPhoneNumber = emp.CellPhoneNumber, LinePhoneNumber = emp.LinePhoneNumber, Email = emp.Email, Email2 = emp.Email2, QQ = emp.QQ, ID = emp.ID, Address = emp.Address }; UserManager.SetEmployeeUser(empUser); } return(empUser); }
public static EmployeeUser UpdateEmployeeUserFunc(Guid key, EmployeeUser empUser) { return(empUser); }