Ejemplo n.º 1
0
        /// <summary>
        /// 员工转正提醒
        /// </summary>
        /// <param name="eGFunc"></param>
        private void EmployeeCheckRemindTrigger(IEnumerable <XElement> eGFunc)
        {
            try
            {
                if (eGFunc.Count() == 0)
                {
                    return;
                }

                string strId = string.Empty;

                foreach (var item in eGFunc)
                {
                    if (item.Attribute("Name").Value == "BEREGULARID")
                    {
                        strId = item.Attribute("Value").Value;
                        break;
                    }
                }

                PersonnelService   svcPersonnel = new PersonnelService();
                T_HR_EMPLOYEEENTRY entry        = svcPersonnel.GetEmployeeEntryByEmployeeID(strId);
                if (entry != null)
                {
                    //员工已经离职了,不需要再发员工转正提醒待办
                    if (entry.T_HR_EMPLOYEE.EMPLOYEESTATE == "2")
                    {
                        return;
                    }
                    string             strMsg        = "";
                    T_HR_EMPLOYEECHECK employeeCheck = new T_HR_EMPLOYEECHECK();
                    employeeCheck.BEREGULARID              = Guid.NewGuid().ToString();
                    employeeCheck.T_HR_EMPLOYEE            = new T_HR_EMPLOYEE();
                    employeeCheck.T_HR_EMPLOYEE.EMPLOYEEID = entry.T_HR_EMPLOYEE.EMPLOYEEID;
                    employeeCheck.EMPLOYEECODE             = entry.T_HR_EMPLOYEE.EMPLOYEECODE;
                    employeeCheck.EMPLOYEENAME             = entry.T_HR_EMPLOYEE.EMPLOYEECNAME;
                    employeeCheck.PROBATIONPERIOD          = entry.PROBATIONPERIOD;
                    employeeCheck.REPORTDATE     = entry.ENTRYDATE;
                    employeeCheck.ONDUTYDATE     = entry.ONPOSTDATE;
                    employeeCheck.OWNERID        = entry.OWNERID;
                    employeeCheck.OWNERCOMPANYID = entry.OWNERCOMPANYID;
                    employeeCheck.CREATEUSERID   = entry.CREATEUSERID;
                    employeeCheck.CHECKSTATE     = "0";
                    svcPersonnel.EmployeeCheckAdd(employeeCheck, ref strMsg);
                    svcPersonnel.EmployeeCheckAlarm(employeeCheck);
                }
            }
            catch (Exception e)
            {
                Tracer.Debug("员工转正提醒出现错误" + e.ToString());
                throw e;
            }
        }