protected void btnVote_Click(object sender, EventArgs e) { if (User.Identity.IsAuthenticated) { LoadBored(); Score rating = new Score() { Created = DateTime.UtcNow, RatingRaw = int.Parse(Rating1.CurrentRating.ToString()), Text = txtEntry.Text, UserId = Membership.GetUser().ProviderUserKey.ToString(), Votes = new List <Vote>(1), IsPro = (sender == btnPro) }; _board.AddScore(rating); BindAll(); txtEntry.Text = string.Empty; upScore.Update(); upBoards.Update(); upComs.Update(); } else { MPESignup.Show(); Rating1.CurrentRating = 1; } }
protected void comment_Click(object sender, EventArgs e) { if (User.Identity.IsAuthenticated) { MembershipUser user = Membership.GetUser(); //ImageButton button = sender as ImageButton; //string upDown = button.CommandArgument; LoadBored(); short weight = Convert.ToInt16(this.comWt.Value); //could be the vote or score ID depending on weight value int sourceID = Convert.ToInt32(comCd.Value); //A weight of 100 is a reply to if (weight == 100) { _board.ReplyToVote(sourceID, Membership.GetUser(), txtComment.Text); } else { Score score = _board.FindScore(true, sourceID); if (score == null) { score = _board.FindScore(false, sourceID); } if (score != null) { score.AddVote(user, txtComment.Text, weight); } } if (weight != 0 && weight < 100) { BindAll(); upOut.Update(); } else { BindComments(); upOut.Update(); } } else { MPESignup.Show(); } txtComment.Text = string.Empty; upComBox.Update(); }