From 31eba6a8c6261adf5bfef4dafad4dc8efc1f66a2 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期二, 18 二月 2025 18:57:54 +0800 Subject: [PATCH] 1 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs index ded801d..ee18736 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs @@ -286,7 +286,7 @@ List<TDetail> list = detailDics.DicToIEnumerable<TDetail>(); - ((SqlSugarClient)BaseDal.Db).BeginTran(); + ((SqlSugarScope)BaseDal.Db).BeginTran(); int id = BaseDal.Db.Insertable(entity).ExecuteReturnIdentity(); @@ -298,13 +298,13 @@ BaseDal.Db.Insertable(list).ExecuteCommand(); - ((SqlSugarClient)BaseDal.Db).CommitTran(); + ((SqlSugarScope)BaseDal.Db).CommitTran(); content = WebResponseContent.Instance.OK(); } catch (Exception ex) { - ((SqlSugarClient)BaseDal.Db).RollbackTran(); + ((SqlSugarScope)BaseDal.Db).RollbackTran(); content = WebResponseContent.Instance.Error(ex.Message); } return content; @@ -457,7 +457,7 @@ object mainId = typeof(TEntity).GetPropertyValue(entity, typeof(TEntity).GetKeyName()); if (mainId != null) { - ((SqlSugarClient)BaseDal.Db).BeginTran(); + ((SqlSugarScope)BaseDal.Db).BeginTran(); if (dynamicDelKeys.Count > 0) BaseDal.Db.Deleteable<object>().AS(detailType.Name).Where($"{detailType.GetKeyName()} in (@id)", new { id = dynamicDelKeys.ToArray() }).ExecuteCommandHasChange(); @@ -474,7 +474,7 @@ BaseDal.Db.Insertable(addRows).ExecuteCommand(); - ((SqlSugarClient)BaseDal.Db).CommitTran(); + ((SqlSugarScope)BaseDal.Db).CommitTran(); content = WebResponseContent.Instance.OK(); } @@ -486,7 +486,7 @@ } catch (Exception ex) { - ((SqlSugarClient)BaseDal.Db).RollbackTran(); + ((SqlSugarScope)BaseDal.Db).RollbackTran(); content = WebResponseContent.Instance.Error(ex.Message); } return content; @@ -532,14 +532,14 @@ { dynamicDelKeys.Add(keys[i]); } - ((SqlSugarClient)BaseDal.Db).BeginTran(); + ((SqlSugarScope)BaseDal.Db).BeginTran(); if (dynamicDelKeys.Count > 0) BaseDal.Db.Deleteable<object>().AS(detailType.Name).Where($"{name} in (@id)", new { id = dynamicDelKeys.ToArray() }).ExecuteCommandHasChange(); BaseDal.DeleteDataByIds(keys); - ((SqlSugarClient)BaseDal.Db).CommitTran(); + ((SqlSugarScope)BaseDal.Db).CommitTran(); return WebResponseContent.Instance.OK(); } @@ -551,7 +551,7 @@ } catch (Exception ex) { - ((SqlSugarClient)BaseDal.Db).RollbackTran(); + ((SqlSugarScope)BaseDal.Db).RollbackTran(); return WebResponseContent.Instance.Error(ex.Message); } } -- Gitblit v1.9.3