Exemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(ERM.MDL.T_FileList model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update FileRecording_Templet set ");
            strSql.Append("cjdag='" + model.cjdag + "',");
            strSql.Append("datawindow_id='" + model.datawindow_id + "',");
            strSql.Append("extension1='" + model.extension1 + "',");
            strSql.Append("extension2='" + model.extension2 + "',");
            strSql.Append("extension3='" + model.extension3 + "',");
            strSql.Append("gclx='" + model.gclx + "',");
            strSql.Append("gdwj='" + model.gdwj + "',");
            strSql.Append("id='" + model.id + "',");
            strSql.Append("isvisible=" + model.isvisible + ",");
            strSql.Append("jldw='" + model.jldw + "',");
            strSql.Append("jsdw='" + model.jsdw + "',");
            strSql.Append("OrderIndex=" + model.OrderIndex + ",");
            strSql.Append("ProjectNO='" + model.ProjectNO + "',");
            strSql.Append("pTreePath='" + model.pTreePath + "',");
            strSql.Append("selected=" + model.selected + ",");
            strSql.Append("sgdw='" + model.sgdw + "',");
            strSql.Append("sjdw='" + model.sjdw + "',");
            strSql.Append("table_name='" + model.table_name + "',");
            strSql.Append("table_standerd='" + model.table_standerd + "',");
            strSql.Append("TreePath='" + model.TreePath + "',");
            strSql.Append("wjmj='" + model.wjmj + "',");
            strSql.Append("zrr='" + model.zrr + "'");
            strSql.Append(" where id='" + model.id + "' and ProjectNO='" + model.ProjectNO + "' ");
            DbHelperOleDb.ExecuteSql(strSql.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 用来被查找子窗口调用、进行查询的具体方法
        /// </summary>
        public string DoFind(string nodeid, string codeno, string title, bool check1, bool check2)
        {
            string ret = nodeid;

            if (dsFildResult == null || dsFildResult.Count <= 0 || findKey == "" || findKey != title)
            {
                dsFildResult = treesData.DoFind(nodeid.Trim(','), MyCommon.ToSqlString(title), MyCommon.ToSqlString(codeno), check1, check2, Globals.ProjectNO);
                findKey      = title;
            }
            if (dsFildResult == null || dsFildResult.Count <= 0)
            {
                ret = "";
                TXMessageBoxExtensions.Info("没有找到相关资料!");
            }
            else
            {
                MDL.T_FileList obj = new ERM.MDL.T_FileList();
                if (dsFildResult.Count > 0)
                {
                    obj = dsFildResult[0];
                    dsFildResult.RemoveAt(0);
                    ExpendParentNode(obj);
                }
            }
            return(ret);
        }
Exemplo n.º 3
0
        /// 用递归的方法读取树
        /// </summary>
        /// <param name="treeView">需要把数据绑定到的TreeView控件</param>
        /// <param name="tableName">树的数据所在的表</param>
        public void GetTree(TreeView treeView, string fileRecording_templet, string cell_tempet, bool withImage, string projectNo, bool IsAll)
        {
            treeView.Nodes.Clear();
            ds = vars.GetTrees(true, Globals.ProjectNO);
            DataView dataView = new DataView(ds.Tables[0]);

            dataView.RowFilter = "id='01'";
            if (dataView.Count == 0)
            {
                return;
            }
            DataRowView tRow = dataView[0];

            ERM.MDL.T_FileList M_FileRecording_Templet = this.Command_GetFile(tRow);//获取文件对象模型
            TreeNodeEx         node = new TreeNodeEx();

            node.Name    = M_FileRecording_Templet.id;                        //节点唯一ID,用来检索
            node.Text    = M_FileRecording_Templet.gdwj;                      //标题
            node.Tag     = M_FileRecording_Templet;                           //是否最后一个节点,范例路径,是否用户定义表格,附件
            node.Checked = M_FileRecording_Templet.isvisible == 1?true:false; //是否可见
            if (withImage)
            {
                node.ImageIndex         = 0; //0为根目录图片号
                node.SelectedImageIndex = 0; //0为根目录图片号
            }
            treeView.BeginUpdate();
            treeView.Nodes.Add(node);
            LoadChildNodes(node, node.Name, withImage, IsAll);
            node.IsFirstExpand = false;
            treeView.EndUpdate();
            treeView.Nodes[0].Expand();
        }
Exemplo n.º 4
0
        private void AddNewNode(string Action, string txtLocalPath, string StrTitle)
        {
            TreeNodeEx theNode = (TreeNodeEx)treeView1.SelectedNode;

            int    orderindex = (new BLL.T_CellAndEFile_BLL()).GetMaxOrderIndex(theNode.Name, Globals.ProjectNO);//treesData.GetNextIndex(theNode.Name, Globals.ProjectNO);
            string ParentID   = theNode.Name;
            string Filepath   = txtLocalPath;
            string Title      = StrTitle;
            string ProjectNO  = Globals.ProjectNO;

            fileModel            = new ERM.MDL.T_FileList();
            fileModel.gdwj       = Title;
            fileModel.wjtm       = Title;
            fileModel.FileID     = Guid.NewGuid().ToString();
            fileModel.ParentID   = ParentID;
            fileModel.ProjectNO  = ProjectNO;
            fileModel.OrderIndex = (new BLL.T_FileList_BLL()).GetMaxOrderIndex(ParentID, Globals.ProjectNO) + 1;
            fileModel.isvisible  = 1;
            fileModel.fileStatus = "0";
            fileModel.FL         = 0;

            (new BLL.T_FileList_BLL()).Add(fileModel);

            MDL.T_CellAndEFile cellMode = new ERM.MDL.T_CellAndEFile();
            cellMode.CellID = Guid.NewGuid().ToString();

            if (!System.IO.File.Exists(Filepath))
            {
                TXMessageBoxExtensions.Info("文件不存在!");
                return;
            }
            System.IO.File.Copy(Filepath, Globals.ProjectPath + "ODOC\\" + cellMode.CellID + ".cll", true);

            cellMode.filepath = "ODOC\\" + cellMode.CellID + ".cll";

            cellMode.orderindex = orderindex + 1;
            cellMode.FileID     = fileModel.FileID;
            cellMode.isvisible  = 1;
            cellMode.EFileType  = true;//电子文件类型,0=false 系统的,-1=true 用户上传的
            cellMode.ProjectNO  = ProjectNO;
            cellMode.title      = Title;
            cellBLL.Add(cellMode);

            TreeNodeEx newNode = new TreeNodeEx();

            newNode.Name               = cellMode.FileID;
            newNode.ImageIndex         = 2;
            newNode.SelectedImageIndex = 2;
            newNode.Text               = cellMode.title;

            theNode.Nodes.Add(newNode);
            theNode.Expand();
        }
Exemplo n.º 5
0
 /// <summary>
 /// 修改文件登记
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int EditFileRegist(ERM.MDL.T_FileList model)
 {
     try
     {
         BLL.T_FileList_BLL fileBLL = new ERM.BLL.T_FileList_BLL();
         fileBLL.Update(model);
         return(1);
     }
     catch
     {
         return(0);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ERM.MDL.T_FileList Find(string id, string ProjectNO)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  ");
            strSql.Append(" cjdag,datawindow_id,extension1,extension2,extension3,gclx,gdwj,id,isvisible,jldw,jsdw,OrderIndex,ProjectNO,pTreePath,selected,sgdw,sjdw,table_name,table_standerd,TreePath,wjmj,zrr ");
            strSql.Append(" from FileRecording_Templet ");
            strSql.Append(" where id='" + id + "' and ProjectNO='" + ProjectNO + "' ");
            ERM.MDL.T_FileList model = new ERM.MDL.T_FileList();
            DataSet            ds    = DbHelperOleDb.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.cjdag         = ds.Tables[0].Rows[0]["cjdag"].ToString();
                model.datawindow_id = ds.Tables[0].Rows[0]["datawindow_id"].ToString();
                model.extension1    = ds.Tables[0].Rows[0]["extension1"].ToString();
                model.extension2    = ds.Tables[0].Rows[0]["extension2"].ToString();
                model.extension3    = ds.Tables[0].Rows[0]["extension3"].ToString();
                model.gclx          = ds.Tables[0].Rows[0]["gclx"].ToString();
                model.gdwj          = ds.Tables[0].Rows[0]["gdwj"].ToString();
                model.id            = ds.Tables[0].Rows[0]["id"].ToString();
                if (ds.Tables[0].Rows[0]["isvisible"].ToString() != "")
                {
                    model.isvisible = int.Parse(ds.Tables[0].Rows[0]["isvisible"].ToString());
                }
                model.jldw = ds.Tables[0].Rows[0]["jldw"].ToString();
                model.jsdw = ds.Tables[0].Rows[0]["jsdw"].ToString();
                if (ds.Tables[0].Rows[0]["OrderIndex"].ToString() != "")
                {
                    model.OrderIndex = int.Parse(ds.Tables[0].Rows[0]["OrderIndex"].ToString());
                }
                model.ProjectNO = ds.Tables[0].Rows[0]["ProjectNO"].ToString();
                model.pTreePath = ds.Tables[0].Rows[0]["pTreePath"].ToString();
                if (ds.Tables[0].Rows[0]["selected"].ToString() != "")
                {
                    model.selected = int.Parse(ds.Tables[0].Rows[0]["selected"].ToString());
                }
                model.sgdw           = ds.Tables[0].Rows[0]["sgdw"].ToString();
                model.sjdw           = ds.Tables[0].Rows[0]["sjdw"].ToString();
                model.table_name     = ds.Tables[0].Rows[0]["table_name"].ToString();
                model.table_standerd = ds.Tables[0].Rows[0]["table_standerd"].ToString();
                model.TreePath       = ds.Tables[0].Rows[0]["TreePath"].ToString();
                model.wjmj           = ds.Tables[0].Rows[0]["wjmj"].ToString();
                model.zrr            = ds.Tables[0].Rows[0]["zrr"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(ERM.MDL.T_FileList model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update T_FileList set ");
            strSql.Append("bgqx='" + model.bgqx + "',");
            strSql.Append("bz='" + model.bz + "',");
            strSql.Append("bzdw='" + model.bzdw + "',");
            strSql.Append("CreateDate='" + model.CreateDate + "',");
            strSql.Append("CreateDate2='" + model.CreateDate2 + "',");
            strSql.Append("dw='" + model.dw + "',");
            strSql.Append("fbl='" + model.fbl + "',");
            strSql.Append("FileID='" + model.FileID + "',");
            strSql.Append("filepath='" + model.filepath + "',");
            strSql.Append("fileStatus='" + model.fileStatus + "',");
            strSql.Append("gg='" + model.gg + "',");
            strSql.Append("mj='" + model.mj + "',");
            strSql.Append("parentid='" + model.parentid + "',");
            strSql.Append("ProjectNO='" + model.ProjectNO + "',");
            strSql.Append("psdd='" + model.psdd + "',");
            strSql.Append("pssj='" + model.pssj + "',");
            strSql.Append("psz='" + model.psz + "',");
            strSql.Append("PtreePath='" + model.PtreePath + "',");
            strSql.Append("sb='" + model.sb + "',");
            strSql.Append("sl=" + model.sl + ",");
            strSql.Append("TreePath='" + model.TreePath + "',");
            strSql.Append("wh='" + model.wh + "',");
            strSql.Append("wjbsm='" + model.wjbsm + "',");
            strSql.Append("wjcj='" + model.wjcj + "',");
            strSql.Append("wjdx='" + model.wjdx + "',");
            strSql.Append("wjgbdm='" + model.wjgbdm + "',");
            strSql.Append("wjgs='" + model.wjgs + "',");
            strSql.Append("wjlxdm='" + model.wjlxdm + "',");
            strSql.Append("wjmc='" + model.wjmc + "',");
            strSql.Append("wjtm='" + model.wjtm + "',");
            strSql.Append("xjpp='" + model.xjpp + "',");
            strSql.Append("xjxh='" + model.xjxh + "',");
            strSql.Append("zrr='" + model.zrr + "',");
            strSql.Append("ztlx='" + model.ztlx + "',");
            strSql.Append("dpz='" + model.dpz + "',");
            strSql.Append("dtz='" + model.dtz + "',");
            strSql.Append("tzz='" + model.tzz + "',");
            strSql.Append("wzz='" + model.wzz + "',");
            strSql.Append("zpz='" + model.zpz + "'");
            strSql.Append(" where TreePath='" + model.TreePath + "' ");
            DbHelperOleDb.ExecuteSql(strSql.ToString());
        }
Exemplo n.º 8
0
        /// <summary>
        /// 打印调的方法
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="showmsg"></param>
        //public void Test(DataTable dt, bool showmsg)
        //{
        //    if (Globals.SH == 0)
        //    {
        //        TXMessageBoxExtensions.Info("您没有提交权限!");
        //        return;
        //    }
        //    if (dt.Rows.Count > 0)
        //    {
        //        string CurPrinterName = PrinterOperate.GetDefaultPrinterName();
        //        if (CurPrinterName != PrinterOperate.UsePrinterName)//如果当前打印机不是EASYPDF就要设置
        //        {
        //            PrinterOperate.SetPrinter(PrinterOperate.UsePrinterName);
        //        }
        //        frmRefreshHead frm = new frmRefreshHead(Mydel, dt);
        //        frm.SetTitle = "提交中…";
        //        frm.SetMsg = "正在处理数据,请稍候…";
        //        if (frm.ShowDialog() != DialogResult.OK)
        //        {
        //            if (!string.IsNullOrEmpty(frm.ErrorMsg))
        //            {
        //                TXMessageBoxExtensions.Info(frm.ErrorMsg);
        //            }
        //        }
        //        else
        //        {
        //            if (showmsg)
        //                TXMessageBoxExtensions.Info("提交完成!");
        //        }
        //        if (CurPrinterName != PrinterOperate.UsePrinterName)
        //        {
        //            PrinterOperate.SetPrinter(CurPrinterName);
        //        }//设置打印机后,设回来
        //    }
        //    else
        //    {
        //        TXMessageBoxExtensions.Info("没有找到需要提交的文件!");
        //    }
        //}
        /// <summary>
        /// 新建目录,0为同级,1为子级
        /// </summary>
        /// <param name="level">0为同级,1为子级</param>
        private void NewFloder(int level)
        {
            try
            {
                TreeNodeEx parentNode = (TreeNodeEx)treeView1.SelectedNode;
                if (parentNode == null)
                {
                    return;
                }
                TreeNodeEx tempNode = null;//传个空值用
                frmMainGetTempletFromStandard frm = new frmMainGetTempletFromStandard(tempNode, false, parentNode);
                DialogResult ret = frm.ShowDialog();
                if (ret == DialogResult.OK)
                {
                    string Title      = MyCommon.ToSqlString(frm.StrTitle.Trim());
                    int    orderindex = (new BLL.T_FileList_BLL()).GetMaxOrderIndex(parentNode.Name, Globals.ProjectNO);
                    string ProjectNO  = Globals.ProjectNO;

                    fileModel            = new ERM.MDL.T_FileList();
                    fileModel.gdwj       = Title;
                    fileModel.wjtm       = Title;
                    fileModel.FileID     = Guid.NewGuid().ToString();
                    fileModel.ParentID   = parentNode.Name;
                    fileModel.ProjectNO  = ProjectNO;
                    fileModel.OrderIndex = orderindex + 1;
                    fileModel.fileStatus = "0";
                    fileModel.FL         = 0;

                    BLL.T_FileList_BLL fileBLL = new ERM.BLL.T_FileList_BLL();
                    fileModel.isvisible = 0;
                    fileBLL.Add(fileModel);

                    TreeNodeEx newNode = new TreeNodeEx();
                    newNode.Name               = fileModel.FileID;
                    newNode.Text               = fileModel.wjtm;
                    newNode.ImageIndex         = 1;
                    newNode.SelectedImageIndex = 1;
                    parentNode.Nodes.Add(newNode);
                }
            }
            catch
            {
            }
        }
Exemplo n.º 9
0
 private ERM.MDL.T_FileList Command_GetFile(DataRowView tRow)
 {
     ERM.MDL.T_FileList M_FileRecording_Templet = new ERM.MDL.T_FileList();
     M_FileRecording_Templet.id         = tRow["id"].ToString();               //节点唯一ID
     M_FileRecording_Templet.gdwj       = tRow["title"].ToString();            //标题
     M_FileRecording_Templet.zrr        = tRow["zrr"].ToString();              //责任人
     M_FileRecording_Templet.OrderIndex = Convert.ToInt32(tRow["orderindex"]); //顺序号
     M_FileRecording_Templet.isvisible  = Convert.ToInt16(tRow["isvisible"]);  //是否可见
     M_FileRecording_Templet.gclx       = tRow["gclx"].ToString();
     M_FileRecording_Templet.jsdw       = tRow["jsdw"].ToString();
     M_FileRecording_Templet.jldw       = tRow["jldw"].ToString();
     M_FileRecording_Templet.sgdw       = tRow["sgdw"].ToString();
     M_FileRecording_Templet.sjdw       = tRow["sjdw"].ToString();
     M_FileRecording_Templet.wjmj       = tRow["wjmj"].ToString();
     M_FileRecording_Templet.cjdag      = tRow["cjdag"].ToString();
     M_FileRecording_Templet.table_name = tRow["table_name"].ToString();
     M_FileRecording_Templet.ProjectNO  = CPROJECTNO;
     return(M_FileRecording_Templet);
 }
Exemplo n.º 10
0
        /// <summary>
        /// 按案卷上报
        /// </summary>
        /// <returns></returns>
        private bool?ConfirmSplitForfrmArchive()
        {
            if (txtLoc.Text == "")
            {
                TXMessageBoxExtensions.Info("请选择导出文件的存储路径!");
                txtLoc.Focus();
                return(null);
            }
            string destFilename = Globals.Projectname;

            destFolder = txtLoc.Text;

            string dest_temp = Path.GetDirectoryName(txtLoc.Text);

            if (!Directory.Exists(dest_temp))
            {
                TXMessageBoxExtensions.Info("存储的路径不存在!");
                return(null);
            }

            double             projectSize = Convert.ToDouble(DirectoryInfoCommon.GetDirectorySpace(Application.StartupPath + "\\Project\\" + Globals.ProjectNO) / Convert.ToDouble(1024 * 1024 * 1024));
            ReadWriteAppConfig config      = new ReadWriteAppConfig();

            if (config.Read("Upload_ProjectSize") == "")
            {
                config.Write("Upload_ProjectSize", "4");
            }
            string upload_size = config.Read("Upload_ProjectSize");

            if (projectSize > Convert.ToDouble(upload_size))
            {
                DialogResult dresult = TXMessageBoxExtensions.Question("上报工程大于" + upload_size + "G,当前工程大小为:" + System.Math.Round(projectSize, 2) + "G \r\n\n 【温馨提示:工程太大,生成移交文件需要比较长得时间】  \r\n\n 是否继续生成移交?");
                if (dresult != DialogResult.OK)
                {
                    return(null);
                }
            }
            else if (MyCommon.CheckDisk(destFolder) < projectSize)
            {
                //硬盘空间不足
                TXMessageBoxExtensions.Info("上报工程大小为:" + System.Math.Round(projectSize, 2) + "G 保存目录硬盘空间不足,无法生成! \r\n 【温馨提示:请选择比较空闲的盘符】");
                txtLoc.Focus();
                return(null);
            }

            tempFullName = dest_temp + "\\" + Guid.NewGuid().ToString();
            if (System.IO.Directory.Exists(tempFullName))
            {
                MyCommon.DeleteAndCreateEmptyDirectory(tempFullName, false);
            }
            MyCommon.DeleteAndCreateEmptyDirectory(tempFullName);

            MyCommon.DeleteAndCreateEmptyDirectory(destFolder, false);
            MyCommon.DeleteAndCreateEmptyDirectory(destFolder, true);

            panelBottom.Visible = true;
            panelTop.Visible    = false;
            Application.DoEvents();
            butClose.Enabled = false;
            ERM.CBLL.CreateSip projectFactory = new ERM.CBLL.CreateSip(Globals.ProjectNO);
            //DataSet dsFinalArchive = projectFactory.GetListArchive(Globals.ProjectNO, "");
            DataSet dsFinalArchive = new Archive().pb_setXmlInfo();

            if (dsFinalArchive.Tables.Count < 1 || dsFinalArchive.Tables[0].Rows.Count < 1)
            {
                TXMessageBoxExtensions.Info("没有任何案卷可以移交!");
                return(false);
            }
            int  count_FinalArchive = dsFinalArchive.Tables[0].Rows.Count;
            bool checkfile_flag     = true;

            for (int i = 0; i < count_FinalArchive; i++)
            {
                BLL.T_FileList_BLL     fileBLL  = new ERM.BLL.T_FileList_BLL();
                IList <MDL.T_FileList> fileList = fileBLL.FindByArchiveID2(dsFinalArchive.Tables[0].Rows[i]["案卷ID"].ToString(), Globals.ProjectNO);
                foreach (MDL.T_FileList obj in fileList)
                {
                    if (obj.selected == 1 || obj.filepath == null || obj.filepath == "")
                    {
                        ConvertAllEFileToPDF(obj.FileID);
                    }
                    else
                    {
                        string tFilePath = obj.filepath.Replace("MPDF\\", "");
                        string sourMfile = Globals.ProjectPath + obj.filepath;
                        if (!System.IO.File.Exists(sourMfile))
                        {
                            ConvertAllEFileToPDF(obj.FileID);
                        }
                    }
                    IList <MDL.T_CellAndEFile> cellList   = (new ERM.BLL.T_CellAndEFile_BLL()).FindByGdFileID(obj.FileID, Globals.ProjectNO);
                    ERM.MDL.T_FileList         file_model = (new ERM.BLL.T_FileList_BLL()).Find(obj.FileID, Globals.ProjectNO);
                    if ((file_model.filepath == null || file_model.filepath == "") &&
                        cellList.Count > 0)
                    {
                        TXMessageBoxExtensions.Info("提示:文件【" + obj.gdwj + "】电子文件信息有误!无法移交,请审查");
                        checkfile_flag = false;
                        break;
                    }
                }
                if (!checkfile_flag)
                {
                    break;
                }
            }
            if (!checkfile_flag)
            {
                return(false);
            }

            progressBar2.Maximum = count_FinalArchive;
            progressBar2.Minimum = 0;
            progressBar2.MarqueeAnimationSpeed = 1000;
            progressBar2.Step = 1;
            lblMsg.Text       = "正在输出元数据信息...";
            Application.DoEvents();

            GetListArchiveXML(projectFactory, tempFullName);
            try
            {
                for (int i = 0; i < count_FinalArchive; i++)
                {
                    if (!Directory.Exists(tempFullName))
                    {
                        MyCommon.DeleteAndCreateEmptyDirectory(tempFullName, true);
                    }
                    //20120530 屏蔽XML文件
                    GetProjectXML(projectFactory, tempFullName);

                    if (Convert.ToBoolean(Properties.Settings.Default.SipIncludeDoc))
                    {
                        //20120530 屏蔽XML文件
                        GetListArchiveXMLEx(dsFinalArchive.Tables[0].Rows[i]["案卷ID"].ToString(), tempFullName);
                        GetDocumentXMLEx(dsFinalArchive.Tables[0].Rows[i]["案卷ID"].ToString(), tempFullName);

                        BLL.T_FileList_BLL     fileBLL  = new ERM.BLL.T_FileList_BLL();
                        IList <MDL.T_FileList> fileList = fileBLL.FindByArchiveID2(dsFinalArchive.Tables[0].Rows[i]["案卷ID"].ToString(), Globals.ProjectNO);
                        foreach (MDL.T_FileList obj in fileList)
                        {
                            //20120530 屏蔽XML文件
                            //getDocModel(obj);
                            getDocModel_NEW(obj, tempFullName);
                        }
                    }
                    lblMsg.Text = "正在对数据包进行封装...";
                    Application.DoEvents();

                    if (System.IO.File.Exists(tempFullName + "\\index.dat"))//Application.StartupPath + "\\temp\\index.dat"
                    {
                        System.IO.File.Move(tempFullName + "\\index.dat", destFolder + "\\index.dat");

                        string gcInfo  = System.IO.File.ReadAllText(tempFullName + "\\a#sgwj_gc.xml", Encoding.GetEncoding("gb2312"));
                        string docList = System.IO.File.ReadAllText(destFolder + "\\index.dat");
                        gcInfo = gcInfo.Replace("</项目工程信息>", "<ArchiveFileList>" + docList + "</ArchiveFileList></项目工程信息>");
                        System.IO.File.WriteAllText(destFolder + "\\index.dat", gcInfo, Encoding.GetEncoding("gb2312"));
                    }

                    SevenZip.SevenZipCompressor.SetLibraryPath(Application.StartupPath + "\\7z.dll");
                    SevenZip.SevenZipCompressor tmp = new SevenZip.SevenZipCompressor();
                    {
                        tmp.ArchiveFormat = SevenZip.OutArchiveFormat.Zip;
                        tmp.CompressDirectory(tempFullName, destFolder + "\\" + dsFinalArchive.Tables[0].Rows[i]["案卷ID"].ToString() + ".sip");
                    }
                    MyCommon.DeleteAndCreateEmptyDirectory(tempFullName, false);
                    progressBar2.Value = progressBar2.Value + 1;
                }
            }
            catch (Exception ex)
            {
                MyCommon.DeleteAndCreateEmptyDirectory(tempFullName, false);
                TXMessageBoxExtensions.Info("封装数据时发生意外错误!错误002");
                MyCommon.WriteLog("生成移交文件时失败!错误信息:" + ex.Message);
                return(false);
            }
            butClose.Text    = "关闭";
            butClose.Enabled = true;
            TXMessageBoxExtensions.Info("已经成功生成上报文件!");
            return(true);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(ERM.MDL.T_FileList model)
        {
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();

            if (model.cjdag != null)
            {
                strSql1.Append("cjdag,");
                strSql2.Append("'" + model.cjdag + "',");
            }
            if (model.datawindow_id != null)
            {
                strSql1.Append("datawindow_id,");
                strSql2.Append("'" + model.datawindow_id + "',");
            }
            if (model.extension1 != null)
            {
                strSql1.Append("extension1,");
                strSql2.Append("'" + model.extension1 + "',");
            }
            if (model.extension2 != null)
            {
                strSql1.Append("extension2,");
                strSql2.Append("'" + model.extension2 + "',");
            }
            if (model.extension3 != null)
            {
                strSql1.Append("extension3,");
                strSql2.Append("'" + model.extension3 + "',");
            }
            if (model.gclx != null)
            {
                strSql1.Append("gclx,");
                strSql2.Append("'" + model.gclx + "',");
            }
            if (model.gdwj != null)
            {
                strSql1.Append("gdwj,");
                strSql2.Append("'" + model.gdwj + "',");
            }
            if (model.id != null)
            {
                strSql1.Append("id,");
                strSql2.Append("'" + model.id + "',");
            }
            if (model.isvisible != null)
            {
                strSql1.Append("isvisible,");
                strSql2.Append("" + model.isvisible + ",");
            }
            if (model.jldw != null)
            {
                strSql1.Append("jldw,");
                strSql2.Append("'" + model.jldw + "',");
            }
            if (model.jsdw != null)
            {
                strSql1.Append("jsdw,");
                strSql2.Append("'" + model.jsdw + "',");
            }
            if (model.OrderIndex != null)
            {
                strSql1.Append("OrderIndex,");
                strSql2.Append("" + model.OrderIndex + ",");
            }
            if (model.ProjectNO != null)
            {
                strSql1.Append("ProjectNO,");
                strSql2.Append("'" + model.ProjectNO + "',");
            }
            if (model.pTreePath != null)
            {
                strSql1.Append("pTreePath,");
                strSql2.Append("'" + model.pTreePath + "',");
            }
            if (model.selected != null)
            {
                strSql1.Append("selected,");
                strSql2.Append("" + model.selected + ",");
            }
            if (model.sgdw != null)
            {
                strSql1.Append("sgdw,");
                strSql2.Append("'" + model.sgdw + "',");
            }
            if (model.sjdw != null)
            {
                strSql1.Append("sjdw,");
                strSql2.Append("'" + model.sjdw + "',");
            }
            if (model.table_name != null)
            {
                strSql1.Append("table_name,");
                strSql2.Append("'" + model.table_name + "',");
            }
            if (model.table_standerd != null)
            {
                strSql1.Append("table_standerd,");
                strSql2.Append("'" + model.table_standerd + "',");
            }
            if (model.TreePath != null)
            {
                strSql1.Append("TreePath,");
                strSql2.Append("'" + model.TreePath + "',");
            }
            if (model.wjmj != null)
            {
                strSql1.Append("wjmj,");
                strSql2.Append("'" + model.wjmj + "',");
            }
            if (model.zrr != null)
            {
                strSql1.Append("zrr,");
                strSql2.Append("'" + model.zrr + "',");
            }
            strSql.Append("insert into FileRecording_Templet(");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            DbHelperOleDb.ExecuteSql(strSql.ToString());
        }
Exemplo n.º 12
0
        /// <summary>
        /// 获取树的节点,跟其他方法合用
        /// </summary>
        /// <param name="nodes">TreeNodeCollection</param>
        /// <param name="nodeID">要查询的节点</param>
        private void LoadChildNodes(TreeNodeEx pParentNode, string parentID, bool withImage, bool IsAll)
        {
            if (ds == null)
            {
                return;
            }
            DataView dataView = new DataView(ds.Tables[0]);

            dataView.RowFilter = "ParentID='" + parentID + "'";
            TreeNodeEx[] tNodes      = new TreeNodeEx[dataView.Count];
            int          tNodesCount = 0;

            foreach (DataRowView drv in dataView)
            {
                TreeNodeEx node = new TreeNodeEx();
                if (this.Command_IsSelectFile(Convert.ToInt32(drv["imageindex"])))
                {
                    ERM.MDL.T_FileList M_FileRecording_Templet = this.Command_GetFile(drv); //获取文件对象模型
                    node.Name    = M_FileRecording_Templet.id;                              //节点唯一ID,用来检索
                    node.Text    = M_FileRecording_Templet.gdwj;                            //标题
                    node.Tag     = M_FileRecording_Templet;                                 //是否最后一个节点,范例路径,是否用户定义表格,附件
                    node.Checked = M_FileRecording_Templet.isvisible == 1 ? true : false;   //是否可见
                }
                else if (this.Command_IsSelectModel(Convert.ToInt32(drv["imageindex"])))
                {
                    ERM.MDL.T_CellAndEFile M_Cell_Templet = this.Command_GetModel(drv); //获取文件对象模型
                    node.Name      = M_Cell_Templet.id;                                 //节点唯一ID,用来检索
                    node.Text      = M_Cell_Templet.title;                              //标题
                    node.Tag       = M_Cell_Templet;                                    //是否最后一个节点,范例路径,是否用户定义表格,附件
                    node.Checked   = M_Cell_Templet.isvisible == 1 ? true : false;      //是否可见
                    node.NodeKey   = M_Cell_Templet.codeno;
                    node.NodeValue = M_Cell_Templet.filepath;
                }
                else if (this.Command_IsSelectRoot(Convert.ToInt32(drv["imageindex"])))
                {
                    ERM.MDL.T_FileList M_FileRecording_Templet = this.Command_GetFile(drv); //获取文件对象模型
                    node.Name    = M_FileRecording_Templet.id;                              //节点唯一ID,用来检索
                    node.Text    = M_FileRecording_Templet.gdwj;                            //标题
                    node.Tag     = M_FileRecording_Templet;                                 //是否最后一个节点,范例路径,是否用户定义表格,附件
                    node.Checked = M_FileRecording_Templet.isvisible == 1 ? true : false;   //是否可见
                }
                if (withImage)
                {
                    node.ImageIndex         = Convert.ToInt32(drv["imageindex"]);
                    node.SelectedImageIndex = Convert.ToInt32(drv["imageindex"]);
                }
                node.Text = drv["title"].ToString();
                if (node.ImageIndex != 2)
                {
                    if (IsAll)
                    {
                        LoadChildNodes(node, node.Name, true, true);
                        node.IsFirstExpand = false;
                    }
                    else
                    {
                        TreeNodeEx node1 = new TreeNodeEx();
                        node1.Name = "临时数据";
                        node1.Text = "临时数据";
                        node.Nodes.Add(node1);
                    }
                }
                tNodes.SetValue(node, tNodesCount++);
            }
            if (80 < tNodes.Length)  //如果其含有的子节点数大于80个,启动BeginUpdate方法
            {
                pParentNode.TreeView.BeginUpdate();
                pParentNode.Nodes.AddRange(tNodes);
                pParentNode.TreeView.EndUpdate();
            }
            else
            {
                pParentNode.Nodes.AddRange(tNodes);
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(ERM.MDL.T_FileList model)
        {
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();

            if (model.bgqx != null)
            {
                strSql1.Append("bgqx,");
                strSql2.Append("'" + model.bgqx + "',");
            }
            if (model.bz != null)
            {
                strSql1.Append("bz,");
                strSql2.Append("'" + model.bz + "',");
            }
            if (model.bzdw != null)
            {
                strSql1.Append("bzdw,");
                strSql2.Append("'" + model.bzdw + "',");
            }
            if (model.CreateDate != null)
            {
                strSql1.Append("CreateDate,");
                strSql2.Append("'" + model.CreateDate + "',");
            }
            if (model.CreateDate2 != null)
            {
                strSql1.Append("CreateDate2,");
                strSql2.Append("'" + model.CreateDate2 + "',");
            }
            if (model.dw != null)
            {
                strSql1.Append("dw,");
                strSql2.Append("'" + model.dw + "',");
            }
            if (model.fbl != null)
            {
                strSql1.Append("fbl,");
                strSql2.Append("'" + model.fbl + "',");
            }
            if (model.FileID != null)
            {
                strSql1.Append("FileID,");
                strSql2.Append("'" + model.FileID + "',");
            }
            if (model.filepath != null)
            {
                strSql1.Append("filepath,");
                strSql2.Append("'" + model.filepath + "',");
            }
            if (model.fileStatus != null)
            {
                strSql1.Append("fileStatus,");
                strSql2.Append("'" + model.fileStatus + "',");
            }
            if (model.gg != null)
            {
                strSql1.Append("gg,");
                strSql2.Append("'" + model.gg + "',");
            }
            if (model.mj != null)
            {
                strSql1.Append("mj,");
                strSql2.Append("'" + model.mj + "',");
            }
            if (model.parentid != null)
            {
                strSql1.Append("parentid,");
                strSql2.Append("'" + model.parentid + "',");
            }
            if (model.ProjectNO != null)
            {
                strSql1.Append("ProjectNO,");
                strSql2.Append("'" + model.ProjectNO + "',");
            }
            if (model.psdd != null)
            {
                strSql1.Append("psdd,");
                strSql2.Append("'" + model.psdd + "',");
            }
            if (model.pssj != null)
            {
                strSql1.Append("pssj,");
                strSql2.Append("'" + model.pssj + "',");
            }
            if (model.psz != null)
            {
                strSql1.Append("psz,");
                strSql2.Append("'" + model.psz + "',");
            }
            if (model.PtreePath != null)
            {
                strSql1.Append("PtreePath,");
                strSql2.Append("'" + model.PtreePath + "',");
            }
            if (model.sb != null)
            {
                strSql1.Append("sb,");
                strSql2.Append("'" + model.sb + "',");
            }
            if (model.sl != null)
            {
                strSql1.Append("sl,");
                strSql2.Append("" + model.sl + ",");
            }
            if (model.TreePath != null)
            {
                strSql1.Append("TreePath,");
                strSql2.Append("'" + model.TreePath + "',");
            }
            if (model.wh != null)
            {
                strSql1.Append("wh,");
                strSql2.Append("'" + model.wh + "',");
            }
            if (model.wjbsm != null)
            {
                strSql1.Append("wjbsm,");
                strSql2.Append("'" + model.wjbsm + "',");
            }
            if (model.wjcj != null)
            {
                strSql1.Append("wjcj,");
                strSql2.Append("'" + model.wjcj + "',");
            }
            if (model.wjdx != null)
            {
                strSql1.Append("wjdx,");
                strSql2.Append("'" + model.wjdx + "',");
            }
            if (model.wjgbdm != null)
            {
                strSql1.Append("wjgbdm,");
                strSql2.Append("'" + model.wjgbdm + "',");
            }
            if (model.wjgs != null)
            {
                strSql1.Append("wjgs,");
                strSql2.Append("'" + model.wjgs + "',");
            }
            if (model.wjlxdm != null)
            {
                strSql1.Append("wjlxdm,");
                strSql2.Append("'" + model.wjlxdm + "',");
            }
            if (model.wjmc != null)
            {
                strSql1.Append("wjmc,");
                strSql2.Append("'" + model.wjmc + "',");
            }
            if (model.wjtm != null)
            {
                strSql1.Append("wjtm,");
                strSql2.Append("'" + model.wjtm + "',");
            }
            if (model.xjpp != null)
            {
                strSql1.Append("xjpp,");
                strSql2.Append("'" + model.xjpp + "',");
            }
            if (model.xjxh != null)
            {
                strSql1.Append("xjxh,");
                strSql2.Append("'" + model.xjxh + "',");
            }
            if (model.zrr != null)
            {
                strSql1.Append("zrr,");
                strSql2.Append("'" + model.zrr + "',");
            }
            if (model.ztlx != null)
            {
                strSql1.Append("ztlx,");
                strSql2.Append("'" + model.ztlx + "',");
            }
            if (model.dpz != null)
            {
                strSql1.Append("dpz,");
                strSql2.Append("'" + model.dpz + "',");
            }
            if (model.dtz != null)
            {
                strSql1.Append("dtz,");
                strSql2.Append("'" + model.dtz + "',");
            }
            if (model.tzz != null)
            {
                strSql1.Append("tzz,");
                strSql2.Append("'" + model.tzz + "',");
            }
            if (model.wzz != null)
            {
                strSql1.Append("wzz,");
                strSql2.Append("'" + model.wzz + "',");
            }
            if (model.zpz != null)
            {
                strSql1.Append("zpz,");
                strSql2.Append("'" + model.zpz + "',");
            }
            strSql.Append("insert into T_FileList(");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            DbHelperOleDb.ExecuteSql(strSql.ToString());
        }
Exemplo n.º 14
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ERM.MDL.T_FileList Find(string FileID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  ");
            strSql.Append(" bgqx,bz,bzdw,CreateDate,CreateDate2,dw,fbl,FileID,filepath,fileStatus,gg,mj,parentid,ProjectNO,psdd,pssj,psz,PtreePath,sb,sl,TreePath,wh,wjbsm,wjcj,wjdx,wjgbdm,wjgs,wjlxdm,wjmc,wjtm,xjpp,xjxh,zrr,ztlx,dpz,dtz,tzz,wzz,zpz ");
            strSql.Append(" from T_FileList ");
            strSql.Append(" where FileID='" + FileID + "' ");
            ERM.MDL.T_FileList model = new ERM.MDL.T_FileList();
            DataSet            ds    = DbHelperOleDb.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.bgqx = ds.Tables[0].Rows[0]["bgqx"].ToString();
                model.bz   = ds.Tables[0].Rows[0]["bz"].ToString();
                model.bzdw = ds.Tables[0].Rows[0]["bzdw"].ToString();
                if (ds.Tables[0].Rows[0]["CreateDate"].ToString() != "")
                {
                    model.CreateDate = DateTime.Parse(ds.Tables[0].Rows[0]["CreateDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CreateDate2"].ToString() != "")
                {
                    model.CreateDate2 = DateTime.Parse(ds.Tables[0].Rows[0]["CreateDate2"].ToString());
                }
                model.dw         = ds.Tables[0].Rows[0]["dw"].ToString();
                model.fbl        = ds.Tables[0].Rows[0]["fbl"].ToString();
                model.FileID     = ds.Tables[0].Rows[0]["FileID"].ToString();
                model.filepath   = ds.Tables[0].Rows[0]["filepath"].ToString();
                model.fileStatus = ds.Tables[0].Rows[0]["fileStatus"].ToString();
                model.gg         = ds.Tables[0].Rows[0]["gg"].ToString();
                model.mj         = ds.Tables[0].Rows[0]["mj"].ToString();
                model.parentid   = ds.Tables[0].Rows[0]["parentid"].ToString();
                model.ProjectNO  = ds.Tables[0].Rows[0]["ProjectNO"].ToString();
                model.psdd       = ds.Tables[0].Rows[0]["psdd"].ToString();
                if (ds.Tables[0].Rows[0]["pssj"].ToString() != "")
                {
                    model.pssj = DateTime.Parse(ds.Tables[0].Rows[0]["pssj"].ToString());
                }
                model.psz       = ds.Tables[0].Rows[0]["psz"].ToString();
                model.PtreePath = ds.Tables[0].Rows[0]["PtreePath"].ToString();
                model.sb        = ds.Tables[0].Rows[0]["sb"].ToString();
                if (ds.Tables[0].Rows[0]["sl"].ToString() != "")
                {
                    model.sl = int.Parse(ds.Tables[0].Rows[0]["sl"].ToString());
                }
                model.TreePath = ds.Tables[0].Rows[0]["TreePath"].ToString();
                model.wh       = ds.Tables[0].Rows[0]["wh"].ToString();
                model.wjbsm    = ds.Tables[0].Rows[0]["wjbsm"].ToString();
                model.wjcj     = ds.Tables[0].Rows[0]["wjcj"].ToString();
                model.wjdx     = ds.Tables[0].Rows[0]["wjdx"].ToString();
                model.wjgbdm   = ds.Tables[0].Rows[0]["wjgbdm"].ToString();
                model.wjgs     = ds.Tables[0].Rows[0]["wjgs"].ToString();
                model.wjlxdm   = ds.Tables[0].Rows[0]["wjlxdm"].ToString();
                model.wjmc     = ds.Tables[0].Rows[0]["wjmc"].ToString();
                model.wjtm     = ds.Tables[0].Rows[0]["wjtm"].ToString();
                model.xjpp     = ds.Tables[0].Rows[0]["xjpp"].ToString();
                model.xjxh     = ds.Tables[0].Rows[0]["xjxh"].ToString();
                model.zrr      = ds.Tables[0].Rows[0]["zrr"].ToString();
                model.ztlx     = ds.Tables[0].Rows[0]["ztlx"].ToString();
                model.dpz      = ds.Tables[0].Rows[0]["dpz"].ToString();
                model.dtz      = ds.Tables[0].Rows[0]["dtz"].ToString();
                model.tzz      = ds.Tables[0].Rows[0]["tzz"].ToString();
                model.wzz      = ds.Tables[0].Rows[0]["wzz"].ToString();
                model.zpz      = ds.Tables[0].Rows[0]["zpz"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }