private void ToolStripMenuItem_ExZZJ_Click(object sender, EventArgs e) { if (BOMDS != null) { var lists = BOMDS.Where(o => o.PullAsAsm == "TRUE").ToList(); DataTemp = Utility.ListToDataTable(lists); ExportToExcel(DataTemp, tboxPartNum.Text + "自制件报表"); } }
private void ToolStripMenuItem_ToFactBOM_Click(object sender, EventArgs e) { if (BOMDS_Fact == null) { BOMDS_Fact = new List <Entity.DTO.DTO_MBOM>(); } foreach (var item in BOMDS) { //判断虚拟件 if (item.PartDescription.Contains("VPART")) { //寻找上级非虚拟件 var vPart = LookUVPart(item.PartNum, BOMDS); if (vPart != null) { var MtlParts = BOMDS.Where(o => o.PartNum == item.PartNum).ToList(); foreach (var mtl in MtlParts) { mtl.PartNum = vPart.PartNum; BOMDS_Fact.Add(mtl); } } } else { if (BOMDS_Fact.Where(o => o.PartNum == item.PartNum && o.MtlSeq == item.MtlSeq).Count() <= 0) { BOMDS_Fact.Add(item); } } } treeViewLeftBot.Nodes.Clear(); BOMDS_Fact = BOMDS_Fact.Where(o => !o.PartDescription.Contains("VPART") && !o.MtlPartDescription.Contains("VPART")).ToList(); BindTreeView(BOMDS_Fact, tboxPartNum.Text, treeViewLeftBot); tabControlLeft.SelectedIndex = 1; }