private string GetUserNameHtml(UserInfo userInfo) { var showPopWinString = ModalUserView.GetOpenWindowString(userInfo.UserName); var state = string.Empty; if (userInfo.IsLockedOut) { state = @"<span style=""color:red;"">[已被锁定]</span>"; } else if (ConfigManager.UserConfigInfo.IsLoginFailToLock && ConfigManager.UserConfigInfo.LoginFailToLockCount <= userInfo.CountOfFailedLogin) { if (_lockType == EUserLockType.Forever) { state = @"<span style=""color:red;"">[已被锁定]</span>"; } else { var ts = new TimeSpan(DateTime.Now.Ticks - userInfo.LastActivityDate.Ticks); var hours = Convert.ToInt32(ConfigManager.UserConfigInfo.LoginLockingHours - ts.TotalHours); if (hours > 0) { state = $@"<span style=""color:red;"">[错误登录次数过多,已被锁定{hours}小时]</span>"; } } } return($@"<a href=""javascript:;"" onclick=""{showPopWinString}"">{userInfo.UserName}</a> {state}"); }
private string GetUserNameHtml(string userName, bool isLockedOut) { var showPopWinString = ModalUserView.GetOpenWindowString(userName); var state = string.Empty; if (isLockedOut) { state = @"<span style=""color:red;"">[已被锁定]</span>"; } return($@"<a href=""javascript:;"" onclick=""{showPopWinString}"">{userName}</a>{state}"); }
public static string GetViewHtml(int userID, string userName) { var showPopWinString = ModalUserView.GetOpenWindowString(userName); return($@"<a href=""javascript:;"" onclick=""{showPopWinString}"">{userName}</a>"); }