Example #1
0
 /// <summary>
 /// 初始化数据
 /// </summary>
 private void PrepareData()
 {
     foreach (Model.AssessActivity activity in _AssessActivityList)
     {
         activity.ItsEmployee = new GetEmployee().GetEmployeeByAccountID(activity.ItsEmployee.Account.Id);
         activity.ItsEmployee.Account.Dept =
             _IDepartmentBll.GetDepartmentById(activity.ItsEmployee.Account.Dept.Id, null);
         if (activity.ItsEmployee.Account.Position.Grade != null)
         {
             activity.ItsEmployee.Account.Position.Grade =
                 _IPositionBll.GetPositionGradeById(activity.ItsEmployee.Account.Position.Grade.Id, null);
         }
     }
 }
Example #2
0
        ///<summary>
        ///</summary>
        ///<param name="accountID"></param>
        ///<param name="employee"></param>
        ///<param name="_IAccountBll"></param>
        ///<param name="_IDepartmentBll"></param>
        ///<param name="_IPositionBll"></param>
        ///<returns></returns>
        public static Employee SetEmployeeAccountInfo(int accountID, Employee employee, IAccountBll _IAccountBll,
                                                      IDepartmentBll _IDepartmentBll, IPositionBll _IPositionBll)
        {
            int gradeID = -1;

            if (employee.Account.Position != null && employee.Account.Position.Grade != null)
            {
                gradeID = employee.Account.Position.Grade.Id;
            }

            employee.Account = _IAccountBll.GetAccountById(accountID);
            if (employee.Account.Position != null)
            {
                employee.Account.Position = _IPositionBll.GetPositionById(employee.Account.Position.Id, null);

                employee.Account.Position.Grade =
                    _IPositionBll.GetPositionGradeById(gradeID, null);
            }
            employee.Account.Dept = _IDepartmentBll.GetDepartmentById(employee.Account.Dept.Id, null);

            return(employee);
        }