删除后自动清除文件记录

This commit is contained in:
2024-12-28 11:09:50 +08:00
parent db7446880e
commit 7083f10e59
7 changed files with 131 additions and 90 deletions
@@ -570,6 +570,7 @@ namespace FineUIPro.Web.AttachFile
}
File.Delete(Server.MapPath("~/" + attachUrl));
BLL.LogService.AddSys_Log(this.CurrUser, "删除附件!", null, this.MenuId, BLL.Const.BtnDelete);
}
catch (Exception)
{
@@ -580,6 +581,27 @@ namespace FineUIPro.Web.AttachFile
}
}
Session[sessionName] = source;
//删除附件后,修改附件表数据
string attachUrlNew = string.Empty;
for (int i = 0, count = source.Count; i < count; i++)
{
JObject item = source[i] as JObject;
if (!string.IsNullOrEmpty(item.Value<string>("folder")))
{
attachUrlNew += item.Value<string>("folder") + item.Value<string>("savedName") + ",";
}
else
{
attachUrlNew += AttachPath + "/" + DateTime.Now.ToString("yyyy-MM") + "/" + item.Value<string>("savedName") + ",";
}
}
if (!string.IsNullOrEmpty(attachUrlNew))
{
attachUrlNew = attachUrlNew.Substring(0, attachUrlNew.LastIndexOf(",")).Replace('\\', '/');
}
///保存方法
this.SaveData(source.ToString(), attachUrlNew);
}
#region Excel提取数据