/// <summary> /// بچه های یک بخش را برمیگرداند /// </summary> /// <param name="nodeID"></param> /// <returns></returns> public IList <Department> GetDepartmentChilds(decimal nodeID, decimal flowId) { try { return(bDep.GetDepartmentChilds(nodeID, flowId)); /*DepartmentRepository depRep = new DepartmentRepository(false); * Flow flow = base.GetByID(flowId); * List<Department> underManagmentTree = new List<Department>(); * IList<Department> containsNode = bUnderManagment.GetUnderManagmentDepartmentByFlow(flow, true); * foreach (Department dep in containsNode) * { * underManagmentTree.Add(dep); * } * IList<Department> childs = bDep.GetDepartmentChildsWithoutDA(nodeID); * IList<Department> result = new List<Department>(); * foreach (Department child in childs) * { * if (underManagmentTree.Contains(child)) * { * result.Add(child); * } * } * * return result;*/ } catch (Exception ex) { LogException(ex, "BFlow", "GetDepartmentChilds"); throw ex; } }
private void GetDepChilds(Department parentDepartment /*, IList<Department> allNodes*/) { BDepartment bus = new BDepartment(); foreach (Department childDep in bus.GetDepartmentChilds(parentDepartment.ID)) { if (bus.GetDepartmentChilds(childDep.ID).Count > 0) { this.GetDepChilds(childDep); } } /* * foreach (Department childDep in bus.GetDepartmentChilds(parentDepartment.ID,allNodes)) * { * if (bus.GetDepartmentChilds(childDep.ID, allNodes).Count > 0) * this.GetDepChilds(childDep, allNodes); * * }*/ }
public void GetDepartmentChild_Test() { try { IList <Department> list = busDep.GetDepartmentChilds(ADORoot.ID); Assert.IsTrue(list.Where(x => x.ID == ADODepartment1.ID).Count() > 0); } catch (Exception ex) { Assert.Fail(ex.Message); } }