Ejemplo n.º 1
0
        }//generateWithBootstrap()

        public StringBuilder generateNoBootstrap(NameValueCollection nvc)
        {
            StringBuilder code = new StringBuilder();

            code.Append("<form id=\"form\">\n");
            int numberOfSelects = Convert.ToInt32(nvc["numberOfSelects"]);

            for (int i = 0; i < numberOfSelects; i++)
            {
                if (nvc["select" + i] != "radio" && nvc["select" + i] != "checkbox" && nvc["select" + i] != "range")
                {
                    code.Append(GeneratedCode.simpleFieldNoBS(nvc["select" + i], nvc["input" + i]));
                }
                else if (nvc["select" + i] == "radio")
                {
                    int radioNumber = Convert.ToInt32(nvc["radioNumber" + i]);

                    code.Append("\t<label>" + nvc["radioGroupName" + i] + "</label><br>\n");

                    for (int j = 0; j < radioNumber; j++)
                    {
                        List <string> radioInputs = new List <string>();
                        radioInputs.Add(nvc["radio" + i + "input" + j]);
                        if (j == 0)
                        {
                            code.Append(GeneratedCode.radioFieldsNoBSChecked(radioInputs, i));
                        }
                        else
                        {
                            code.Append(GeneratedCode.radioFieldsNoBS(radioInputs, i));
                        }
                    }
                }
                else if (nvc["select" + i] == "checkbox")
                {
                    code.Append("\t<label>" + nvc["cboxGroupName" + i] + "</label><br>\n");
                    int cboxNumber = Convert.ToInt32(nvc["cboxNumber" + i]);
                    for (int j = 0; j < cboxNumber; j++)
                    {
                        List <string> cboxInputs = new List <string>();
                        cboxInputs.Add(nvc["cbox" + i + "input" + j]);
                        code.Append(GeneratedCode.cboxFieldsNoBS(nvc["cboxGroupName" + i], cboxInputs, i));
                    }
                }
                else if (nvc["select" + i] == "range")
                {
                    code.Append(GeneratedCode.rangeFieldNoBS(nvc["rangeName" + i], nvc["rangeMin" + i], nvc["rangeMax" + i]));
                }
            }
            code.Append("\t<input id=\"submitBtn\" type=\"submit\" value=\"" + nvc["submitButton"].Replace("\"", "") + "\" />\n");
            return(code);
        }//generateNoBootstrap()