Ejemplo n.º 1
0
        public ThankYouInfo AddThanks([NotNull] object msgID)
        {
            var messageId = msgID.ToType <int>();

            var membershipUser = UserMembershipHelper.GetUser();

            if (membershipUser == null)
            {
                return(null);
            }

            var username =
                LegacyDb.message_AddThanks(
                    UserMembershipHelper.GetUserIDFromProviderUserKey(membershipUser.ProviderUserKey),
                    messageId,
                    this.Get <YafBoardSettings>().EnableDisplayName);

            // if the user is empty, return a null object...
            return(username.IsNotSet()
                       ? null
                       : YafThankYou.CreateThankYou(
                       new UnicodeEncoder().XSSEncode(username),
                       "BUTTON_THANKSDELETE",
                       "BUTTON_THANKSDELETE_TT",
                       messageId));
        }
Ejemplo n.º 2
0
        public ThankYouInfo RemoveThanks([NotNull] object msgID)
        {
            var messageID = msgID.ToType <int>();

            var username =
                LegacyDb.message_RemoveThanks(
                    UserMembershipHelper.GetUserIDFromProviderUserKey(Membership.GetUser().ProviderUserKey), messageID, this.Get <YafBoardSettings>().EnableDisplayName);

            return(YafThankYou.CreateThankYou(username, "BUTTON_THANKS", "BUTTON_THANKS_TT", messageID));
        }