private bool fMaketEquipment(DataTable table, string[] listGuids, DateTime date) { bool bRes = false; Modes.BusinessLogic.IGenObject igo; IList <Modes.BusinessLogic.IMaketEquipment> listEquip; table.Columns.Add("ID", typeof(int)); table.Columns.Add("ID_INNER", typeof(int)); table.Columns.Add("WR_DATE_TIME", typeof(DateTime)); listEquip = _mcApi.GetMaket53500Equipment(Array.ConvertAll <string, Guid> (listGuids, Guid.Parse)); listEquip.ToList().ForEach(equip => { string mesDebug = string.Empty; mesDebug = $@"DbMCInterface::GetData () - equip=[{equip.Mrid}], children.Count={equip.GenTree.Count}"; equip.GenTree.ToList().ForEach(item => { mesDebug = $"{mesDebug}{Environment.NewLine}, item.IdIner ={item.IdInner}, item.GenObjType.Id={item.GenObjType.Id}, item.Name={item.Name}, item.children.Count={item.Children.Count}..."; item.Children.ToList().ForEach(child => { mesDebug = $"{mesDebug}{Environment.NewLine}, children.IdIner ={child.IdInner}, child.GenObjType.Id={child.GenObjType.Id}, child.Name={child.Name}, child.children.Count={child.Children.Count}..."; }); igo = null; //igo = findIGO (item.IdInner); //if (Equals (igo, null) == false) // if (item.GenObjType.Id == ID_GEN_OBJECT_TYPE.RGE) // m_listIGO.Add (item); // else // ; //else // ; if (Equals(igo, null) == false) { table.Rows.Add(new object [] { igo.Id, igo.IdInner, HDateTime.ToMoscowTimeZone() }); } else { ; } }); // equip.GenTree.ToList ().ForEach Logging.Logg().Debug(mesDebug, Logging.INDEX_MESSAGE.NOT_SET); }); //TODO: bRes = true; return(bRes); }
private void button7_Click(object sender, EventArgs e) { dataGridView1.Visible = false; outputBox.Visible = true; outputBox.Items.Clear(); if (comboBox11.SelectedItem == null) { return; } Guid uid = (Guid)comboBox11.SelectedItem; IList <IMaketEquipment> listMaketEquipment = api_.GetMaket53500Equipment((new Guid[] { uid }).ToList()); if (listMaketEquipment == null) { return; } foreach (IMaketEquipment item in listMaketEquipment) { outputBox.Items.Add(String.Format("Макет : {0}", item.Mrid.ToString())); outputBox.Items.Add(""); outputBox.Items.Add("Оборудование:"); List <IGenObject> objFlatList = new List <IGenObject>(); foreach (IGenObject obj in item.GenTree) { objFlatList.Add(obj); } for (int i = 0; i < objFlatList.Count; i++) { if (objFlatList[i].Children.Count > 0) { foreach (IGenObject obj in objFlatList[i].Children) { objFlatList.Add(obj); } } } foreach (IGenObject obj in objFlatList) { outputBox.Items.Add(" " + obj.GenObjType.Name + " " + obj.Name); } } }