From 734f49c3f74e4a46cfb5892ce60dbf1bb86e74ab Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期二, 22 七月 2025 19:14:39 +0800
Subject: [PATCH] 出入库流程

---
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs
index 3d50266..9440915 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs
@@ -31,7 +31,14 @@
             PropertyInfo[] propertyInfos = modelType.GetProperties();
             return SimpleValidate(propertyInfos, data);
         }
-
+        public static (bool, string, object?) ValidateModelData(object data, Type type)
+        {
+            if (data == null) return (false, "浼犲叆鍙傛暟涓嶅彲涓簄ull", data);
+            ModelValidateAttribute? modelAttribute = type.GetCustomAttribute<ModelValidateAttribute>();
+            if (modelAttribute == null) return (false, $"{type.Name}鏈畾涔夈�怣odelValidateAttribute銆戠壒鎬�", data);
+            PropertyInfo[] propertyInfos = type.GetProperties();
+            return SimpleValidate(propertyInfos, data);
+        }
         /// <summary>
         /// 楠岃瘉瀹炰綋鍙傛暟
         /// </summary>

--
Gitblit v1.9.3