/// <summary> /// 获取树的节点,跟其他方法合用 /// </summary> /// <param name="nodes">TreeNodeCollection</param> /// <param name="nodeID">要查询的节点</param> private void LoadFileChildNodes(TreeNodeCollection nodes, string parentID, bool withImage, bool isAll) { DigiPower.ERM.CBLL.FileRegist cbll = new FileRegist(); if (ds == null) { return; } DataView dataView = new DataView(ds.Tables[0]); dataView.RowFilter = "parentid='" + parentID + "' and imageindex<>2"; foreach (DataRowView drv in dataView) { TreeNodeEx node = new TreeNodeEx(); node.Name = drv["id"].ToString(); node.Tag = drv["table_name"].ToString(); if (withImage) { node.ImageIndex = Convert.ToInt32(drv["imageindex"]); node.SelectedImageIndex = Convert.ToInt32(drv["imageindex"]); } node.Text = drv["title"].ToString(); nodes.Add(node); if (isAll) { LoadFileChildNodes(node.Nodes, node.Name, withImage, isAll); node.IsFirstExpand = false; } else { if (GetFileCount(drv["id"].ToString(), Convert.ToInt32(drv["imageindex"])) != "[0]") { if (cbll.GetNewFileRecording_TempletCountlist(node.FullPath)) { TreeNodeEx node1 = new TreeNodeEx(); node1.Name = "临时数据"; node1.Text = "临时数据"; node.Nodes.Add(node1); } } } } }
public void ReSetValue(TreeNodeEx node) { FileRegist cbll = new FileRegist(); this.wjtm.Text = node.Text.Substring(node.Text.LastIndexOf("]") + 1); this.wh.Text = ""; // this.bgqx.Text = null; // this.bgqx.Text = "长期"; // this.mj.Text = null; // this.mj.Text = "内部"; // this.cmb_wjlx.Text = "纸质"; this.ztlx.Text = ""; //this.dptCreateDate.Value = DateTime.Now; this.dptCreateDate.TextEx = ""; this.dptCreateDate2.TextEx = "";//.Value = DateTime.Now; this.sl.Text = ""; this.gg.SelectedText = null; this.gg.Text = "A4"; this.gb.Text = null; this.gb.Text = "正本"; //this.wjlx.Text = null; //this.wjlx.Text = "文本文件(T)"; //this.wjgs.Text = cbll.GetWJGS(Globals.ProjectNO, OpeartPath(node)); //this.wjdx.Text = ""; //this.psdd.Text = ""; //this.dptpssj.TextEx = DateTime.Now.ToString();//Value = DateTime.Now; //this.psz.Text = ""; //this.fbl.Text = ""; //this.xjpp.Text = ""; //this.xjxh.Text = ""; //this.sb.Text = ""; //this.sb.Text = "彩色"; //this.fz.Text = ""; //this.wjmc.Text = node.Text; //this.dw.Text = "0"; //this.wzz.Text = "0"; this.tzz.Text = "0"; this.dtz.Text = "0"; this.zpz.Text = "0"; this.dpz.Text = "0"; }
/// <summary> /// 扫描 /// </summary> public void Scan() { if (!imageScan.ScannerAvailable()) { MessageBox.Show("没有扫描仪,无法扫描!"); return; } try { if (NewNode.ImageIndex == 2) { frmFileAdd fileAdd = new frmFileAdd(_parentForm); fileAdd.Regist(NewNode); } FileID = Guid.NewGuid().ToString(); imageScan.OpenScanner(); imageScan.ScanTo = ScanLibCtl.ScanToConstants.FileOnly; imageScan.MultiPage = true; imageScan.FileType = ScanLibCtl.FileTypeConstants.TIFF; imageScan.Image = MovedCellPath + FileID + ".tif"; if (tscmbDisp.SelectedItem.ToString() == "不显示扫描设置") { imageScan.ShowSetupBeforeScan = false; } else { imageScan.ShowSetupBeforeScan = true; } int iScan = imageScan.StartScan(); if (iScan > 0) { return; } string strScanFileName = string.Empty; System.IO.DirectoryInfo dcInfo = new System.IO.DirectoryInfo(imageScan.Image); strScanFileName = dcInfo.Name; imageScan.CloseScanner(); if (strScanFileName != "") { ERM.UI.File.frmTitle formTitle = new ERM.UI.File.frmTitle(this); if (formTitle.ShowDialog() == DialogResult.OK) { frmFileAdd add = new frmFileAdd(_parentForm); TreeNode tn = add.AddExternalFile(MovedCellPath + FileID + ".tif", NewNode, null, "OTHER", ""); strCurrentPicPath = MovedCellPath + FileID + ".tif"; ////修改数据库中title ERM.CBLL.FileRegist fileRegist = new FileRegist(); fileRegist.UpdateAttachmentTitle(OpeartPath((TreeNodeEx)(NewNode)), Globals.ProjectNO, FileID, strTitle); tn.Text = strTitle; axImgEdit1.ImagePalette = ImgeditLibCtl.ImagePaletteConstants.wiPaletteRGB24; this.axImgEdit1.Image = MovedCellPath + tn.Name + ".tif"; this.axImgEdit1.Zoom = 100; this.axImgEdit1.Display(); arrPic.Add(this.axImgEdit1.Image); axImgAdmin1.Insert(this.axImgEdit1.Image, 1, axImgThumbnail1.ThumbCount + 1, 1); axImgAdmin1.Refresh(); axImgThumbnail1.Image = reportsPath + "temp.tif"; axImgThumbnail1.Refresh(); if (System.IO.File.Exists(MovedCellPath + FileID + ".tif")) { System.IO.File.Delete(MovedCellPath + FileID + ".tif"); } hasEdit = false; curSelNoFrmThum = 1; } } else { } } catch (Exception) { } }