コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
            }
        }
コード例 #3
0
 public static void RemoveUserAlertMessages(int userId)
 {
     UserAlertMessage.Delete("userId", userId);
     UserAlertMessageCache.RemoveUser(userId);
 }