/// <summary> /// 获取部门列表 /// </summary> /// <param name="clientid">客户端ID</param> /// <returns></returns> public static List<Department> GetDepartments(string clientid) { DataTable dt = new OrganizationDAL().GetDepartments(clientid); List<Department> list = new List<Department>(); foreach (DataRow dr in dt.Rows) { Department model = new Department(); model.FillData(dr); list.Add(model); } return list; }
/// <summary> /// 获取部门列表 /// </summary> /// <param name="agentid">代理商ID</param> /// <returns></returns> public static List<Department> GetDepartments(string agentid) { if (!Departments.ContainsKey(agentid)) { DataTable dt = new OrganizationDAL().GetDepartments(agentid); List<Department> list = new List<Department>(); foreach (DataRow dr in dt.Rows) { Department model = new Department(); model.FillData(dr); list.Add(model); } Departments.Add(agentid, list); return list; } return Departments[agentid].Where(m => m.Status == 1).ToList(); }