/// <summary> /// 获取所有的部门数据。 /// </summary> /// <param name="departmentID">部门ID。</param> /// <returns></returns> public OrgDepartmentCollection GetAllDepartment(string departmentID) { try { OrgDepartmentCollection collection = new OrgDepartmentCollection(); OrgDepartment[] departments = this.poxy.GetAllDepartment(departmentID); if (departments != null && departments.Length > 0) { foreach (OrgDepartment d in departments) { Org.OrgDepartment item = new Org.OrgDepartment(); item.DepartmentID = d.DepartmentID; item.DepartmentName = d.DepartmentName; item.ParentDepartmentID = d.ParentDepartmentID; item.Order = d.order; collection.Add(item); } } return collection; } catch (Exception e) { this.log.CreateErrorLog(e.Message); throw e; } }
public OrgDepartmentCollection GetSubCharge(string employeeID) { OrgDepartmentCollection depts = new OrgDepartmentCollection(); if (!string.IsNullOrEmpty(employeeID)) { SFITeachers data = new SFITeachers(); data.TeacherID = employeeID; if (this.teacherEntity.LoadRecord(ref data)) { OrgDepartment dept = new OrgDepartment(); dept.DepartmentID = data.SchoolID; dept.DepartmentName = data.SchoolName; depts.Add(dept); } } return depts; }