Beispiel #1
0
            //-----------------------------------------------
            #endregion

            protected void LoadData()
            {
                VoteQuestionsEntity CurrentVote = VoteQuestionsFactory.GetMain();

                HttpContext.Current.Items["CurrentVote"] = CurrentVote;
                if (CurrentVote == null)
                {
                    this.Visible = false;
                    return;
                }
                if (CurrentVote != null && !CurrentVote.IsClosed)
                {
                    ucVoting.Visible = true;
                    ucVoting.QuesID  = CurrentVote.QuesID;
                    ucVoting.LoadData();
                    //-----------------------------
                    ucVoteResult.Visible = false;
                }
                else
                {
                    ucVoteResult.Visible = true;
                    ucVoteResult.QuesID  = CurrentVote.QuesID;
                    ucVoteResult.LoadData();
                    ucVoting.Visible = false;
                }

                //-----------------------------
            }
Beispiel #2
0
            //-----------------------------------------------
            #endregion

            //-----------------------------------------------------------
            public void LoadData()
            {
                //-----------------------------------------------------------
                LoadControls();
                //-----------------------------------------------------------

                VoteQuestionsEntity vote;

                if (HttpContext.Current.Items["CurrentVote"] != null)
                {
                    vote = (VoteQuestionsEntity)HttpContext.Current.Items["CurrentVote"];
                }
                else
                {
                    vote = VoteQuestionsFactory.GetMain();
                }
                //-------------------------------------------------
                if (vote != null)
                {
                    if (!vote.IsClosed)
                    {
                        lblQuestion.Text = vote.QuestionText;
                        QuesID           = vote.QuesID;
                        List <VoteAnswersEntity> answersList = VoteAnswersFactory.GetQuesAnswers(vote.QuesID);
                        rbtlAnswers.DataSource     = answersList;
                        rbtlAnswers.DataTextField  = "AnswerText";
                        rbtlAnswers.DataValueField = "AnswerId";
                        rbtlAnswers.DataBind();
                        //-------------------------
                        TotalHits = vote.TotalHits;
                        //-------------------------
                        if (SiteSettings.Vote_CloseDuplicateVotingByCookie && Request.Cookies["VoteCookie" + QuesID] != null)
                        {
                            rbtlAnswers.Enabled = false;
                        }
                        if (aPreviousVotes != null)
                        {
                            aPreviousVotes.HRef = "/Website/AdditionalModules/Vote/flash.aspx?id=" + vote.QuesID;
                            //aPreviousVotes.HRef = "/Website/AdditionalModules/Vote/PreviousVotes.aspx";
                        }
                    }
                    else
                    {
                        rbtlAnswers.Visible = false;
                    }
                }
                else
                {
                    this.Visible = false;
                }
            }
Beispiel #3
0
            //-----------------------------------------------
            #endregion

            public void LoadData()
            {
                //-----------------------------------------------------------
                LoadControls();
                //-----------------------------------------------------------
                aPreviousVotes.Visible = ViewPreviousVotesLink;
                //-------------------------------------------------
                VoteQuestionsEntity vote;

                if (HttpContext.Current.Items["CurrentVote"] != null)
                {
                    vote = (VoteQuestionsEntity)HttpContext.Current.Items["CurrentVote"];
                }
                else
                {
                    vote = VoteQuestionsFactory.GetMain();
                }
                //-------------------------------------------------
                if (vote != null)
                {
                    lblQuestion.Text = vote.QuestionText;
                    answersList      = VoteAnswersFactory.GetQuesAnswers(vote.QuesID);
                    //TotalHits

                    /*foreach (VoteAnswersEntity answer in answersList)
                     * {
                     *  TotalHits += answer.HitsCount;
                     * }*/
                    TotalHits = vote.TotalHits;
                    //----------------------------------
                    rAnswers.DataSource = answersList;
                    rAnswers.DataBind();
                    if (aPreviousVotes != null)
                    {
                        // aPreviousVotes.HRef = "/Website/AdditionalModules/Vote/flash.aspx?id=" + vote.QuesID;
                        aPreviousVotes.HRef = "/Website/AdditionalModules/Vote/PreviousVotes.aspx";
                    }
                    //-----------------------------
                }
                else
                {
                    this.Visible = false;
                }
            }