private void showDevice(UCDeviceBase device) { if (device == null) { return; } device.Dock = DockStyle.Fill; this.Controls.Add(device); }
private void showDevice(UCDeviceBase device) { if (device == null) { return; } device.Dock = DockStyle.Fill; splitContainerControl1.Panel2.Controls.Add(device); }
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 treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { // if (e.Button == MouseButtons.Right) return; TreeListNode node = treeList1.FocusedNode; if (node == null) { return; } string deviceid = node["DeviceID"].ToString(); string strID = node["devicetype"].ToString(); string dtype = DeviceTypeHelper.DeviceClassbyType(strID); 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 suid='" + deviceid + "'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 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 InitDeviceType(string[] type,string year) { DataTable dt= DeviceTypeHelper.GetDeviceTypes(type); if (dt.Rows.Count>0) { string strID = dt.Rows[0]["id"].ToString(); string dtype = dt.Rows[0]["class"].ToString(); UCDeviceBase device = null; device = createInstance(dtype); device.ID = strID; device.ProjectID = Itop.Client.MIS.ProgUID; showDevice(device); string strCon = " year(cast(OperationYear as datetime))<" + year + " and Type='" + strID + "' "; device.Statictable(strCon); curDevice = device; } }
private void InitDeviceType(string[] type, string year) { DataTable dt = DeviceTypeHelper.GetDeviceTypes(type); if (dt.Rows.Count > 0) { string strID = dt.Rows[0]["id"].ToString(); string dtype = dt.Rows[0]["class"].ToString(); UCDeviceBase device = null; device = createInstance(dtype); device.ID = strID; device.ProjectID = Itop.Client.MIS.ProgUID; showDevice(device); string strCon = " year(cast(OperationYear as datetime))<" + year + " and Type='" + strID + "' "; device.Statictable(strCon); curDevice = device; } }
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(); 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 showDevice(UCDeviceBase device) { if (device == null) return; device.Dock = DockStyle.Fill; splitContainerControl1.Panel2.Controls.Add(device); }
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 = ",psp_elcdevice where psp_elcdevice.devicesuid = pspdev.suid and psp_elcdevice.projectsuid = '" +psp_proj.ID+ "' and pspdev.SvgUID='" + ((PSP_Substation_Info)ParentObj).UID + "'and"; } else if (ParentObj is PSP_PowerSubstation_Info) { curDevice.strCon = ",psp_elcdevice where psp_elcdevice.devicesuid = pspdev.suid and psp_elcdevice.projectsuid = '" + psp_proj.ID + "' and pspdev.SvgUID='" + ((PSP_PowerSubstation_Info)ParentObj).UID + "'and"; ; } else if (ParentObj is PSPDEV) { curDevice.strCon = ",psp_elcdevice where psp_elcdevice.devicesuid = pspdev.suid and psp_elcdevice.projectsuid = '" + psp_proj.ID + "' and pspdev.SvgUID='" + ((PSPDEV)ParentObj).SUID + "'and"; ; } curDevice.Init(); } //else //{ // curDevice.strCon = " where 1=1 and"; // curDevice.Init(); //} } }
private void showDevice(UCDeviceBase device) { if (device == null) return; device.Dock = DockStyle.Fill; this.Controls.Add(device); }
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 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(); if (string.IsNullOrEmpty(dtype)) { return; } if (node["id"].ToString() == "20" || node["id"].ToString()=="30") { this.bardetail.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; this.barDeleteDevice.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; } 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) { if (curDevice.GetClassName() == "PSP_Substation_Info") { curDevice.proInit(parentobj.ID); } else if (curDevice.GetClassName() == "PSP_PowerSubstation_Info") { curDevice.proInit(parentobj.ID); } else if (curDevice.GetClassName() == "PSPDEV") { 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) { //if (e.Button == MouseButtons.Right) return; TreeListNode node = treeList1.FocusedNode; if (node == null) return; string deviceid = node["DeviceID"].ToString(); string strID = node["devicetype"].ToString(); string dtype = DeviceTypeHelper.DeviceClassbyType(strID); 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 suid='" + deviceid + "'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 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 = Itop.Client.MIS.ProgUID; devicTypes.Add(dtype, device); showDevice(device); } if (curDevice != null��&& curDevice!=device) curDevice.Hide(); curDevice = device; if (curDevice != null) { IList listTemp = new List<PSPDEV>(); foreach (PSPDEV dev in deviceList) { if (dev.Type == strID) { listTemp.Add(dev); } } curDevice.Init(listTemp); } }
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(); } }
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); } }
public static void ExportChildEXCEL(DataTable dt, UCDeviceBase ub, FarPoint.Win.Spread.FpSpread fpSpread1, string sheetname, string type) { IList <string> filedList = new List <string>(); IList <string> capList = new List <string>(); Dictionary <string, IList <PSPDEV> > bdzandchidren = new Dictionary <string, IList <PSPDEV> >(); List <PSPDEV> zsjcol = new List <PSPDEV>(); for (int i = 0; i < ub.gridView1.Columns.Count; i++) { capList.Add(ub.gridView1.Columns[i].Caption); filedList.Add(ub.gridView1.Columns[i].FieldName); } FarPoint.Win.Spread.SheetView sheetview = fpSpread1.Sheets.Find(sheetname); if (sheetview == null) { sheetview = new FarPoint.Win.Spread.SheetView(); sheetview.SheetName = sheetname; fpSpread1.Sheets.Add(sheetview); } else { sheetview.RowCount = 0; sheetview.ColumnCount = 0; } sheetview.ColumnCount = capList.Count + 1; sheetview.RowCount = 1000; fpSpread1.ActiveSheet = sheetview; //读取数据 int cn = 0; foreach (DataRow dr in dt.Rows) { cn++; string strCon = " where 1=1 and SvgUID='" + dr["UID"].ToString() + "'and Type='" + type + "'"; IList <PSPDEV> list1 = UCDeviceBase.DataService.GetList <PSPDEV>("SelectPSPDEVByCondition", strCon); if (!bdzandchidren.ContainsKey(dr["Title"].ToString())) { bdzandchidren.Add(dr["Title"].ToString(), list1); } else { bdzandchidren.Add(dr["Title"].ToString() + cn.ToString(), list1); } } //加表头 sheetview.Cells[0, 0].Text = "变电站"; for (int i = 0; i < capList.Count; i++) { sheetview.Cells[0, i + 1].Text = capList[i]; } int m = 1; //添加内容 foreach (KeyValuePair <string, IList <PSPDEV> > kv in bdzandchidren) { foreach (PSPDEV pd in kv.Value) { sheetview.Cells[m, 0].Text = kv.Key; for (int i = 0; i < filedList.Count; i++) { if (pd.GetType().GetProperty(filedList[i]).GetValue(pd, null) != null) { sheetview.Cells[m, i + 1].Text = pd.GetType().GetProperty(filedList[i]).GetValue(pd, null).ToString(); } } m++; } } }