Ejemplo n.º 1
0
        private void DeleteRecycle(string FileID, ref frm2PDFProgressMsg frmMsg)
        {
            BLL.T_FileList_BLL     fileBLL  = new ERM.BLL.T_FileList_BLL();
            IList <MDL.T_FileList> fileList = fileBLL.FindByParentID(FileID, Globals.ProjectNO);

            foreach (MDL.T_FileList obj in fileList)
            {
                DeleteRecycle(obj.FileID, ref frmMsg);
            }

            BLL.T_CellAndEFile_BLL     cellBLL  = new ERM.BLL.T_CellAndEFile_BLL();
            IList <MDL.T_CellAndEFile> cellList = cellBLL.FindByFileID(FileID, Globals.ProjectNO, 0);

            foreach (MDL.T_CellAndEFile obj in cellList)
            {
                if (System.IO.File.Exists(Globals.ProjectPath + obj.filepath))
                {
                    System.IO.File.Delete(Globals.ProjectPath + obj.filepath);
                }
                if (System.IO.File.Exists(Globals.ProjectPath + obj.fileTreePath))
                {
                    System.IO.File.Delete(Globals.ProjectPath + obj.fileTreePath);
                }
                cellBLL.Delete(obj.CellID, Globals.ProjectNO);
            }

            fileBLL.Delete(FileID, Globals.ProjectNO);

            if (frmMsg.progressBar1.Value < frmMsg.progressBar1.Maximum)
            {
                frmMsg.progressBar1.Value++;
            }
            frmMsg.label2.Text = "正在删除:" + frmMsg.progressBar1.Value.ToString() + "/" + frmMsg.progressBar1.Maximum.ToString();
            Application.DoEvents();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 廊坊的   原文打包
        /// </summary>
        /// <param name="ds"></param>
        /// <param name="i"></param>
        private void getDocModel(MDL.T_FileList obj)
        {
            string FileID       = obj.FileID;// ds.Tables[0].Rows[fileIndex]["FileID"].ToString();
            string decFilePath  = Application.StartupPath + "\\temp\\" + obj.FileID + ".xml";
            string sourFilePath = Application.StartupPath + "\\Reports\\model.xml";

            System.IO.File.Copy(sourFilePath, decFilePath);
            XmlDocument document = new XmlDocument();

            document.Load(decFilePath);
            XmlNode rootFirst = document.SelectSingleNode("元数据/内容信息/数据对象");
            XmlNode childNode = rootFirst.FirstChild;

            if (childNode.Name == "数字对象")
            {
                string tFilePath = obj.filepath.Replace("MPDF\\", "");
                string decMfile  = Application.StartupPath + "\\temp\\" + tFilePath;
                string sourMfile = Globals.ProjectPath + obj.filepath;
                try
                {
                    System.IO.File.Copy(sourMfile, decMfile);
                    childNode.InnerText = obj.filepath;
                    document.Save(decFilePath);
                }
                catch { }
            }
            BLL.T_CellAndEFile_BLL     cellBLL  = new ERM.BLL.T_CellAndEFile_BLL();
            IList <MDL.T_CellAndEFile> cellList = cellBLL.FindByFileID(FileID, Globals.ProjectNO, 1);
            XmlNode root1 = document.SelectSingleNode("元数据/内容信息/数据对象/物理对象");

            foreach (MDL.T_CellAndEFile obj2 in cellList)
            {
                string     yswjpath      = obj2.filepath.Replace("ODOC\\", "");
                XmlElement elementRecord = document.CreateElement("记录");
                elementRecord.InnerText = "";
                XmlElement element = document.CreateElement("对象名称");
                element.InnerText = yswjpath;                                  // dsAttachment.Tables[0].Rows[ii]["yswjpath"].ToString();
                elementRecord.AppendChild(element);
                string dec  = Application.StartupPath + "\\temp\\" + yswjpath; // dsAttachment.Tables[0].Rows[ii]["yswjpath"];
                string sour = Globals.ProjectPath + obj2.filepath;             // dsAttachment.Tables[0].Rows[ii]["yswjpath"];
                try
                {
                    System.IO.File.Copy(sour, dec);
                }
                catch { }
                if (progressBar1.Value < progressBar1.Maximum)
                {
                    progressBar1.Value++;
                }
                else
                {
                    progressBar1.Value = 1;
                }
                Application.DoEvents();
            }
            document.Save(decFilePath);
        }
Ejemplo n.º 3
0
        public IList <MDL.T_CellAndEFile> GetNodeChildren(string nodeid, string ProjectNO, string path, int type_flg)
        {
            BLL.T_CellAndEFile_BLL     cellBLL  = new ERM.BLL.T_CellAndEFile_BLL();
            IList <MDL.T_CellAndEFile> cellList = (type_flg == 0 ? cellBLL.FindByFileID(nodeid, ProjectNO) : cellBLL.FindByFileID(nodeid, ProjectNO, 1));

            BLL.T_FileList_BLL     fileBLL  = new ERM.BLL.T_FileList_BLL();
            IList <MDL.T_FileList> fileList = fileBLL.FindByParentID(nodeid, ProjectNO);

            foreach (MDL.T_FileList fileMDL in fileList)
            {
                IList <MDL.T_CellAndEFile> cellList2 = GetNodeChildren(fileMDL.FileID, ProjectNO, path, type_flg);
                foreach (MDL.T_CellAndEFile obj in cellList2)
                {
                    cellList.Add(obj);
                }
            }
            return(cellList);
        }
Ejemplo n.º 4
0
        private void menuPasteFile_Click(object sender, EventArgs e)
        {
            TreeNodeEx theNode = treeView1.SelectedNode as TreeNodeEx;

            if (theNode == null)
            {
                return;
            }
            if (CopyFileID != "")
            {
                BLL.T_FileList_BLL fileBLL = new ERM.BLL.T_FileList_BLL();
                //fileBLL.FindByFileID(

                MDL.T_FileList fileMDL   = fileBLL.Find(CopyFileID, Globals.ProjectNO);
                string         OldFileID = fileMDL.FileID;
                string         NewFileID = Guid.NewGuid().ToString().ToUpper();
                fileMDL.FileID     = NewFileID;
                fileMDL.ParentID   = theNode.Name;
                fileMDL.ArchiveID  = "";
                fileMDL.fileStatus = "0";
                fileMDL.wjtm      += "_复制";
                fileMDL.gdwj      += "_复制";
                fileMDL.OrderIndex = fileBLL.GetMaxOrderIndex(theNode.Name, Globals.ProjectNO) + 1;
                fileBLL.Add(fileMDL);

                BLL.T_CellAndEFile_BLL     cellTplBLL  = new ERM.BLL.T_CellAndEFile_BLL();
                IList <MDL.T_CellAndEFile> cellTplList = cellTplBLL.FindByFileID(CopyFileID, Globals.ProjectNO);//cellTplBLL.FindByFileID(CopyFileID, Globals.ProjectNO, 0);

                foreach (MDL.T_CellAndEFile obj in cellTplList)
                {
                    string newCellID = Guid.NewGuid().ToString().ToUpper();
                    string fileName  = Globals.ProjectPath + obj.filepath;

                    if (System.IO.File.Exists(fileName))
                    {
                        System.IO.File.Copy(fileName, fileName.ToUpper().Replace(obj.CellID.ToUpper(), newCellID), true);
                        obj.filepath = obj.filepath.ToUpper().Replace(obj.CellID.ToUpper(), newCellID);
                    }
                    else
                    {
                        obj.filepath = "";
                    }

                    string fileNamePDF = Globals.ProjectPath + obj.fileTreePath;
                    if (System.IO.File.Exists(fileNamePDF))
                    {
                        System.IO.File.Copy(fileNamePDF, fileNamePDF.ToUpper().Replace(obj.CellID.ToUpper(), newCellID), true);
                        obj.fileTreePath = obj.fileTreePath.ToUpper().Replace(obj.CellID.ToUpper(), newCellID);
                    }
                    else
                    {
                        obj.fileTreePath = "";
                    }

                    obj.CellID = newCellID;
                    obj.FileID = NewFileID;

                    cellTplBLL.Add(obj);
                }

                TreeNodeEx newNode = new TreeNodeEx();
                newNode.Name               = fileMDL.FileID;
                newNode.Text               = fileMDL.wjtm;
                newNode.ImageIndex         = (treeFactory.CheckEFileByFileID(newNode.Name, 1) == true) ? 7 : 2;//判断是否有电子文件;
                newNode.SelectedImageIndex = newNode.ImageIndex;
                newNode.NodeValue          = fileMDL.FileID;

                theNode.Nodes.Add(newNode);
            }
            else
            {
                TXMessageBoxExtensions.Info("请先复制!");
            }
        }