From b2d72647683d4f5b66068195753df2f413e7aa66 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Wed, 12 Nov 2025 09:39:12 +0800 Subject: [PATCH] 1 --- HJGL_DS/FineUIPro.Web/ErrLog.txt | 38 ++++++++++++++++++- .../WeldMat/UsingPlan/UsingPlanEdit.aspx.cs | 20 ++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/HJGL_DS/FineUIPro.Web/ErrLog.txt b/HJGL_DS/FineUIPro.Web/ErrLog.txt index 5f28270..270b3e2 100644 --- a/HJGL_DS/FineUIPro.Web/ErrLog.txt +++ b/HJGL_DS/FineUIPro.Web/ErrLog.txt @@ -1 +1,37 @@ - \ No newline at end of file + +错误信息开始=====> +错误类型:SqlException +错误信息:在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - 定位指定的服务器/实例时出错) +错误堆栈: + 在 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager) + 在 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) + 在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) + 在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) + 在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) + 在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) + 在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) + 在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) + 在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) + 在 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) + 在 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) + 在 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) + 在 System.Data.SqlClient.SqlConnection.Open() + 在 System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) + 在 System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() + 在 System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() + 在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) + 在 System.Data.Linq.Table`1.System.Linq.IQueryProvider.Execute[TResult](Expression expression) + 在 System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate) + 在 FineUIPro.Web.Login.btnLogin_Click(Object sender, EventArgs e) + 在 FineUIPro.Button.OnClick(EventArgs e) + 在 (Button , EventArgs ) + 在 FineUIPro.Button.RaisePostBackEvent(String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) + 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) + 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +出错时间:11/11/2025 15:17:16 +出错文件:http://localhost:64304/Login.aspx +IP地址:::1 + +出错时间:11/11/2025 15:17:16 + diff --git a/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlanEdit.aspx.cs b/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlanEdit.aspx.cs index 8969437..e14a8c7 100644 --- a/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlanEdit.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/WeldMat/UsingPlan/UsingPlanEdit.aspx.cs @@ -215,11 +215,31 @@ namespace FineUIPro.Web.WeldMat.UsingPlan /// protected void btnSave_Click(object sender, EventArgs e) { + Model.SGGLDB db = Funs.DB; + var amount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.Amount ?? 0).Sum(); + var usingAmount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.UsingAmount ?? 0).Sum(); + var recycleAmount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.RecycleAmount ?? 0).Sum(); + decimal a = amount - usingAmount + recycleAmount; + if (Funs.GetNewDecimal(this.txtAmount.Text.Trim()) > a) + { + Alert.ShowInTop("焊材库存仅剩"+a.ToString("0.##")+"根,领用数量不能超过库存数量!", MessageBoxIcon.Warning); + return; + } SaveData(false); } protected void btnSubmit_Click(object sender, EventArgs e) { + Model.SGGLDB db = Funs.DB; + var amount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.Amount ?? 0).Sum(); + var usingAmount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.UsingAmount ?? 0).Sum(); + var recycleAmount = (from y in db.Weld_StockIn where y.UnitStoreId == this.drpUnitStore.SelectedValue && y.WeldId == this.hdWeldId.Text.Trim() select y.RecycleAmount ?? 0).Sum(); + decimal a = amount - usingAmount + recycleAmount; + if (Funs.GetNewDecimal(this.txtAmount.Text.Trim()) > a) + { + Alert.ShowInTop("焊材库存仅剩" + a.ToString("0.##") + "根,领用数量不能超过库存数量!", MessageBoxIcon.Warning); + return; + } SaveData(true); }