public int ModifyEmpDept(string accessToken, int empId, int deptId, ref string errMsg) { EMPLOYEE_EX entity = _empRepo.Get(empId); if (entity != null) { GROUP_INFO_EX groupInfo = _groupRepo.Get(deptId); if (groupInfo != null) { List <int> department = new List <int>() { groupInfo.WX_GROUP_ID }; string gender = entity.GENDER.HasValue ? entity.GENDER.Value.ToString() : null; var response = WXQYClientServiceApi.Create().UpdateUser(accessToken, entity.USERID, entity.NAME, department, entity.POSITION, entity.MOBILE, gender, entity.EMAIL, entity.WECHAT_ID); if (response != null && response.ErrorCode == 0) { REL_EMP_GROUP rel = _empRepo.GetRelByEmpID(empId); rel.GROUP_ID = deptId; rel.FullUpdate = false; return(_empRepo.Update(rel)); } else { errMsg = response.ErrorMessage; } } } return(0); }
public EMPLOYEE_EX GetEmp(int empId) { EMPLOYEE_EX emp = _empRepo.Get(empId); if (emp != null) { emp.FullDeptName = "/" + AppConfig.Get("QYDeptRootName") + _groupRepo.GetFullDeptName(emp.DeptID); } return(emp); }
public ActionResult QueryEmp(int empId) { JsonSMsg rMsg = new JsonSMsg(); EMPLOYEE_EX empInfo = EmployeeService.GetEmp(empId); if (empInfo != null) { rMsg.Status = 1; rMsg.Data = empInfo; } return(Json(rMsg)); }