/// <summary> /// Adds an alert message for a given user /// </summary> /// <param name="userId"></param> /// <param name="alertMessage"></param> public static void AddUserAlertMessage(int userId, AlertMessageEnum alertMessage) { SPs.Kick_AddAlertMessageForUser(userId, (int)alertMessage).Execute(); //remove the cache for this user UserAlertMessageCache.RemoveUser(userId); }
/// <summary> /// Returns a list of string holding the alerts for the user /// </summary> /// <param name="userId"></param> /// <returns></returns> public static IList <string> UserAlertMessages(int userId) { UserAlertMessageViewCollection alerts = UserAlertMessageCache.GetUserAlerts(userId); if (alerts != null) { return(alerts.DisplayAlertMessages()); } else { return(null); } }
public static void RemoveUserAlertMessages(int userId) { UserAlertMessage.Delete("userId", userId); UserAlertMessageCache.RemoveUser(userId); }