public bool EditEmployee(Employee e) { return(employeeDAL.EditEmployee(e)); }
public bool AddEmployee(Employee e) { return(employeeDAL.AddEmployee(e)); }
public void GetSet_test() { Employee empl = new Employee(); }
public void Phohe_EmployeeWithoutDepartmentInit() { var employee = new Employee(); var phone = new Phone("777-77", employee); }
/// <summary> /// 保存角色信息和权限 /// </summary> /// <param name="sessionModel"></param> /// <param name="employee"></param> /// <returns></returns> private IEnumerable <string> GetRoleSession(ref LoginSessionModel sessionModel, Employee employee) { List <string> list = new List <string>(); //部门或角色为空, if (employee.RoleId.IsNullOrEmpty() || employee.DepartmentId.IsNullOrEmpty()) { return(list); } else { var RoleDept = DepartmentRoleDAL.Get(u => u.Enable && u.DepartmentId == employee.DepartmentId && u.RoleId == employee.RoleId); if (RoleDept == null) { return(list); } var Role = RoleDAL.Get(u => u.Enable && u.RoleId == RoleDept.RoleId); if (Role == null) { return(list); } sessionModel.Role = Role; var appList = DepartmentRoleApplicationDAL.GetModels(u => u.Enable && u.DepartmentId == employee.DepartmentId && u.RoleId == employee.RoleId).Select(u => u.ApplicationId); if (appList.IsNullOrEmpty()) { return(list); } else { return(list = appList.ToList()); } } }
/// <summary> /// 保存用户基本信息和登陆信息 /// </summary> /// <param name="sessionModel"></param> /// <param name="account"></param> /// <param name="employee"></param> /// <returns></returns> private IEnumerable <string> GetUserSession(ref LoginSessionModel sessionModel, Login account, Employee employee) { //不保存登陆密码信息 account.LoginPassword = ""; account.Salt = ""; sessionModel.Account = account; List <string> list = new List <string>(); //获取员工基本信息 sessionModel.Employee = employee; //获取员工的应用程序权限 var appids = EmployeeApplicationDAL.GetModels(u => u.Enable && u.EmployeeId == employee.EmployeeId).Select(u => u.ApplicationId); if (!appids.IsNullOrEmpty()) { list = appids.ToList(); } return(list); }
/// <summary> /// 保存部门信息和角色权限 /// </summary> /// <param name="sessionModel"></param> /// <param name="employee"></param> /// <returns></returns> private IEnumerable <string> GetDepartmentSession(ref LoginSessionModel sessionModel, Employee employee) { List <string> list = new List <string>(); if (employee.DepartmentId.IsNullOrEmpty()) { return(list); } else { var dept = DepartmentDAL.Get(u => u.DepartmentId == employee.DepartmentId); if (dept != null) { sessionModel.Department = dept; var appList = DepartmentApplicationDAL.GetModels(u => u.Enable && u.DepartmentId == employee.DepartmentId).Select(u => u.ApplicationId); if (!appList.IsNullOrEmpty()) { list = appList.ToList(); } } return(list); } }
public MonthlySalaryEmployeeDTO GetMonthlySalaryEmployeeDTO(Employee employee) { var annualSalary = GetAnnualSalaryForMonthlyContract(employee.MonthlySalary); return(new MonthlySalaryEmployeeDTO(employee.Id, employee.Name, employee.ContractTypeName, employee.RoleId, employee.RoleName, employee.RoleDescription, annualSalary, employee.MonthlySalary)); }
private HourlySalaryEnployeeDTO GetHourlySalaryEmployeeDTO(Employee employee) { var annualSalary = GetAnnualSalaryForHourlyContract(employee.HourlySalary); return(new HourlySalaryEnployeeDTO(employee.Id, employee.Name, employee.ContractTypeName, employee.RoleId, employee.RoleName, employee.RoleDescription, annualSalary, employee.HourlySalary)); }