protected void Page_Load(object sender, EventArgs e)
        {
            if (IsUserLoggedIn)
            {
                ActivityLog log = new ActivityLog();
                if (log.FoundItemHelpful(context.ID.ToGuid(), CurrentMember.MemberId))
                {
                    btnYes.Attributes.Add("class", "button helpful-yes");
                    btnNo.Attributes.Add("class", "helpful-no");
                }
                else if (log.FoundItemNotHelpful(context.ID.ToGuid(), CurrentMember.MemberId))
                {
                    btnNo.Attributes.Add("class", "button helpful-no");
                    btnYes.Attributes.Add("class", "helpful-yes");
                }
                else
                {
                    btnNo.Attributes.Add("class", "helpful-no");
                    btnYes.Attributes.Add("class", "helpful-yes");

                }

            }
            else
            {
                btnNo.Attributes.Add("class", "helpful-no");
                btnYes.Attributes.Add("class", "helpful-yes");
            }


            ltlDidYouFindThisHelpful.Text = DictionaryConstants.DidYouFindThisHelpful;
            btnNo.InnerText = DictionaryConstants.NoButtonText;
            btnYes.InnerText = DictionaryConstants.YesButtonText;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsUserLoggedIn)
            {
                //ActivityLog log = new ActivityLog(CurrentMember.MemberId, Constants.UserActivity_Values.FoundHelpful_True);
                //ActivityItem temp = log.Activities.Where(i => i.ContentId == context.ID.ToGuid()).FirstOrDefault();
                ActivityLog log = new ActivityLog();
                if (log.FoundItemHelpful(context.ID.ToGuid(), CurrentMember.MemberId))
                {
                    btnYes.Attributes.Add("class", "button helpful-yes");
                    btnSmallYes.Attributes.Add("class", "button helpful-yes");
                    btnNo.Attributes.Add("class", "helpful-no");
                    btnSmallNo.Attributes.Add("class", "helpful-no");
                }
                else if (log.FoundItemNotHelpful(context.ID.ToGuid(), CurrentMember.MemberId))
                {
                    btnNo.Attributes.Add("class", "button helpful-no");
                    btnSmallNo.Attributes.Add("class", "button helpful-no");
                    btnYes.Attributes.Add("class", "helpful-yes");
                    btnSmallYes.Attributes.Add("class", "helpful-yes");
                }
                else
                {
                    btnNo.Attributes.Add("class", "helpful-no");
                    btnSmallNo.Attributes.Add("class", "helpful-no");
                    btnYes.Attributes.Add("class", "helpful-yes");
                    btnSmallYes.Attributes.Add("class", "helpful-yes");
           
                }

            }
            else
            {
                btnNo.Attributes.Add("class", "helpful-no");
                btnSmallNo.Attributes.Add("class", "helpful-no");
                btnYes.Attributes.Add("class", "helpful-yes");
                btnSmallYes.Attributes.Add("class", "helpful-yes");
            }
            ltlDidYouFindThisHelpful.Text = ltlDidYouFindThisHelpfulSmall.Text = DictionaryConstants.DidYouFindThisHelpful;
            btnNo.InnerText = btnSmallNo.InnerText = DictionaryConstants.NoButtonText;
            btnYes.InnerText = btnSmallYes.InnerText = DictionaryConstants.YesButtonText;
        }
 protected void btnNo_ServerClick(object sender, EventArgs e)
 {
     
     ActivityLog log = new ActivityLog();
     if (IsUserLoggedIn)
     {
         if (!(log.FoundItemNotHelpful(context.ID.ToGuid(), CurrentMember.MemberId)))
         {
             VoteNo();
         }
         else
         {
             VoteNeutral();
         }
     }
     else
     {
         Page.Session[Constants.SessionPreviousUrl] = null;
         this.ProfileRedirect(UnderstoodDotOrg.Common.Constants.UserPermission.RegisteredUser);
     }
 }
        protected void btnDidntHelp_Click(object sender, EventArgs e)
        {
            if (IsUserLoggedIn)
            {
                var currentMember = this.CurrentMember;
                ActivityLog log = new ActivityLog();
                LinkButton btn = (LinkButton)(sender);
                string ids = btn.CommandArgument;
                string[] s = ids.Split('&');
                Guid? ContentId = s[0].AsNGuid();
                string contentTypeId = s[1];
                Guid MemberId = this.CurrentMember.MemberId;
                if (ContentId.HasValue && !(log.FoundItemNotHelpful(ContentId.Value, MemberId)))
                {
                    // instantiate MM
                    MembershipManager mgr = new MembershipManager();
                    // write to the DB
                    mgr.LogMemberHelpfulVote(MemberId, ContentId.Value, Constants.UserActivity_Values.FoundHelpful_False, Constants.UserActivity_Types.FoundHelpfulVote);
                    Response.Redirect(Request.RawUrl);
                }
                //ActivityLog log = new ActivityLog();
                //LinkButton btn = (LinkButton)(sender);
                //string ids = btn.CommandArgument;
                //string[] s = ids.Split('&');
                //Guid ContentId = new Guid(s[0]);
                //string contentTypeId = s[1];
                //Guid MemberId = this.CurrentMember.MemberId;


                //if ((log.FoundItemHelpful(ContentId, MemberId)))
                //{
                //    // instantiate MM
                //    MembershipManager mgr = new MembershipManager();
                //    // write to the DB
                //    mgr.LogMemberHelpfulVote(MemberId, ContentId, Constants.UserActivity_Values.FoundHelpful_False, Constants.UserActivity_Types.FoundHelpfulVote);
                //    Response.Redirect(Request.RawUrl);
                //}
            }
            else
            {
                //this.ProfileRedirect(Constants.UserPermission.CommunityUser);
            }

            //var like = new LikeModel();
            //if (!string.IsNullOrEmpty(username))
            //{
            //    like = CommunityHelper.GetLike(this.CurrentMember.ScreenName.Trim(), contentId, contentTypeId);
            //}
            //using (var webClient = new WebClient())
            //{
            //    try
            //    {
            //        // replace the "admin" and "Admin's API key" with your valid user and apikey!
            //        var adminKey = String.Format("{0}:{1}", Settings.GetSetting(Constants.Settings.TelligentAdminApiKey), "admin");
            //        var adminKeyBase64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(adminKey));

            //        webClient.Headers.Add("Rest-User-Token", adminKeyBase64);
            //        webClient.Headers.Add("Rest-Method", "DELETE");

            //        var requestUrl = String.Format("{0}api.ashx/v2/likes.xml", Settings.GetSetting(Constants.Settings.TelligentConfig));

            //        var values = new NameValueCollection();
            //        values.Add("ContentUrl", like.ContentUrl);

            //        var xml = Encoding.UTF8.GetString(webClient.UploadValues(requestUrl, values));

            //        Console.WriteLine(xml);
            //    }
            //    catch { } //TODO: Add logging
            //}
        }