/// <summary> /// 根据传回的xml生成员工合同 /// </summary> /// <param name="eGFunc"></param> /// <returns></returns> private static string AddEmployeeContract(IEnumerable <XElement> eGFunc) { SMT.Foundation.Log.Tracer.Debug("开始添加员工合同信息"); try { if (eGFunc.Count() == 0) { return(""); } string strEmployeeID = string.Empty; string strOwnerID = string.Empty; string strOwnerPostID = string.Empty; string strOwnerDepartmentID = string.Empty; string strOwnerCompanyID = string.Empty; foreach (var q in eGFunc) { string strName = q.Attribute("Name").Value; switch (strName) { case "EMPLOYEEID": strEmployeeID = q.Attribute("Value").Value; break; case "OWNERID": strOwnerID = q.Attribute("Value").Value; break; case "OWNERPOSTID": strOwnerPostID = q.Attribute("Value").Value; break; case "OWNERDEPARTMENTID": strOwnerDepartmentID = q.Attribute("Value").Value; break; case "OWNERCOMPANYID": strOwnerCompanyID = q.Attribute("Value").Value; break; } } OrganizationService ser = new OrganizationService(); T_HR_EMPLOYEECONTRACT entity = new T_HR_EMPLOYEECONTRACT(); entity.EMPLOYEECONTACTID = Guid.NewGuid().ToString(); entity.T_HR_EMPLOYEE = new T_HR_EMPLOYEE(); entity.T_HR_EMPLOYEE.EMPLOYEEID = strEmployeeID.Replace("{", "").Replace("}", ""); // entity.T_HR_PENSIONDETAIL = new T_HR_PENSIONDETAIL(); SMT.Foundation.Log.Tracer.Debug("合同员工ID:" + entity.T_HR_EMPLOYEE.EMPLOYEEID); entity.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString(); entity.EDITSTATE = ((int)EditStates.UnActived).ToString(); entity.CREATEDATE = DateTime.Now; entity.OWNERID = strOwnerID; entity.OWNERPOSTID = strOwnerPostID; entity.OWNERDEPARTMENTID = strOwnerDepartmentID; entity.OWNERCOMPANYID = strOwnerCompanyID; entity.CREATEUSERID = strOwnerID; entity.CREATEPOSTID = strOwnerPostID; entity.CREATEDEPARTMENTID = strOwnerDepartmentID; entity.CREATECOMPANYID = strOwnerCompanyID; string strMsg = ""; PersonnelService ps = new PersonnelService(); T_HR_EMPLOYEE emp = ps.GetEmployeeByID(entity.T_HR_EMPLOYEE.EMPLOYEEID); if (emp != null) { entity.OWNERID = emp.EMPLOYEEID; entity.OWNERPOSTID = emp.OWNERPOSTID; entity.OWNERDEPARTMENTID = emp.OWNERDEPARTMENTID; entity.OWNERCOMPANYID = emp.OWNERCOMPANYID; ps.EmployeeContractAdd(entity, ref strMsg); } else { SMT.Foundation.Log.Tracer.Debug("引擎触发员工合同记录失败"); } SMT.Foundation.Log.Tracer.Debug("合同工ID:" + entity.EMPLOYEECONTACTID); SMT.Foundation.Log.Tracer.Debug("开始添加员工信息:" + emp.EMPLOYEECNAME); SMT.Foundation.Log.Tracer.Debug("添加完员工信息的结果:" + strMsg); return(entity.EMPLOYEECONTACTID); } catch (Exception e) { string abc = "<HR>Message=[" + e.Message + "]" + "<HR>Source=[" + e.Source + "]<HR>StackTrace=[" + e.StackTrace + "]<HR>TargetSite=[" + e.TargetSite + "]"; Tracer.Debug(abc); return(abc); } }
/// <summary> /// /// </summary> /// <param name="eGFunc"></param> private void ORGCHANGERemindTrigger(IEnumerable<XElement> eGFunc) { OrganizationService orclient = new OrganizationService(); orclient.OrgChange(); }
/// <summary> /// /// </summary> /// <param name="eGFunc"></param> private void ORGCHANGERemindTrigger(IEnumerable <XElement> eGFunc) { OrganizationService orclient = new OrganizationService(); orclient.OrgChange(); }
/// <summary> /// 每月考勤结算触发 /// </summary> /// <param name="eGFunc"></param> private void CalculateAttendMonthlyTrigger(IEnumerable<XElement> eGFunc) { if (eGFunc.Count() == 0) { return; } string strIsCurrentMonth = string.Empty; string strAssignedObjectType = string.Empty; string strAssignedObjectId = string.Empty; foreach (var item in eGFunc) { if (item.Attribute("Name").Value == "ISCURRENTMONTH") { strIsCurrentMonth = item.Attribute("Value").Value; } else if (item.Attribute("Name").Value == "ASSIGNEDOBJECTTYPE") { strAssignedObjectType = item.Attribute("Value").Value; } else if (item.Attribute("Name").Value == "ASSIGNEDOBJECTID") { strAssignedObjectId = item.Attribute("Value").Value; } } OrganizationService svcAttend = new OrganizationService(); //svcAttend.CalculateEmployeeAttendanceMonthly(strIsCurrentMonth, strAssignedObjectType, strAssignedObjectId); }