public List <DocumentDto> GetDocWithMaterailByMaterialId(int id) { var docMaterialList = new Test.BOMData().GetDocPartsByPartId(id); var docList = new Test.BOMData().GetAllDocumentDto(); return(docMaterialList.Select(doc_m => docList.Find(doc => doc.Id == doc_m.Doc_Id)).ToList()); }
public void GetChildBOMStruct(int id, ref List <BOM_Struct> structList) { var list = new Test.BOMData().GetAllStruct().FindAll(s => s.Parent_Id == id); foreach (var s in list) { structList.Add(s); } }
public BOM_Struct GetBOMStructByMaterialId(int materialId, int bomId) { var list = new Test.BOMData().GetStructListByMaterialId(materialId, bomId); if (list.Count > 0) { return(list[0]); } return(null); }
/// <summary> /// 根据id和bomId获取BOM结构数据 /// </summary>/ /// <param name="id"></param>vv /// <param name="bomId"></param> /// <returns></returns> public List <BOM_Struct> GetBOMStructListByParentId(int id, int bomId) { var sql = "select * from bom_struct where parent_id=" + id + " and bom_id=" + bomId + " and is_delete='0'"; var structList = new Test.BOMData().GetAllStruct().FindAll(s => s.Id == id); //structList.Add(GetBOMStructListByMaterialId) GetAllChildBOMStruct(id, ref structList); return(structList); //return new Test.BOMData().GetStructListByParentId(id, bomId); }
/// <summary> /// 根据父节点获取所有子节点数据 /// </summary> /// <param name="id">父节点</param> /// <param name="strucList">返回的集合</param> private void GetAllChildBOMStruct(int id, ref List<BOM_Struct> structList) { var list = new Test.BOMData().GetAllStruct().FindAll(s => s.Parent_Id == id); foreach (var s in list) { structList.Add(s); GetAllChildBOMStruct(s.Id, ref structList); } }
public List<DocumentDto> GetDocWithMaterailByMaterialId(int id) { var docMaterialList = new Test.BOMData().GetDocPartsByPartId(id); var docList = new Test.BOMData().GetAllDocumentDto(); return docMaterialList.Select(doc_m => docList.Find(doc => doc.Id == doc_m.Doc_Id)).ToList(); }
/// <summary> /// 根据id和bomId获取BOM结构数据 /// </summary>/ /// <param name="id"></param>vv /// <param name="bomId"></param> /// <returns></returns> public List<BOM_Struct> GetBOMStructListByParentId(int id, int bomId) { var sql = "select * from bom_struct where parent_id=" + id + " and bom_id=" + bomId + " and is_delete='0'"; var structList = new Test.BOMData().GetAllStruct().FindAll(s => s.Id == id); //structList.Add(GetBOMStructListByMaterialId) GetAllChildBOMStruct(id, ref structList); return structList; //return new Test.BOMData().GetStructListByParentId(id, bomId); }
public BOM_Struct GetBOMStructByMaterialId(int materialId, int bomId) { var list = new Test.BOMData().GetStructListByMaterialId(materialId, bomId); if (list.Count > 0) return list[0]; return null; }