Пример #1
0
        public virtual String GetBody(Boolean showQuestionDesciption)
        {
            StringBuilder builder = new StringBuilder();

            if (showQuestionDesciption)
            {
                builder.AppendFormat("<div>{0}</div>", this.Question);
            }

            builder.Append("<div id=\"pollContainer\">");

            builder.Append("<table class=\"pollOptions\" cellpadding=\"0\" cellspacing=\"0\">\n");
            for (int i = 0; i < this.Items.Count; i++)
            {
                PollViewItem item = this.Items[i];
                builder.Append("<tr>");


                builder.Append("<td class=\"optionItemString\">");
                if (!this.hasVote)
                {
                    builder.AppendFormat("{0}", item.CheckBox);
                }

                builder.AppendFormat("<label for=\"pollOption{1}\">{0}</label></td>", item.OptionString, item.OptionValue);
                String cssClass = "onePollResultNotShow";
                if (this.hasVote || (this.isVisible == 0))
                {
                    cssClass = "onePollResult";
                }
                builder.AppendFormat("<td id=\"onePollResult{0}\" class=\"{1}\">{2}</td>", i, cssClass, item.ImgAndCountInfo);


                //builder.AppendFormat( "<label for=\"pollOption{1}\">{0}</label>", item.OptionString, item.OptionValue );
                //String cssClass = "onePollResultNotShow";
                //if (this.hasVote || (this.isVisible == 0)) cssClass = "onePollResult";
                //builder.AppendFormat( "{0}", item.ImgAndCountInfo );
                //builder.Append( "</td>" );


                builder.Append("</tr>");
            }


            builder.Append("</table>");

            builder.AppendFormat("<div class=\"note\">{0}</div>", this.PollMsg);
            builder.AppendFormat("<div class=\"pollSubmit\">{0}</div>", this.Submit);

            builder.Append("</div>");

            return(builder.ToString());
        }
Пример #2
0
 public static List<PollViewItem> GetPollViewItems( PollBase poll )
 {
     string[] optionList = poll.OptionList;
     List<PollViewItem> list = new List<PollViewItem>();
     for (int i = 0; i < optionList.Length; i++) {
         PollViewItem item = new PollViewItem();
         item.SetPoll( poll );
         item.SetOptionString( optionList[i] );
         item.SetOptionIndex( i );
         item.SetOptionCount( optionList.Length );
         item.Init();
         list.Add( item );
     }
     return list;
 }
Пример #3
0
        public static List <PollViewItem> GetPollViewItems(PollBase poll)
        {
            string[]            optionList = poll.OptionList;
            List <PollViewItem> list       = new List <PollViewItem>();

            for (int i = 0; i < optionList.Length; i++)
            {
                PollViewItem item = new PollViewItem();
                item.SetPoll(poll);
                item.SetOptionString(optionList[i]);
                item.SetOptionIndex(i);
                item.SetOptionCount(optionList.Length);
                item.Init();
                list.Add(item);
            }
            return(list);
        }