From 9f9f09c47e1daf2ce29440981dbb615a04f73974 Mon Sep 17 00:00:00 2001 From: Argo-MacBookPro Date: Sat, 8 Sep 2018 18:10:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81=EF=BC=9ASa?= =?UTF-8?q?veUser=E6=96=B9=E6=B3=95=E4=BD=BF=E7=94=A8ExecuteNonQuery?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.DataAccess/UserHelper.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Bootstrap.DataAccess/UserHelper.cs b/Bootstrap.DataAccess/UserHelper.cs index bedf5cf2..ad92e982 100644 --- a/Bootstrap.DataAccess/UserHelper.cs +++ b/Bootstrap.DataAccess/UserHelper.cs @@ -104,6 +104,7 @@ namespace Bootstrap.DataAccess /// public static bool SaveUser(User p) { + var ret = false; if (p.Id == 0 && p.Description.Length > 500) p.Description = p.Description.Substring(0, 500); if (p.UserName.Length > 50) p.UserName = p.UserName.Substring(0, 50); p.PassSalt = LgbCryptography.GenerateSalt(); @@ -119,10 +120,10 @@ namespace Bootstrap.DataAccess if (p.ApprovedTime == DateTime.MinValue) approvedTime = DBNull.Value; cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@approvedTime", approvedTime)); cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@description", p.Description)); - DBAccessManager.SqlDBAccess.ExecuteNonQuery(cmd); + ret = DBAccessManager.SqlDBAccess.ExecuteNonQuery(cmd) == -1; } CacheCleanUtility.ClearCache(userIds: p.Id == 0 ? string.Empty : p.Id.ToString()); - return true; + return ret; } /// ///