From b38c91e5cce54e1114ec5968c722c1a1c57bd21a Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期五, 21 六月 2024 13:27:00 +0800
Subject: [PATCH] 完成派送订单佣金写入余额逻辑

---
 CoreCms.Net.Utility/Extensions/ObjectExtensions.cs |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/CoreCms.Net.Utility/Extensions/ObjectExtensions.cs b/CoreCms.Net.Utility/Extensions/ObjectExtensions.cs
index f1ca099..9661063 100644
--- a/CoreCms.Net.Utility/Extensions/ObjectExtensions.cs
+++ b/CoreCms.Net.Utility/Extensions/ObjectExtensions.cs
@@ -1,6 +1,6 @@
 锘�/***********************************************************************
- *            Project: CoreCms.Net                                     *
- *                Web: https://CoreCms.Net                             *
+ *            Project: baifenBinfa.Net                                     *
+ *                Web: https://baifenBinfa.com                             *
  *        ProjectName: 鐧惧垎鍏垫硶绠$悊绯荤粺                               *
  *             Author:                                        *
  *              Email:                               *
@@ -14,6 +14,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Text;
 
 namespace CoreCms.Net.Utility.Extensions
@@ -174,8 +175,18 @@
             return thisValue != null && thisValue != DBNull.Value && bool.TryParse(thisValue.ToString(), out result) ? result : result;
         }
 
-
-
+        /// <summary>
+        /// 鑾峰彇鏋氫妇鐨勬爣娉ㄧ殑鍊�
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="value"></param>
+        /// <returns></returns>
+        public static string GetDescription(this Enum value) 
+        {
+            var field = value.GetType().GetField(value.ToString());
+            var attributes = (DescriptionAttribute[])field.GetCustomAttributes(typeof(DescriptionAttribute), false);
+            return attributes.Length > 0 ? attributes[0].Description : value.ToString();
+        }
 
     }
 }

--
Gitblit v1.9.1