删除后自动清除文件记录
This commit is contained in:
@@ -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提取数据
|
||||
|
||||
Reference in New Issue
Block a user