예제 #1
0
    protected void getquestion()
    {
        Candidate_pros pros     = new Candidate_pros();
        List <string>  question = new List <string>();

        question    = pros.getFormQuestion(formId);
        Label5.Text = question.Count.ToString();

        for (int i = 0; i < question.Count; i++)
        {
            System.Drawing.Color c;
            if (i % 2 == 0)
            {
                c = System.Drawing.Color.LightBlue;
            }
            else
            {
                c = System.Drawing.Color.White;
            }
            TableRow qu = new TableRow();
            qu.Height = 40;
            TableCell number = new TableCell();
            TableCell q      = new TableCell();
            qu.BackColor = c;
            number.Text  = (i + 1).ToString() + "-";
            q.Text       = question[i];
            number.Width = 10;
            qu.Cells.Add(number);
            qu.Cells.Add(q);

            Table1.Rows.Add(qu);
        }
    }
예제 #2
0
    protected void getFormQuestion()
    {
        Candidate_pros pros     = new Candidate_pros();
        List <string>  question = new List <string>();

        formId   = pros.getFormId(positionId);
        question = pros.getFormQuestion(formId);

        for (int i = 0; i < question.Count; i++)
        {
            System.Drawing.Color c;
            if (i % 2 == 0)
            {
                c = System.Drawing.Color.LightBlue;
            }
            else
            {
                c = System.Drawing.Color.White;
            }
            TableRow  qu     = new TableRow();
            TableCell number = new TableCell();
            TableCell q      = new TableCell();
            qu.BackColor = c;
            number.Text  = (i + 1).ToString() + "-";
            q.Text       = question[i];
            number.Width = 10;
            qu.Cells.Add(number);
            qu.Cells.Add(q);

            Table1.Rows.Add(qu);

            TableRow  ans    = new TableRow();
            TableCell dump   = new TableCell();
            TableCell an     = new TableCell();
            TextBox   antext = new TextBox();
            ans.Height       = 40;
            antext.BackColor = c;
            ans.BackColor    = c;
            antext.Width     = 600;
            an.Controls.Add(antext);
            dump.Width = 10;
            ans.Cells.Add(dump);
            ans.Cells.Add(an);
            Table1.Rows.Add(ans);
        }
    }