private void barButtonItem11_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (this.ctrlPowerEachList11.FocusedObject == null) return; FrmEditProject4 frm = new FrmEditProject4(); frm.FlagId = typeFlag2; try { if (treeList1.FocusedNode["ID"].ToString() != null && treeList1.FocusedNode["ID"].ToString() == "") frm.PowerUId = treeList1.FocusedNode["ID"].ToString(); } catch { } frm.isupdate = false; if (frm.ShowDialog() == DialogResult.OK) { //PowerProTypes psp_Type = new PowerProTypes(); //psp_Type.Title = frm.TypeTitle; //psp_Type.Flag = frm.PowerType; //psp_Type.Flag2 = typeFlag2; //psp_Type.ParentID = "0"; //try //{ // psp_Type.ID = Common.Services.BaseService.Create("InsertPowerProTypes", psp_Type).ToString(); // // dataTable.Rows.Add(Itop.Common.DataConverter.ObjectToRow(psp_Type, dataTable.NewRow())); //} //catch { } treeList1.BeginUpdate(); InitSodata(); treeList1.EndUpdate(); // FoucsLocation(uid1, treeList1.Nodes); } }
private void barButtonItem13_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (treeList1.FocusedNode == null) { return; } //if (treeList1.FocusedNode.ParentNode == null) //{ // MsgBox.Show("一级项目名称不能修改!"); // return; //} FrmEditProject4 frm = new FrmEditProject4(); frm.FlagId = typeFlag2; frm.PowerUId=treeList1.FocusedNode["ID"].ToString(); // frm.Isupdate = true; if (frm.ShowDialog() == DialogResult.OK) { try { treeList1.BeginUpdate(); InitSodata(); treeList1.EndUpdate(); } catch (Exception ex) { MsgBox.Show("修改出错:" + ex.Message); } } }
private void treeList1_DoubleClick(object sender, EventArgs e) { if (treeList1.FocusedNode == null) return; FrmEditProject4 fep = new FrmEditProject4(); fep.FlagId = typeFlag2; fep.PowerUId = treeList1.FocusedNode["ID"].ToString(); string uid1 = treeList1.FocusedNode["ID"].ToString(); //LineInfo li = Common.Services.BaseService.GetOneByKey<LineInfo>(treeList1.FocusedNode["Code"].ToString()); //if (li != null) // fep.IsLine = true; //substation li1 = Common.Services.BaseService.GetOneByKey<substation>(treeList1.FocusedNode["ID"].ToString()); //if (li1 != null) // fep.IsPower = true; if (fep.ShowDialog() == DialogResult.OK) { LoadData(); treeList1.ExpandAll(); FoucsLocation(uid1, treeList1.Nodes); } }