2025-5-14 附件重复上传提醒

This commit is contained in:
毕文静 2025-05-14 23:08:03 +08:00
parent 1cda2d1914
commit 647d00f201
5 changed files with 43 additions and 21 deletions

View File

@ -7,6 +7,9 @@ using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using NPOI.SS.Formula.Functions;
using Microsoft.JScript;
using System.Security.Policy;
namespace FineUIPro.Web.AttachFile
{
@ -278,25 +281,44 @@ namespace FineUIPro.Web.AttachFile
//合同管理附件名重复提醒
if (MenuId == BLL.Const.SESRelatedDateMenuId)
{
string newName = attachUrl.Substring(attachUrl.LastIndexOf("\\"));
string n = newName.Substring(newName.IndexOf("_") + 1);
foreach (var item in sour)
if (!string.IsNullOrEmpty(attachUrl))
{
if (item.AttachUrl.Contains(n))
string newName = attachUrl.Substring(attachUrl.LastIndexOf("\\"));
string n = newName.Substring(newName.IndexOf("_") + 1);
string fc_id = Request.QueryString["fcid"];
string fileTypeId = Request.QueryString["fileTypeId"];
var conLists = from x in Funs.DB.FC_ContractManagement where x.FC_ID.ToString() == fc_id && x.FileTypeId == fileTypeId select x;
foreach (var item in conLists)
{
Alert.ShowInTop(n + "已存在!", MessageBoxIcon.Warning);
return;
}
}
string fc_id = Request.QueryString["fcid"];
string fileTypeId = Request.QueryString["fileTypeId"];
var conLists = from x in Funs.DB.FC_ContractManagement where x.FC_ID.ToString() == fc_id && x.FileTypeId == fileTypeId select x;
foreach (var item in conLists)
{
if (item.AttachUrl.Contains(n))
{
Alert.ShowInTop(n + "已存在!", MessageBoxIcon.Warning);
return;
if (item.FileId != ToKeyId)
{
if (item.AttachUrl.Contains(n))
{
Alert.ShowInTop(n + "已存在!", MessageBoxIcon.Warning);
return;
}
}
else
{
List<string> newNames = new List<string>();
var list = attachUrl.Split(',').ToList();
foreach (var l in list)
{
string oldname = l.Substring(l.LastIndexOf("\\"));
string oldn = oldname.Substring(oldname.IndexOf("_") + 1);
newNames.Add(oldn);
}
var query = newNames.GroupBy(x => x).Where(g => g.Count() > 1).ToDictionary(x => x.Key, y => y.Count());
foreach (var i in query)
{
if (i.Value > 1)
{
Alert.ShowInTop(i.Key + "已存在!", MessageBoxIcon.Warning);
return;
}
}
}
}
}
}

View File

@ -1004,7 +1004,7 @@ namespace FineUIPro.Web.Evaluation
else
{
sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == FoNo && p.Requisitioner == CurrUser.Account && (p.Blocked == null || p.Blocked == "") && (p.Deleted == null || p.Deleted == "")).ToList();
}
}
Grid2.DataSource = sesList.OrderByDescending(x=>x.ShowViolationDegree);
Grid2.DataBind();
}

View File

@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress>
</Use64BitIISExpress>

View File

@ -55,7 +55,7 @@
<add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" validate="false"/>
</httpHandlers>
<compilation debug="false" targetFramework="4.6.1">
<compilation debug="true" targetFramework="4.6.1">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
</buildProviders>

View File

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>