Ejemplo n.º 1
0
 /// <summary>
 /// 删除过期文件(以天为单位),删除今天以前的压缩文件
 /// </summary>
 /// cais    16.04.28
 /// <param name="compressFile">文件信息</param>
 public void DeleteFileByDate(Models.Sys.FileInfo compressFile)
 {
     if (compressFile.FilePath != null)
     {
         var server = HttpContext.Current.Server;
         DelOverdueZipFile(server.MapPath(compressFile.FilePath), server.MapPath(@"~\Upload\Temps"));//将虚拟转化成物理路劲
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 保存文件表中
        /// </summary>
        /// <param name="number">合同编号作为OldName</param>
        /// <param name="referenceid"></param>
        private bool InsertFile(string number, int referenceid, string ContrantName)
        {
            bool result = false;

            //插入一条pdf文件数据
            Models.Sys.FileInfo fi = new Models.Sys.FileInfo();
            fileMapper.Insert(fi = new Models.Sys.FileInfo
            {
                OldName     = number,
                ExtName     = ".pdf",
                NewName     = ContrantName,
                FilePath    = PDFPath,
                ReferenceId = referenceid,
                AddDate     = DateTime.Now
            });
            result = fi.FileId > 0;
            return(result);
        }