private static EmployeeSession getEmployeeSession(UserSessionData userSession) { EmployeeSession employeeFromUser = new EmployeeSession(); var userAccount = new UserAccountDto() { Id = userSession.UserId}; var request = new UserRequest() { UserAccount = userAccount }; var employeeFound = new UserFactory().GetEmployeeByUserId(request).Employee; if (employeeFound != null) { employeeFromUser.Id = employeeFound.Id; employeeFromUser.Name = employeeFound.Person.Name; employeeFromUser.LastName = employeeFound.Person.LastName; } return employeeFromUser; }
private static void saveUserInSession(UserAccountDto userAccount) { _LogedUser = new UserSessionData(userAccount.Id); _LogedUser.EmployeeSession = getEmployeeSession(_LogedUser); }