public static void InsertNewEmployee(EmployeeUsersDetails employeeUser) { int userId = UserProfilesRepository.GetUserByUserName(employeeUser.UserName).UserId; Employee employee = new Employee(); employee.CurrentSalary = employeeUser.CurrentSalary; employee.JoinDate = employeeUser.JoinDate; employee.UserId = userId; employee.CreateDate = DateTimeHelper.Today(); if (employeeUser.RoleId == 0) { webpages_Roles role = RolesRepositories.GetEmployeeRole(); employeeUser.RoleId = role.RoleId; } EmployeesRepositories.InsertNewEmployee(employee); RolesRepositories.CreateUser(userId, employeeUser.RoleId); }
public static UserProfile GetUserByUserName(string userName) { return(UserProfilesRepository.GetUserByUserName(userName)); }