/// <summary>
    /// Postback handling.
    /// </summary>
    /// <param name="eventArgument">Argument of postback event</param>
    public void RaisePostBackEvent(string eventArgument)
    {
        if ((eventArgument == null))
        {
            return;
        }

        // Get ID of user
        int selectedId = ValidationHelper.GetInteger(ContextMenu.Parameter, 0);

        if (selectedId == 0)
        {
            ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "UserContextMenuError", ScriptHelper.GetScript("alert('No user was selected.');"));
        }
        else
        {
            // Add only if messaging is present
            if (MessagingPresent)
            {
                // Add to contact or ignore list
                switch (eventArgument)
                {
                case "addtoignorelist":
                    ModuleCommands.MessagingAddToIgnoreList(currentUser.UserID, selectedId);
                    break;

                case "addtocontactlist":
                    ModuleCommands.MessagingAddToContactList(currentUser.UserID, selectedId);
                    break;
                }
            }
        }
    }
    /// <summary>
    /// Postback handling.
    /// </summary>
    /// <param name="eventArgument">Argument of postback event</param>
    public void RaisePostBackEvent(string eventArgument)
    {
        if ((eventArgument == null))
        {
            return;
        }

        // Get ID of user
        int selectedId = ValidationHelper.GetInteger(hdnSelectedId.Value, 0);

        // Add only if messaging is present
        if (MessagingPresent)
        {
            // Get the module entry
            if (currentUser == null)
            {
                currentUser = MembershipContext.AuthenticatedUser;
            }

            // Add to contact or ignore list
            switch (eventArgument)
            {
            case "addtoignorelist":
                ModuleCommands.MessagingAddToIgnoreList(currentUser.UserID, selectedId);
                break;

            case "addtocontactlist":
                ModuleCommands.MessagingAddToContactList(currentUser.UserID, selectedId);
                break;
            }

            URLHelper.Redirect(RequestContext.CurrentURL);
        }
    }
示例#3
0
    /// <summary>
    /// Postback handling.
    /// </summary>
    /// <param name="eventArgument">Argument of postback event</param>
    public void RaisePostBackEvent(string eventArgument)
    {
        if ((eventArgument == null))
        {
            return;
        }

        // Get ID of user
        int selectedId = ValidationHelper.GetInteger(hdnSelectedId.Value, 0);

        // Add only if messaging is present
        if (MessagingPresent)
        {
            // Add to contact or ignore list
            switch (eventArgument)
            {
            case "addtoignorelist":
                ModuleCommands.MessagingAddToIgnoreList(currentUser.UserID, selectedId);
                break;

            case "addtocontactlist":
                ModuleCommands.MessagingAddToContactList(currentUser.UserID, selectedId);
                break;
            }
        }
    }