This commit is contained in:
高飞 2025-11-12 09:39:12 +08:00
parent 1906687242
commit b2d7264768
2 changed files with 57 additions and 1 deletions

View File

@ -1 +1,37 @@
 
错误信息开始=====>
错误类型: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

View File

@ -215,11 +215,31 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
/// <param name="e"></param> /// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e) 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); SaveData(false);
} }
protected void btnSubmit_Click(object sender, EventArgs e) 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); SaveData(true);
} }