Beispiel #1
0
        public string GetValueAction(QuestionWebControl qwc)
        {
            //return $"saveAnswers.Parameters.AddWithValue(\"@{q.Column}\", {q.ControlId}.Text);\n";
            var cb = (TextBox)qwc.Control;

            return(cb?.Text);
        }
 public void DisplayAction(SurveyModel.Question q, Poll poll, Control container, List <QuestionWebControl> ctls)
 {
     if (poll.Meetings.Count == 0)
     {
         return;
     }
     container.Controls.Add(new LiteralControl(QuestionTypeActionFactory.QuestionMarkup(q)));
     foreach (var m in poll.Meetings)
     {
         container.Controls.Add(new LiteralControl($@"<span class=""sub-block-title"">
             Meeting from {m.date_start} to {m.date_end} 
             </span>"));
         foreach (var sq in q.SubQuestions)
         {
             var csq     = (SubQuestion)sq.Clone();
             var manager = new Manager();
             csq.Answer = manager.getAnswer(poll.Id, poll.TableMeetingName, csq.Category,
                                            QuestionTypeActionFactory.getActionByName(csq.Category).getAnswerComlunName(csq),
                                            poll.PersonId, m.id_meeting);
             csq.Activity = m;
             var qc = new QuestionWebControl(csq);
             ctls.Add(qc);
             container.Controls.Add(qc);
         }
     }
     container.Controls.Add(new LiteralControl("<br/>"));
 }
 public void DisplayAction(Question q, Poll poll, Control container, List <QuestionWebControl> ctls)
 {
     if (poll.Workshops.Count == 0)
     {
         return;
     }
     container.Controls.Add(new LiteralControl(QuestionTypeActionFactory.QuestionMarkup(q)));
     foreach (var m in poll.Workshops)
     {
         container.Controls.Add(new LiteralControl(QuestionTypeActionFactory.SubBlockTitleMarkup(m.theme)));
         foreach (var sq in q.SubQuestions)
         {
             var csq     = (SubQuestion)sq.Clone();
             var manager = new Manager();
             csq.Answer = manager.getAnswer(poll.Id, poll.TableWsName, csq.Category,
                                            QuestionTypeActionFactory.getActionByName(csq.Category).getAnswerComlunName(csq),
                                            poll.PersonId, m.id_atelier);
             csq.Activity = m;
             var qc = new QuestionWebControl(csq);
             ctls.Add(qc);
             container.Controls.Add(qc);
         }
     }
     container.Controls.Add(new LiteralControl("<br/>"));
 }
        public void DisplayAction(SurveyModel.Question q, Poll poll, Control container, List <QuestionWebControl> ctls)
        {
            var manager = new Manager();

            q.Answer = manager.getAnswer(poll.Id, poll.TableName, q.Category,
                                         QuestionTypeActionFactory.getActionByName(q.Category).getAnswerComlunName(q), poll.PersonId);
            var qc = new QuestionWebControl(q);

            ctls.Add(qc);
            container.Controls.Add(qc);
        }
Beispiel #5
0
        public string GetValueAction(QuestionWebControl qwc)
        {
            var cbl = (CheckBoxList)qwc.Control;

            if (cbl == null)
            {
                return(null);
            }
            var selectedValues = new List <string>();

            foreach (ListItem i in cbl.Items)
            {
                if (i.Selected)
                {
                    selectedValues.Add(i.Text);
                }
            }
            return(string.Join(";", selectedValues));
        }
Beispiel #6
0
        public string GetValueAction(QuestionWebControl qwc)
        {
            var ddl = (DropDownList)qwc.Control;

            return(ddl?.SelectedValue);
        }
Beispiel #7
0
        public string GetValueAction(QuestionWebControl qwc)
        {
            var tb = (TextBox)qwc.Control;

            return(tb?.Text);
        }
Beispiel #8
0
        public string GetValueAction(QuestionWebControl qwc)
        {
            var rbl = (RadioButtonList)qwc.Control;

            return(rbl?.SelectedValue);
        }