Selaa lähdekoodia

重构 ClientLable 属性的 getter 方法

简化了 ClientLable 属性的 getter 方法逻辑。直接在条件判断中返回解密后的 Client 值,如果 Client 为空则返回 null,否则返回解密后的值。最后,如果条件不满足,则返回空字符串。
LEIYI 2 kuukautta sitten
vanhempi
commit
2c28dd1a80
1 muutettua tiedostoa jossa 2 lisäystä ja 4 poistoa
  1. 2 4
      OASystem/OASystem.Domain/ViewModels/CRM/NewClientDataView.cs

+ 2 - 4
OASystem/OASystem.Domain/ViewModels/CRM/NewClientDataView.cs

@@ -355,16 +355,14 @@ namespace OASystem.Domain.ViewModels.CRM
         {
             get
             {
-                var lable = string.Empty;
-
                 if (OperationItem is OperationEnum.Add or OperationEnum.Details or OperationEnum.Edit or OperationEnum.Del)
                 {
                     if (!string.IsNullOrEmpty(Client))
                     {
-                        lable = AesEncryptionHelper.Decrypt(Client);
+                        return string.IsNullOrEmpty(Client) ? null : AesEncryptionHelper.Decrypt(Client);
                     }
                 }
-                return lable;
+                return string.Empty;
             }
         }