protected override void Validation() { _EmployeeSalaryList = new List <EmployeeSalary>(); //获取所有员工 _EmployeeList = _GetEmployee.GetEmployeeWithCurrentMonthDimissionEmployee(_SalaryTime, _CompanyId, _DepartmentID); foreach (Employee employee in _EmployeeList) { //获取员工当月工资 EmployeeSalaryHistory salaryHistory = _DalEmployeeSalary.GetEmployeeSalaryHistoryByEmployeeIdAndDateTime(employee.Account.Id, _SalaryTime); //判断当月工资是否存在 if (salaryHistory == null) { throw new ApplicationException(employee.Account.Name + BllUtility.GetResourceMessage( BllExceptionConst._Employee_Salary_NotExist)); } //当月工资是否已封帐 if (Equals(salaryHistory.EmployeeSalaryStatus, EmployeeSalaryStatusEnum.AccountClosed)) { throw new ApplicationException(employee.Account.Name + BllUtility.GetResourceMessage( BllExceptionConst._Employee_Salary_Closed)); } var employeeSalary = new EmployeeSalary(employee.Account.Id); employeeSalary.Employee = employee; employeeSalary.EmployeeSalaryHistoryList = new List <EmployeeSalaryHistory>(); employeeSalary.EmployeeSalaryHistoryList.Add(salaryHistory); _EmployeeSalaryList.Add(employeeSalary); } }
/// <summary> /// 根据员工ID和时间获取员工工资历史 /// </summary> /// <param name="employeeID"></param> /// <param name="dt"></param> /// <returns></returns> public EmployeeSalaryHistory GetEmployeeSalaryHistoryByEmployeeIdAndDateTime(int employeeID, DateTime dt) { //DateTime temp = Convert.ToDateTime(dt.Year + "-" + dt.Month); DateTime temp = new HrmisUtility().StartMonthByYearMonth(dt); return(_DalEmployeeSalary.GetEmployeeSalaryHistoryByEmployeeIdAndDateTime(employeeID, temp)); }
protected override void Validation() { _EmployeeSalaryList = new List <EmployeeSalary>(); //获取所有员工 _EmployeeList = _GetEmployee.GetEmployeeWithCurrentMonthDimissionEmployee(_SalaryTime, _CompanyId, _DepartmentId); foreach (Employee employee in _EmployeeList) { EmployeeSalaryHistory salaryHistory = _DalEmployeeSalary.GetEmployeeSalaryHistoryByEmployeeIdAndDateTime(employee.Account.Id, _SalaryTime); //判断当月工资是否存在 if (salaryHistory == null) { BllUtility.ThrowException(BllExceptionConst._Employee_Salary_NotExist); } //判断当月工资状态是否没有封帐 else if (salaryHistory.EmployeeSalaryStatus != EmployeeSalaryStatusEnum.AccountClosed) { BllUtility.ThrowException(BllExceptionConst._Employee_Salary_Not_Closed); } var employeeSalary = new EmployeeSalary(employee.Account.Id); employeeSalary.Employee = employee; employeeSalary.EmployeeSalaryHistoryList = new List <EmployeeSalaryHistory>(); employeeSalary.EmployeeSalaryHistoryList.Add(salaryHistory); _EmployeeSalaryList.Add(employeeSalary); } }
protected override void Validation() { _AccountSet = _DalEmployeeAccountSet.GetEmployeeAccountSetByEmployeeID(_EmployeeID); //判断帐套参数是否为空 if (_AccountSet != null && _AccountSet.AccountSet != null) { //判断数据库中装套是否存在 if (_DalAccountSet.GetWholeAccountSetByPKID(_AccountSet.AccountSet.AccountSetID) == null) { BllUtility.ThrowException(BllExceptionConst._EmployeeAccountSet_AccountSet_NotExist); } } //判断该月工资是否已初始化 if (_DalEmployeeSalary.GetEmployeeSalaryHistoryByEmployeeIdAndDateTime(_EmployeeID, _SalaryTime) != null) { BllUtility.ThrowException(BllExceptionConst._Employee_Salary_Exist); } }