Exemple #1
0
        /// <summary>
        /// 电子文件上传
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnUpLoad_Click(object sender, EventArgs e)
        {
            try {
                if (FileUpload1.HasFile)
                {
                    string odocFilePath = string.Concat(Common.Common.EFileStartPath, SingleProjectID, "\\ODOC\\");

                    if (!System.IO.Directory.Exists(Common.Common.EFileStartPath))
                    {
                        System.IO.Directory.CreateDirectory(Common.Common.EFileStartPath);
                    }

                    if (!System.IO.Directory.Exists(odocFilePath))
                    {
                        System.IO.Directory.CreateDirectory(odocFilePath);
                    }

                    string fileNewName = Guid.NewGuid().ToString() + FileUpload1.FileName.Substring(FileUpload1.FileName.LastIndexOf('.'));;

                    //电子文件存放全路径
                    string FileFullPath = odocFilePath + fileNewName;
                    FileUpload1.SaveAs(FileFullPath);  //保存原始文件

                    T_EFile_MDL model = new T_EFile_MDL();

                    model.PageCounts = 0;
                    model.FileListID = Common.ConvertEx.ToInt(FileListID);
                    model.FileType   = 1;
                    model.OrderIndex = GetEfileMaxOrderIndex(FileListID);
                    model.Title      = FileUpload1.FileName.Substring(0, FileUpload1.FileName.LastIndexOf('.'));
                    model.RootPath   = Common.Common.EFileStartPath;
                    model.FilePath   = fileNewName;

                    model.FileType     = 0;
                    model.Status_Text  = "上传成功,当晚批量计算页数!";
                    model.CREATE_DT    = System.DateTime.Now.ToShortDateString();
                    model.CONVERT_FLAG = false;
                    int ArchiveListCellRptID = efileBLL.Add(model);

                    //更新文件级转换标志,等批量转换晚上转
                    T_FileList_MDL fileListMDL = filelistBLL.GetModel(model.FileListID);
                    fileListMDL.CONVERT_FLAG = false;
                    fileListMDL.RootPath     = Common.Common.EFileStartPath;
                    filelistBLL.Update(fileListMDL);
                    BindGridView(AspNetPager.CurrentPageIndex);

                    PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_EFile;key=", ArchiveListCellRptID,
                                                                                                ";SingleProjectID=", fileListMDL.SingleProjectID, ";FileListID=", model.FileListID, ";Title=", model.Title, "'案卷补录"));
                }
            } catch (Exception ex) {
                Common.LogUtil.Debug(this, "补卷-电子文件上传错误", ex);
            }
        }
Exemple #2
0
        private void UpdateFile(string singleProjectID, string fileListID, string newFileName, string oldFileName)
        {
            T_EFile_MDL model = new T_EFile_MDL();

            model.PageCounts = 0;// PDFcount;
            model.FileListID = Common.ConvertEx.ToInt(fileListID);

            model.FileType   = 1;
            model.OrderIndex = GetEfileMaxOrderIndex(fileListID);

            model.Title    = oldFileName.Substring(0, oldFileName.LastIndexOf('.'));
            model.RootPath = Common.Common.EFileStartPath;//记信根目录即可
            model.FilePath = newFileName;

            model.FileType     = 0;
            model.Status_Text  = "上传成功,当晚批量计算页数!";
            model.CREATE_DT    = System.DateTime.Now.ToShortDateString();
            model.CONVERT_FLAG = false;

            T_EFile_BLL bll = new T_EFile_BLL();
            int         archiveListCellRptID = bll.Add(model);

            //更新文件级转换标志,等批量转换晚上转
            T_FileList_MDL fileListMDL = fileListBLL.GetModel(model.FileListID);

            fileListMDL.CONVERT_FLAG = false;
            fileListMDL.RootPath     = Common.Common.EFileStartPath;
            fileListMDL.Version      = PublicModel.getFileVersion(fileListMDL.SingleProjectID.ToString());
            fileListBLL.Update(fileListMDL);

            BLL.T_Other_BLL otherBLL = new DigiPower.Onlinecol.Standard.BLL.T_Other_BLL();
            otherBLL.UpdateArchiveStatus(model.FileListID.ToString(), 10, "0");

            PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_EFile;key=", archiveListCellRptID,
                                                                                        ";SingleProjectID=", singleProjectID, ";FileListID=", model.FileListID, ";Title=", model.Title));
        }