示例#1
0
 public bool EditEmployee(Employee e)
 {
     return(employeeDAL.EditEmployee(e));
 }
示例#2
0
 public bool AddEmployee(Employee e)
 {
     return(employeeDAL.AddEmployee(e));
 }
示例#3
0
 public void GetSet_test()
 {
     Employee empl = new Employee();
 }
示例#4
0
 public void Phohe_EmployeeWithoutDepartmentInit()
 {
     var employee = new Employee();
     var phone = new Phone("777-77", employee);
 }
示例#5
0
        /// <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());
                }
            }
        }
示例#6
0
        /// <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);
        }
示例#7
0
        /// <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);
            }
        }
示例#8
0
        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));
        }
示例#9
0
        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));
        }