private void treeView1_DoubleClick(object sender, EventArgs e) { if (searchFrm != null) { try { searchFrm.Close(); } catch { } } ////当前节点 TreeNodeEx theNode = treeView1.SelectedNode as TreeNodeEx; if (theNode == null) { return; } if (theNode.ImageIndex == 2 || theNode.ImageIndex == 7) { this.Cell2.closefile(); frmCellEdit frm = new frmCellEdit(this, theNode, Mydel); frm.ShowDialog(); showCell(theNode.Name); theNode.ImageIndex = (treeFactory.CheckEFileByFileID(theNode.Name, 1) == true) ? 7 : 2;//判断是否有电子文件 theNode.SelectedImageIndex = theNode.ImageIndex; MyFavorites obj = new MyFavorites(); obj.Write(theNode.Name, theNode.Text); if (treeView1.Nodes.Count > 0) { if (treeView1.Nodes[0].Text == "最近著录过的文件") { if (theNode.Parent != null && theNode.Parent.Text == "最近著录过的文件") { treeFactory.CreatemyFavoritesNode((TreeNodeEx)treeView1.Nodes[0]); treeFactory.SelectNodeImage(treeView1, theNode.Name); } else { treeFactory.CreatemyFavoritesNode((TreeNodeEx)treeView1.Nodes[0]); } } if (treeView1.Nodes.Count >= 1 && (!(treeView1.Nodes[1].IsExpanded))) { treeView1.Nodes[1].Expand(); } } } else if (theNode.ImageIndex == 4) { TXMessageBoxExtensions.Info("提示:已组卷的目录不允许编辑! \n 【温馨提示:如想编辑请在文件登记中撤销登记或在组卷目录移除此文件】"); } }
private void btn_OK_Click(object sender, EventArgs e) { bool is_Check = false; foreach (TreeNode c_node in tv_Info.Nodes[0].Nodes) { if (c_node.Checked) { is_Check = true; break; } } if (!is_Check || tv_Info.Nodes[0].Nodes.Count == 0) { TXMessageBoxExtensions.Info("提示:请选择有效的文件!"); return; } foreach (TreeNode NewNode in tv_Info.Nodes[0].Nodes) { if (NewNode.Checked) { MDL.T_FileList fileMDL = (new BLL.T_FileList_BLL()).Find(NewNode.Name, Globals.ProjectNO); if (fileMDL != null && fileMDL.isvisible == 1) { fileMDL.ArchiveID = ""; fileMDL.fileStatus = "3"; NewNode.ImageIndex = (treeFactory.CheckEFileByFileID(NewNode.Name, 2) == true) ? 7 : 2;//判断是否有电子文件 NewNode.SelectedImageIndex = NewNode.ImageIndex; (new BLL.T_FileList_BLL()).Update(fileMDL); } } } TXMessageBoxExtensions.Info("提示:成功撤消文件!"); this.DialogResult = DialogResult.OK; }