Пример #1
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;
                }
            }
Пример #2
0
    //-----------------------------------------------
    #endregion

    //------------------------------------------------------------------//

    //------------------------------------------------------------------//
    protected void LoadAnswers(VoteQuestionsEntity voteQuestions)
    {
        List <VoteAnswersEntity> voteAnswersList = VoteAnswersFactory.GetQuesAnswers(voteQuestions.QuesID);
        int               answersCount           = Convert.ToInt32(ddlAnswersCount.SelectedValue);
        TextBox           txt = new TextBox();
        VoteAnswersEntity answer;

        for (int i = 1; i <= voteAnswersList.Count; i++)
        {
            txt      = (TextBox)phAnswers.FindControl("txt" + i);
            answer   = voteAnswersList[i - 1];
            txt.Text = answer.AnswerText;
        }
    }
Пример #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;
                }
            }