SVN r1205
SVN-Revision: r1205
This commit is contained in:
@@ -193,8 +193,26 @@ namespace Lskj.Util
|
||||
/// <returns><c>true</c> if the specified default value is select; otherwise, <c>false</c>.</returns>
|
||||
public static bool IsSelect(string defaultValue)
|
||||
{
|
||||
return defaultValue.ToLower().Trim().Trim(new char[] { '\r', '\t', '\n' }).StartsWith(_selectFlag);
|
||||
//return defaultValue.ToLower().Trim().Trim(new char[] { '\r', '\t', '\n' }).StartsWith(_selectFlag);
|
||||
//2026-4-17 之前判断不了开头有注释的情况
|
||||
if (string.IsNullOrWhiteSpace(defaultValue))return false;
|
||||
// 清理:开头所有空白 + 所有单行注释 + 所有多行注释
|
||||
string cleaned = Regex.Replace(
|
||||
defaultValue,
|
||||
@"^\s*(/\*.*?\*/|\s|--.*?$)*",
|
||||
"",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Multiline
|
||||
);
|
||||
return cleaned.StartsWith("select", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:替换userid、username、groupid</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
@@ -226,6 +244,16 @@ namespace Lskj.Util
|
||||
/// <returns>System.String.</returns>
|
||||
public static string ReplaceUserInfo(string defaultValue, string userId, string userName, string groupId, string password)
|
||||
{
|
||||
if (string.IsNullOrEmpty(defaultValue))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
if (defaultValue.IndexOf('{') < 0)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return defaultValue = defaultValue.Replace(_loginid_key, userId, true)
|
||||
.Replace(_loginname_key, userName, true)
|
||||
.Replace(_groupid_key, groupId, true)
|
||||
@@ -241,8 +269,8 @@ namespace Lskj.Util
|
||||
.Replace(_loginaccount_key, ERPInfo.Instance.LoginAccount + "", true)
|
||||
.Replace(_accountBook, ERPInfo.Instance.AccountBook + "", true)
|
||||
.Replace(_loginUserLinkPhone_key, ERPInfo.Instance.UserLinkPhone + "", true)
|
||||
.Replace(_mrpTag_key, ERPInfo.Instance.MrpTag + "", true)
|
||||
.Replace(_macAddressy, ERPInfo.Instance.MacAddress + "", true);
|
||||
.Replace(_mrpTag_key, ERPInfo.Instance.MrpTag + "", true);
|
||||
//.Replace(_macAddressy, ERPInfo.Instance.MacAddress + "", true);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user