berlin-tzen 1 year ago
parent
commit
bb88e91de7
  1. 27
      EuroTran/EasyBL.WEBAPP/ShowEasy/ONSiteMaintain_UpdService.cs

27
EuroTran/EasyBL.WEBAPP/ShowEasy/ONSiteMaintain_UpdService.cs

@ -6,6 +6,7 @@ using SqlSugar;
using SqlSugar.Base; using SqlSugar.Base;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
namespace EasyBL.WEBAPP.ShowEasy namespace EasyBL.WEBAPP.ShowEasy
@ -1449,6 +1450,18 @@ namespace EasyBL.WEBAPP.ShowEasy
{ {
PreviewFileModel.FileID = Guid.NewGuid().ToString(); PreviewFileModel.FileID = Guid.NewGuid().ToString();
PreviewFileModel.ParentID = ServiceBaseInfoModel.PreviewFile; PreviewFileModel.ParentID = ServiceBaseInfoModel.PreviewFile;
var sServerPath = System.Web.HttpContext.Current.Server.MapPath("/");
var sFromFullPath = sServerPath + PreviewFileModel.FilePath;
if (File.Exists(sFromFullPath))
{
var sToFullPath = sFromFullPath.Insert(sFromFullPath.LastIndexOf(@"."), @"(1)");
if (File.Exists(sToFullPath))
{
sToFullPath = sToFullPath.Insert(sToFullPath.LastIndexOf(@"."), @"(1)");
}
Common.FnCopyFile(sFromFullPath, sToFullPath);
PreviewFileModel.FilePath = sToFullPath.Replace(sServerPath, "");
}
} }
if (lstPreviewFile.Count() > 0) if (lstPreviewFile.Count() > 0)
@ -1458,11 +1471,23 @@ namespace EasyBL.WEBAPP.ShowEasy
//PreviewFile //PreviewFile
var lstBannerFile = db.Queryable<OTB_SYS_Files>() var lstBannerFile = db.Queryable<OTB_SYS_Files>()
.Where(x => x.OrgID == i_crm.ORIGID && x.ParentID == OldBannerFileGuid).ToList();
.Where(x => x.OrgID == i_crm.ORIGID && x.ParentID == OldBannerFileGuid).ToList();
foreach (var BannerFileModel in lstBannerFile) foreach (var BannerFileModel in lstBannerFile)
{ {
BannerFileModel.FileID = Guid.NewGuid().ToString(); BannerFileModel.FileID = Guid.NewGuid().ToString();
BannerFileModel.ParentID = ServiceBaseInfoModel.BannerFile; BannerFileModel.ParentID = ServiceBaseInfoModel.BannerFile;
var sServerPath = System.Web.HttpContext.Current.Server.MapPath("/");
var sFromFullPath = sServerPath + BannerFileModel.FilePath;
if (File.Exists(sFromFullPath))
{
var sToFullPath = sFromFullPath.Insert(sFromFullPath.LastIndexOf(@"."), @"(1)");
if (File.Exists(sToFullPath))
{
sToFullPath = sToFullPath.Insert(sToFullPath.LastIndexOf(@"."), @"(1)");
}
Common.FnCopyFile(sFromFullPath, sToFullPath);
BannerFileModel.FilePath = sToFullPath.Replace(sServerPath, "");
}
} }
if (lstBannerFile.Count() > 0) if (lstBannerFile.Count() > 0)

Loading…
Cancel
Save