private void treeList1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { return; } TreeListNode node = treeList1.FocusedNode; if (node == null) { return; } string strID = node["id"].ToString(); string dtype = node["class"].ToString(); if (string.IsNullOrEmpty(dtype)) { if (curDevice != null) { curDevice.Hide(); } return; } UCDeviceBase device = null; if (devicTypes.ContainsKey(dtype)) { device = devicTypes[dtype]; device.ID = strID; try { device.Show(); } catch { } } else { device = createInstance(dtype); device.ID = strID; device.ProjectID = Itop.Client.MIS.ProgUID; devicTypes.Add(dtype, device); showDevice(device); } if (curDevice != null && curDevice != device) { curDevice.Hide(); } curDevice = device; if (curDevice != null) { curDevice.strCon = " where 1=1 and"; curDevice.Init(); } }
//添加元件所关联的设备 private void adducdevice(string Devicetype) { string dtype = DeviceTypeHelper.DeviceClassbyType(Devicetype); if (string.IsNullOrEmpty(dtype)) { if (curDevice != null) { curDevice.Hide(); } return; } UCDeviceBase device = null; if (devicTypes.ContainsKey(dtype)) { device = devicTypes[dtype]; device.ID = Devicetype; try { device.Show(); } catch { } } else { device = createInstance(dtype); device.ID = Devicetype; device.ProjectID = Itop.Client.MIS.ProgUID; devicTypes.Add(dtype, device); showDevice(device); } if (curDevice != null && curDevice != device) { curDevice.Hide(); } curDevice = device; if (curDevice != null) { //给一个空的选择 curDevice.strCon = " where 1=1 and suid='1111' and"; curDevice.Init(); } }
private void treeList2_MouseClick(object sender, MouseEventArgs e) { if (strID != null) { //TreeListNode node1 = treeList1.FocusedNode; //if (node1 == null) return; //strID = node1["ID"].ToString(); if (e.Button == MouseButtons.Right) { return; } TreeListNode node = treeList2.FocusedNode; if (node == null) { return; } string dtype = node["class"].ToString(); UCDeviceBase device = null; if (devicTypes.ContainsKey(dtype)) { device = devicTypes[dtype]; try { device.Show(); } catch { } } else { device = createInstance(dtype); device.ProjectID = this.ProjectUID; devicTypes.Add(dtype, device); showDevice(device); } if (curDevice != null && curDevice != device) { curDevice.Hide(); } curDevice = device; if (curDevice != null) { curDevice.strCon = ",psp_elcdevice where psp_elcdevice.devicesuid = pspdev.suid and psp_elcdevice.projectsuid = '" + strID + "' and "; curDevice.Init(); } splitContainerControl2.Panel2.Text = node["name"].ToString(); } else { MessageBox.Show("请先选择电气计算方案!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { TreeListNode node = treeList1.FocusedNode; if (node == null) { return; } string strID = node["id"].ToString(); string dtype = node["class"].ToString(); if (string.IsNullOrEmpty(dtype)) { if (curDevice != null) { curDevice.Hide(); } return; } UCDeviceBase device = null; if (devicTypes.ContainsKey(dtype)) { device = devicTypes[dtype]; device.ID = strID; try { device.Show(); } catch { } } else { device = createInstance(dtype); device.ID = strID; device.ProjectID = Itop.Client.MIS.ProgUID; devicTypes.Add(dtype, device); showDevice(device); } if (curDevice != null && curDevice != device) { curDevice.Hide(); } curDevice = device; if (curDevice != null) { if (!string.IsNullOrEmpty(parentid)) { if (ParentObj is PSP_Substation_Info) { curDevice.strCon = " where 1=1 and SvgUID='" + ((PSP_Substation_Info)ParentObj).UID + "'and"; curDevice.ParentID = ((PSP_Substation_Info)ParentObj).UID; } else if (ParentObj is PSP_PowerSubstation_Info) { curDevice.strCon = " where 1=1 and SvgUID='" + ((PSP_PowerSubstation_Info)ParentObj).UID + "'and"; curDevice.ParentID = ((PSP_PowerSubstation_Info)ParentObj).UID; } else if (ParentObj is PSPDEV) { curDevice.strCon = " where 1=1 and SvgUID='" + ((PSPDEV)ParentObj).SUID + "'and"; curDevice.ParentID = ((PSPDEV)ParentObj).SUID; } curDevice.Init(); } //else //{ // curDevice.strCon = " where 1=1 and"; // curDevice.Init(); //} } }
private void treeList1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { return; } TreeListNode node = treeList1.FocusedNode; if (node == null) { return; } string strID = node["id"].ToString(); string dtype = node["class"].ToString(); //UCDeviceBase device = null; if (devicTypes.ContainsKey(dtype)) { device = devicTypes[dtype]; device.ID = strID; try { device.Show(); } catch { } } else { device = createInstance(dtype); device.ID = strID; device.ProjectID = ProjectID; devicTypes.Add(dtype, device); showDevice(device); } if (!shortflag) { if (!pspflag) { if (!wjghflag) { if (curDevice != null && curDevice != device) { curDevice.Hide(); } curDevice = device; if (curDevice != null) { if (xlwhere != "" || bdzwhere != "") { if (strID == "05") { curDevice.strCon = xlwhere; } if (strID == "20") { curDevice.strCon = bdzwhere; } } else { curDevice.strCon = " where 1=1 and "; } curDevice.Init(); } } else { if (curDevice != null && curDevice != device) { curDevice.Hide(); } curDevice = device; if (curDevice != null) { curDevice.wjghuid = wjghuid; curDevice.strCon = " where 1=1 and "; curDevice.WjghInit(); } } } else { if (curDevice != null && curDevice != device) { curDevice.Hide(); } curDevice = device; if (curDevice != null) { curDevice.strCon = " where 1=1 and"; curDevice.PspInit(listUID); } } } else if (shortflag) { if (curDevice != null && curDevice != device) { curDevice.Hide(); } curDevice = device; if (curDevice != null) { curDevice.strCon = ",psp_elcdevice where psp_elcdevice.devicesuid = pspdev.suid and psp_elcdevice.projectsuid = '" + ProjectSuid + "'"; curDevice.shortselelement = shortselelement; curDevice.SelshortDevices(); // IList list = UCDeviceBase.DataService.GetList("SelectPSPDEVByCondition", con); // List<PSPDEV> delsum=new List<PSPDEV>(); // for (int i = 0; i < shortselelement.Count;i++ ) // { // if (shortselelement[i].selectflag) // { // PSPDEV psp = new PSPDEV(); // psp.SUID = shortselelement[i].suid; // psp =(PSPDEV) UCDeviceBase.DataService.GetObject("SelectPSPDEVByKey", psp); // delsum.Add(psp); // } // } // for (int m = 0; m < delsum.Count; m++) // { // list.Remove(delsum[m]); // } //DataTable datatable1 = Itop.Common.DataConverter.ToDataTable(list, typeof(PSPDEV)); //curDevice.gridControl1.Refresh(); //curDevice.gridControl1.DataSource = datatable1; } } }
private void treeList1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { return; } TreeListNode node = treeList1.FocusedNode; if (node == null) { return; } string strID = node["id"].ToString(); string dtype = node["class"].ToString(); string pid = node["ParentID"].ToString(); string sname = " "; if (node.ParentNode != null) { sname = node.ParentNode["name"].ToString(); } if (dtype == "") { return; } UCDeviceBase device = null; if (devicTypes.ContainsKey(dtype)) { device = devicTypes[dtype]; try { device.Show(); } catch { } } else { device = createInstance(dtype); device.ProjectID = Itop.Client.MIS.ProgUID; devicTypes.Add(dtype, device); showDevice(device); } if (curDevice != null && curDevice != device) { curDevice.Hide(); } curDevice = device; if (curDevice != null) { curDevice.ID = strID; if (dtype == "Itop.TLPSP.DEVICE.UCDeviceMX") { curDevice.strCon = " where 1=1 and SvgUID='" + pid + "' and "; } else if (dtype == "Itop.TLPSP.DEVICE.UCDeviceCLDR" || dtype == "Itop.TLPSP.DEVICE.UCDeviceCLDK" || dtype == "Itop.TLPSP.DEVICE.UCDeviceML" || dtype == "Itop.TLPSP.DEVICE.UCDeviceML2" || dtype == "Itop.TLPSP.DEVICE.UCDeviceBLDR" || dtype == "Itop.TLPSP.DEVICE.UCDeviceBLDK" || dtype == "Itop.TLPSP.DEVICE.UCDeviceXL" || dtype == "Itop.TLPSP.DEVICE.UCDeviceBYQ2" || dtype == "Itop.TLPSP.DEVICE.UCDeviceBYQ3") { curDevice.strCon = " where 1=1 and (IName='" + sname + "' or JName='" + sname + "') and "; } else if (dtype == "Itop.TLPSP.DEVICE.UCDeviceFDJ") { curDevice.strCon = " where 1=1 and SubstationEleID='" + pid + "' and "; } else if (dtype == "Itop.TLPSP.DEVICE.UCDeviceDLQ") { curDevice.strCon = " where 1=1 and HuganLine1='" + sname + "' and "; } else { curDevice.strCon = " where 1=1 and "; } curDevice.Init(); } }