Esempio n. 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            using (PoslovniKlubBL temp = new PoslovniKlubBL())
            {
                TextBox tb1 = null;
                TextBox tb2 = null;
                TextBox tb3 = null;
                TextBox tb4 = null;
                TextBox tb5 = null;
                TextBox tb6 = null;
                TextBox tb7 = null;
                TextBox tb8 = null;
                TextBox tb9 = null;
                TextBox tb10 = null;
                TextBox tb11 = null;
                TextBox tb12 = null;
                TextBox tb13 = null;
                TextBox tb14 = null;
                TextBox tb15 = null;
                TextBox tb16 = null;
                TextBox tb17 = null;
                TextBox tb18 = null;
                TextBox tb19 = null;
                TextBox tb20 = null;

                ListViewItem Item = null;
                foreach (ListViewDataItem item in ListView1.Items)
                {
                    Item = item;
                    tb1 = ((TextBox)(Item.FindControl("txtQ1")));
                    tb2 = ((TextBox)(Item.FindControl("txtQ2")));
                    tb3 = ((TextBox)(Item.FindControl("txtQ3")));
                    tb4 = ((TextBox)(Item.FindControl("txtQ4")));
                    tb5 = ((TextBox)(Item.FindControl("txtQ5")));
                    tb6 = ((TextBox)(Item.FindControl("txtQ6")));
                    tb7 = ((TextBox)(Item.FindControl("txtQ7")));
                    tb8 = ((TextBox)(Item.FindControl("txtQ8")));
                    tb9 = ((TextBox)(Item.FindControl("txtQ9")));
                    tb10 = ((TextBox)(Item.FindControl("txtQ10")));
                    tb11 = ((TextBox)(Item.FindControl("txtQ11")));
                    tb12 = ((TextBox)(Item.FindControl("txtQ12")));
                    tb13 = ((TextBox)(Item.FindControl("txtQ13")));
                    tb14 = ((TextBox)(Item.FindControl("txtQ14")));
                    tb15 = ((TextBox)(Item.FindControl("txtQ15")));
                    tb16 = ((TextBox)(Item.FindControl("txtQ16")));
                    tb17 = ((TextBox)(Item.FindControl("txtQ17")));
                    tb18 = ((TextBox)(Item.FindControl("txtQ18")));
                    tb19 = ((TextBox)(Item.FindControl("txtQ19")));
                    tb20 = ((TextBox)(Item.FindControl("txtQ20")));
                }

                if (tb1.Text != null && tb1.Text != "")
                {
                    int a = ddlAnkete.SelectedIndex;
                    temp.SpremiOdgovore(tb1.Text, tb2.Text, tb3.Text, tb4.Text, tb5.Text, tb6.Text, tb7.Text, tb8.Text,
                        tb9.Text, tb10.Text, tb11.Text, tb12.Text, tb13.Text, tb14.Text, tb15.Text, tb16.Text,
                        tb17.Text, tb18.Text, tb19.Text, tb20.Text, a);
                    ResetFields();
                }
                else
                    ClientScript.RegisterStartupScript(this.GetType(), "Greška!", "alert('Nije popunjena anketa!');", true);
            }
        }