From d85a4b97325020b7efe1a6cdbd55025c6408cec9 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期五, 25 十月 2024 10:12:06 +0800 Subject: [PATCH] 更新 --- WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs | 42 ++++++++++++++++++++---------------------- 1 files changed, 20 insertions(+), 22 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs b/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs index 8f5d041..9a80c5b 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs @@ -15,7 +15,6 @@ using WIDESEAWCS_Core.Enums; using WIDESEAWCS_Core.Helper; using WIDESEAWCS_Core.Utilities; -using static OfficeOpenXml.ExcelErrorValue; namespace WIDESEAWCS_Core.BaseServices { @@ -59,7 +58,6 @@ return pageGridData; } - protected string ValidatePageOptions(PageDataOptions options) { options = options ?? new PageDataOptions(); @@ -92,7 +90,7 @@ if (property == null) continue; List<(bool, string, object)> results = property.ValidationValueForDbType(searchParametersList[i].Value.Split(',')).ToList(); - if (results == null || results.Count() > 0) + if (results == null || results.Count() == 0) { continue; } @@ -263,7 +261,7 @@ } Type detailType = typeof(TEntity).GetDetailType(); - MethodInfo? methodInfo = GetType().GetMethod("AddDataIncludesDetail"); + MethodInfo? methodInfo = GetType().GetMethod(nameof(AddDataIncludesDetail)); methodInfo = methodInfo?.MakeGenericMethod(new Type[] { detailType }); object? obj = methodInfo?.Invoke(this, new object[] { entity, detailType, saveModel.DetailData }); return obj as WebResponseContent; @@ -373,27 +371,27 @@ TEntity entity = saveModel.MainData.DicToModel<TEntity>(); - List<string> listCol = new List<string>(); - foreach (var item in saveModel.MainData) - { - PropertyInfo propertyInfo = typeof(TEntity).GetProperty(item.Key); - if (propertyInfo == null) - { - propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToLower()); - if (propertyInfo == null) - { - propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToUpper()); - } - } + //List<string> listCol = new List<string>(); + //foreach (var item in saveModel.MainData) + //{ + // PropertyInfo propertyInfo = typeof(TEntity).GetProperty(item.Key); + // if (propertyInfo == null) + // { + // propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToLower()); + // if (propertyInfo == null) + // { + // propertyInfo = typeof(TEntity).GetProperty(item.Key.FirstLetterToUpper()); + // } + // } - listCol.Add(propertyInfo?.Name); - } + // listCol.Add(propertyInfo?.Name); + //} if (saveModel.DetailData == null || saveModel.DetailData.Count == 0) { - if (list != null) - listCol = listCol.Where(x => !list.Contains(x)).ToList(); - bool result = BaseDal.UpdateData(entity, listCol, list); + //if (list != null) + // listCol = listCol.Where(x => !list.Contains(x)).ToList(); + bool result = BaseDal.UpdateData(entity); return WebResponseContent.Instance.OK(); } @@ -403,7 +401,7 @@ } Type detailType = typeof(TEntity).GetDetailType(); - MethodInfo? methodInfo = GetType().GetMethod("UpdateDataInculdesDetail"); + MethodInfo? methodInfo = GetType().GetMethod(nameof(UpdateDataInculdesDetail)); methodInfo = methodInfo?.MakeGenericMethod(new Type[] { detailType }); object? obj = methodInfo?.Invoke(this, new object[] { entity, detailType, saveModel.DetailData, saveModel.DelKeys }); return obj as WebResponseContent; -- Gitblit v1.9.3