protected void saveallquestion1()
        {
            check = false;

            if (rdobtnlstQ4.SelectedItem.Text.Trim() == "Other (Please specify)" && string.IsNullOrEmpty(txtQ4Explain.Text))
            {
                lblQ4Comment.Visible = true;
                lblQ4Comment.Text = "Required";
                check = true;
            }
            else
            {
                lblQ4Comment.Visible = false;
            }
            if (rdobtnlst_Yes_or_No.SelectedValue == "1")
            {
                if (!string.IsNullOrEmpty(chkbxlstQ5.SelectedValue))
                {
                    for (int x = 0; x < chkbxlstQ5.Items.Count; x++)
                    {
                        if (chkbxlstQ5.Items[x].Selected)
                        {
                            if ((chkbxlstQ5.Items[x].Text.Trim() == "Other, please specify:" && string.IsNullOrEmpty(txtQ5Explain.Text)))
                            {
                                lblQ5Comment.Visible = true;
                                lblQ5Comment.Text = "Required";
                                check = true;
                            }
                            else
                            {
                                lblQ5Comment.Visible = false;
                                //check = false;
                            }
                        }
                    }
                }
                else if (string.IsNullOrEmpty(chkbxlstQ5.SelectedValue))
                {
                    lblQ5Comment.Visible = true;
                    lblQ5Comment.Text = "Required";
                    check = true;
                }
            }  
            if (rdobtnlstQ6.SelectedItem.Text.Trim() == "Other (please specify)" && string.IsNullOrEmpty(txtQ6Explain.Text))
            {
                lblQ6Comment.Visible = true;
                lblQ6Comment.Text = "Required";
                check = true;
            }
            else
            {
                lblQ6Comment.Visible = false;
                //check = false;
            }         
            if (!string.IsNullOrEmpty(chkbxlstQ11.SelectedValue))
                {
                    for (int x = 0; x < chkbxlstQ11.Items.Count; x++)
                    {
                        if (chkbxlstQ11.Items[x].Selected)
                        {
                            if ((chkbxlstQ11.Items[x].Text.Trim() == "Other (please specify)" && string.IsNullOrEmpty(txtQ11_Other.Text)))
                            {
                                lblQ11Comment.Visible = true;
                                lblQ11Comment.Text = "Required";
                                check = true;
                            }
                            else
                            {
                                lblQ11Comment.Visible = false;
                            }
                        }
                    }
                }
                else if (string.IsNullOrEmpty(chkbxlstQ11.SelectedValue))
                {
                    lblQ11Comment.Visible = true;
                    lblQ11Comment.Text = "Required";
                    check = true;
                }            
            if (check == false)
            {
                lblQ6Comment.Visible = false;
                lblQ4Comment.Visible = false;
                lblQ5Comment.Visible = false;               
                lblQ11Comment.Visible = false;
               
                string sqlquery = "SELECT [Question_ID], [Question], Label_ID FROM [ISBEPI_DEV].[dbo].[PROGRAM_DIRECTOR_SURVEY_QUESTIONS] WHERE [Label_ID] IN ( 'lblQ12');";
                DataTable dt = DBHelper.GetDataTable(sqlquery);
                Label lblQ = new Label();

                //importing question 
                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    lblQ = this.Master.FindControl("ContentPlaceHolder1").FindControl(dt.Rows[x]["Label_ID"].ToString().Trim()) as Label;
                    lblQ.Text = dt.Rows[x]["Question"].ToString();
                }
                setGridRow();
                bindGrid_grdV2_label();
                bindGRid();

                // inserting answers to database            
                for (int r = 0; r < PD.GetData().Rows.Count; r++)
                {
                    string schdid = PD.GetData().Rows[r]["Schd_ID"].ToString();
                    string staffId = PD.GetData().Rows[r]["Staff_ID"].ToString();
                    if (schdid == hfSchdID.Value && staffId == hfStaffID.Value)
                    {
                        row = PD.GetData().Rows[r];
                        row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q1"] = txtQ1.Text;
                        row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q2"] = rdobtnlstQ2.SelectedValue;
                        row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q3"] = txtQ3.Text;
                        row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q4"] = rdobtnlstQ4.SelectedValue;
                        row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q4_Other"] = txtQ4Explain.Text;
                        if (rdobtnlst_Yes_or_No.SelectedValue == "1")
                        {
                            row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q5_Yes_or_no"] = true;
                        }
                        else
                        {
                            row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q5_Yes_or_no"] = false;
                        }
                        if (rdobtnlst_Yes_or_No.SelectedValue == "1")
                        {
                            for (int x = 0; x < chkbxlstQ5.Items.Count; x++)
                            {
                                //if (chkbxlstQ5.Items[x].Selected)
                                //{
                                    int add;
                                    if (x == chkbxlstQ5.Items.Count)
                                    {
                                        break;
                                    }
                                    else
                                    {
                                        add = x + 1;                                        
                                        row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q5_" + add] = chkbxlstQ5.Items[x].Selected;
                                        if (chkbxlstQ5.Items[x].Text.Trim() == "Other, please specify:")
                                        {
                                            row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q5_5_OTher"] = txtQ5Explain.Text;
                                        }
                                    }
                                //}                                    
                                //else
                                //{
                                //    int add;
                                //    add = x + 1;
                                //    row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q5_" + add] = DBNull.Value;
                                //}
                            }
                        }
                        row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q6"] = rdobtnlstQ6.SelectedItem.Value;
                        if (rdobtnlstQ6.SelectedItem.Text.Trim() == "Other (please specify)")
                        {
                            row["PD_DEMOGRAPHICS_BASICPROGRAMINFORMATION_Q6_Other"] = txtQ6Explain.Text;
                        }
                        row["PD_FAMILYINFORMATION_Q7"] = txtQ7.Text;


                        row["PD_FAMILYINFORMATION_Q8_1"] = txtQ8_1.Text;
                        row["PD_FAMILYINFORMATION_Q8_2"] = txtQ8_2.Text;
                        row["PD_FAMILYINFORMATION_Q8_3"] = txtQ8_3.Text;
                        row["PD_FAMILYINFORMATION_Q8_4"] = txtQ8_4.Text;
                        row["PD_FAMILYINFORMATION_Q8_5"] = txtQ8_5.Text;
                        row["PD_FAMILYINFORMATION_Q8_6"] = txtQ8_6.Text;
                        row["PD_FAMILYINFORMATION_Q8_7"] = txtQ8_7.Text;
                        toGetInfo gettotal = new toGetInfo();
                        gettotal.Set_total_1(Convert.ToInt32(txtQ8_1.Text) + Convert.ToInt32(txtQ8_2.Text) + Convert.ToInt32(txtQ8_3.Text)
                                            + Convert.ToInt32(txtQ8_4.Text) + Convert.ToInt32(txtQ8_5.Text) + Convert.ToInt32(txtQ8_6.Text)
                                            + Convert.ToInt32(txtQ8_7.Text));
                        txtQ8_Total.Text = gettotal.Get_total_1().ToString();
                        row["PD_FAMILYINFORMATION_Q8_Total"] = txtQ8_Total.Text;
                        row["PD_FAMILYINFORMATION_Q9_1"] = txtQ9_1.Text;
                        row["PD_FAMILYINFORMATION_Q9_2"] = txtQ9_2.Text;
                        row["PD_FAMILYINFORMATION_Q9_3"] = txtQ9_3.Text;
                        row["PD_FAMILYINFORMATION_Q9_4"] = txtQ9_4.Text;
                        row["PD_FAMILYINFORMATION_Q9_5"] = txtQ9_5.Text;
                        row["PD_FAMILYINFORMATION_Q9_6"] = txtQ9_6.Text;
                        gettotal.Set_total_2(Convert.ToInt32(txtQ9_1.Text) + Convert.ToInt32(txtQ9_2.Text) + Convert.ToInt32(txtQ9_3.Text)
                                            + Convert.ToInt32(txtQ9_4.Text) + Convert.ToInt32(txtQ9_5.Text) + Convert.ToInt32(txtQ9_6.Text));
                        txtQ9_Total.Text = gettotal.Get_total_2().ToString();
                        row["PD_FAMILYINFORMATION_Q9_Total"] = txtQ9_Total.Text;

                      
                        row["PD_FAMILYINFORMATION_Q10_1"] = txtQ10_1.Text;
                        row["PD_FAMILYINFORMATION_Q10_2"] = txtQ10_2.Text;
                        row["PD_FAMILYINFORMATION_Q10_3"] = txtQ10_3.Text;
                        row["PD_FAMILYINFORMATION_Q10_4"] = txtQ10_4.Text;
                        row["PD_FAMILYINFORMATION_Q10_5"] = txtQ10_5.Text;
                        gettotal.Set_total_3(Convert.ToInt32(txtQ10_1.Text) + Convert.ToInt32(txtQ10_2.Text) + Convert.ToInt32(txtQ10_3.Text)
                                            + Convert.ToInt32(txtQ10_4.Text) + Convert.ToInt32(txtQ10_5.Text));
                        txtQ10_Total.Text = gettotal.Get_total_3().ToString();
                        row["PD_FAMILYINFORMATION_Q10_Total"] = txtQ10_Total.Text;
                        for (int x = 0; x < chkbxlstQ11.Items.Count; x++)
                        {
                            //if (chkbxlstQ11.Items[x].Selected)
                            //{
                                int add;
                                if (x == chkbxlstQ11.Items.Count)
                                {
                                    break;
                                }
                                else
                                {
                                    add = x + 1;
                                    row["PD_FAMILYINFORMATION_Q11_" + add] = chkbxlstQ11.Items[x].Selected;
                                    if (chkbxlstQ11.Items[x].Text == "Other (please specify)")
                                    {
                                        row["PD_FAMILYINFORMATION_Q11_6_other"] = txtQ11_Other.Text;
                                    }
                                }

                            //}
                            //else
                            //{
                            //    int add;
                            //    add = x + 1;
                            //    row["PD_FAMILYINFORMATION_Q11_" + add] = DBNull.Value;
                            //}

                        }
                        PD.Update(row);
                    }                    
                }
            }
        }
        protected void imgV3F_Click(object sender, ImageClickEventArgs e)
        {
            bool check = false;

            if ((txtQ12.Text != "0") && string.IsNullOrEmpty(rdobtnlstQ12_1.SelectedValue) && string.IsNullOrEmpty(rdobtnlstQ12_2.SelectedValue) &&
                string.IsNullOrEmpty(rdobtnlstQ12_3.SelectedValue) && string.IsNullOrEmpty(rdobtnlstQ12_5.SelectedValue))
            {
                check = true;
                lblcommentQ12_1.Visible = true;
                lblcommentQ12_2.Visible = true;
                lblcommentQ12_3.Visible = true;
                lblcommentQ12_4.Visible = true;

                lblcommentQ12.Visible = true;
                lblcommentQ12_1.Text = "Required";
                lblcommentQ12_2.Text = "Required";
                lblcommentQ12_3.Text = "Required";
                lblcommentQ12_4.Text = "Required";
            }
            else
            {
                if (((!string.IsNullOrEmpty(rdobtnlstQ12_5.SelectedValue) && string.IsNullOrEmpty(txtq12_5_specify.Text)) ||
                    ((string.IsNullOrEmpty(rdobtnlstQ12_5.SelectedValue) && !string.IsNullOrEmpty(txtq12_5_specify.Text)))))
                {
                    check = true;
                    if (string.IsNullOrEmpty(rdobtnlstQ12_5.SelectedValue))
                    {
                        lblcommentQ12_5_1.Visible = true;
                    }
                    else
                    {
                        lblcommentQ12_5.Visible = true;
                    }

                }
                else
                {
                    lblcommentQ12_5.Visible = false;
                    lblcommentQ12_5_1.Visible = false;
                    check = false;
                }
            }
            if (check == false)
            {
                lblcommentQ12_1.Visible = false;
                lblcommentQ12_2.Visible = false;
                lblcommentQ12_3.Visible = false;
                lblcommentQ12_4.Visible = false;
                lblcommentQ12.Visible = false;

                toGetInfo getinfo = new toGetInfo();
                getinfo.Set_total_1(Convert.ToInt32(txt10_1.Text) + Convert.ToInt32(txt10_2.Text) + Convert.ToInt32(txt10_3.Text) + Convert.ToInt32(txt10_4.Text) + Convert.ToInt32(txt10_5.Text));
                txtQ10_total.Text = getinfo.Get_total_1().ToString();
                getinfo.Set_total_2(Convert.ToInt32(txt11_1.Text) + Convert.ToInt32(txt11_2.Text) + Convert.ToInt32(txt11_3.Text) + Convert.ToInt32(txt11_4.Text) + Convert.ToInt32(txt11_5.Text) + Convert.ToInt32(txt11_6.Text) + Convert.ToInt32(txt11_7.Text));
                txt11_Total.Text = getinfo.Get_total_2().ToString();
                MultiView1.ActiveViewIndex = 3;
            }

        }