protected void Display() { toGetInfo getinfo = new toGetInfo(); hfSchdID.Value = getinfo.getSchdID(); hfSIteID.Value = getinfo.getValueSiteID(); hfStaffID.Value = Session["staffid"].ToString(); Session["staffid"] = null; getinfo.setSchdID(null); getinfo.setSiteID(null); if (hfSIteID.Value.Length > 0 && hfSchdID.Value.Length > 0) { string sqlquery = "SELECT [Question_ID], [Question], Label_ID FROM [ISBEPI_DEV].[dbo].[PROGRAM_DIRECTOR_SURVEY_QUESTIONS] WHERE [Label_ID] IN ( 'lblQ1','lblQ2','lblQ3','lblQ4','lblQ5','lblQ6','lblQ7','lblQ8','lblQ9','lblQ10','lblQ11');"; DataTable dt = DBHelper.GetDataTable(sqlquery); Label lblQ = new Label(); for (int x = 0; x < dt.Rows.Count; x++) { if (dt.Rows[x]["Question_ID"].ToString().Trim() == "Q7") { lblQ = this.Master.FindControl("ContentPlaceHolder1").FindControl(dt.Rows[x]["Label_ID"].ToString().Trim()) as Label; const int july = 7; //const int june = 1; if (DateTime.Now.Month == july) { string update = dt.Rows[x]["Question"].ToString().Replace("July 2014-June 2015", "July " + DateTime.Now.Year.ToString() + "-June " + DateTime.Now.AddYears(1).Year.ToString() + ""); string sqlupdate = "UPDATE [PROGRAM_DIRECTOR_SURVEY_QUESTIONS] SET [Question] ='" + update + "' WHERE Question_ID ='Q7'"; DBHelper.ExecuteSQL(sqlupdate); string sqlqueryq7 = "SELECT * FROM [PROGRAM_DIRECTOR_SURVEY_QUESTIONS] WHERE Question_ID ='Q7'"; DataTable dtq7 = DBHelper.GetDataTable(sqlqueryq7); lblQ.Text = dtq7.Rows[0]["Question"].ToString(); } else { lblQ.Text = dt.Rows[x]["Question"].ToString(); } } else { lblQ = this.Master.FindControl("ContentPlaceHolder1").FindControl(dt.Rows[x]["Label_ID"].ToString().Trim()) as Label; lblQ.Text = dt.Rows[x]["Question"].ToString(); } } lblQ5_Yes_or_No.Text = "Do you Speak any languages, other than English, that you speak fluently?"; } else { Response.Redirect("~/ProgramDirector/default.aspx"); } }
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 btnSubmit_Click(object sender, EventArgs e) { check = false; if (chkbxlstQ27.SelectedValue.Length > 0 || chkbxlstQ27.SelectedValue.Length < 1) { if (chkbxlstQ27.SelectedValue.Length < 1) { lblQ27Comment.Visible = true; lblQ27Comment.Text = "Required"; check = true; } else { for (int x = 0; x < chkbxlstQ27.Items.Count; x++) { if (chkbxlstQ27.Items[x].Selected) { if ((chkbxlstQ27.Items[x].Value == "4" && txtQ27Explain.Text.Length < 1)) { lblQ28Comment.Visible = true; lblQ27Comment.Text = "Required"; check = true; } } } } } if (chkbxlstQ28.SelectedValue.Length < 1) { lblQ28Comment.Visible = true; lblQ28Comment.Text = "Required"; check = true; } if (chkbxlstQ29.SelectedValue.Length < 1) { lblQ29Comment.Visible = true; lblQ29Comment.Text = "Required"; check = true; } if (chkbxlstQ30.SelectedValue.Length < 1) { lblQ30Comment.Visible = true; lblQ30Comment.Text = "Required"; check = true; } if (chkbxlstQ31.SelectedValue.Length < 1) { lblQ31Comment.Visible = true; lblQ31Comment.Text = "Required"; check = true; } if (chkbxlstQ32.SelectedValue.Length < 1) { lblQ32Comment.Visible = true; lblQ32Comment.Text = "Required"; check = true; } if (chkbxlstQ33.SelectedValue.Length < 1) { lblQ33Comment.Visible = true; lblQ33Comment.Text = "Required"; check = true; } if (chkbxlstQ34.SelectedValue.Length < 1) { lblQ34Comment.Visible = true; lblQ34Comment.Text = "Required"; check = true; } if (chkbxlstQ35.SelectedValue.Length < 1) { lblQ35Comment.Visible = true; lblQ35Comment.Text = "Required"; check = true; } if (check == false) { lblQ27Comment.Visible = false; lblQ28Comment.Visible = false; lblQ29Comment.Visible = false; lblQ30Comment.Visible = false; lblQ31Comment.Visible = false; lblQ32Comment.Visible = false; lblQ33Comment.Visible = false; lblQ34Comment.Visible = false; lblQ35Comment.Visible = false; for (int r = 0; r < PD.GetData().Rows.Count; r++) { if (PD.GetData().Rows[r]["Schd_ID"].ToString() == hfSchdID.Value && hfStaffID.Value == PD.GetData().Rows[r]["Staff_ID"].ToString()) { row = PD.GetData().Rows[r]; //Q27 for (int x = 0; x < chkbxlstQ27.Items.Count; x++) { int add; //if (chkbxlstQ27.Items[x].Selected) //{ if (x == chkbxlstQ27.Items.Count) { break; } else { add = x + 1; row["PD_DataCollectionProcess_Q27_" + add] = chkbxlstQ27.Items[x].Selected; } //} //else //{ // add = x + 1; // row["PD_DataCollectionProcess_Q27_" + add] = DBNull.Value; //} } row["PD_DataCollectionProcess_Q27_other"] = txtQ27Explain.Text; //Q28 for (int x = 0; x < chkbxlstQ28.Items.Count; x++) { int add; //if (chkbxlstQ28.Items[x].Selected) //{ if (x == chkbxlstQ28.Items.Count) { break; } else { add = x + 1; row["PD_DataCollectionProcess_Q28_" + add] = chkbxlstQ28.Items[x].Selected; } //} //else //{ // add = x + 1; // row["PD_DataCollectionProcess_Q28_" + add] = DBNull.Value; //} } //Q29 for (int x = 0; x < chkbxlstQ29.Items.Count; x++) { int add; //if (chkbxlstQ29.Items[x].Selected) //{ if (x == chkbxlstQ29.Items.Count) { break; } else { add = x + 1; row["PD_DataCollectionProcess_Q29_" + add] = chkbxlstQ29.Items[x].Selected; } //} //else //{ // add = x + 1; // row["PD_DataCollectionProcess_Q29_" + add] = DBNull.Value; //} } //Q30 for (int x = 0; x < chkbxlstQ30.Items.Count; x++) { int add; //if (chkbxlstQ30.Items[x].Selected) //{ if (x == chkbxlstQ30.Items.Count) { break; } else { add = x + 1; row["PD_DataCollectionProcess_Q30_" + add] = chkbxlstQ30.Items[x].Selected; } //} //else //{ // add = x + 1; // row["PD_DataCollectionProcess_Q30_" + add] = DBNull.Value; //} } //Q31 for (int x = 0; x < chkbxlstQ31.Items.Count; x++) { int add; //if (chkbxlstQ31.Items[x].Selected) //{ if (x == chkbxlstQ31.Items.Count) { break; } else { add = x + 1; row["PD_DataCollectionProcess_Q31_" + add] = chkbxlstQ31.Items[x].Selected; } //} //else //{ // add = x + 1; // row["PD_DataCollectionProcess_Q31_" + add] = DBNull.Value; //} } //Q32 for (int x = 0; x < chkbxlstQ32.Items.Count; x++) { int add; //if (chkbxlstQ32.Items[x].Selected) //{ if (x == chkbxlstQ32.Items.Count) { break; } else { add = x + 1; row["PD_DataCollectionProcess_Q32_" + add] = chkbxlstQ32.Items[x].Selected; } //} //else //{ // add = x + 1; // row["PD_DataCollectionProcess_Q32_" + add] = DBNull.Value; //} } //Q33 for (int x = 0; x < chkbxlstQ33.Items.Count; x++) { int add; //if (chkbxlstQ33.Items[x].Selected) //{ if (x == chkbxlstQ33.Items.Count) { break; } else { add = x + 1; row["PD_DataCollectionProcess_Q33_" + add] = chkbxlstQ33.Items[x].Selected; } //} //else //{ // add = x + 1; // row["PD_DataCollectionProcess_Q33_" + add] = DBNull.Value; //} } //Q34 for (int x = 0; x < chkbxlstQ34.Items.Count; x++) { int add; //if (chkbxlstQ34.Items[x].Selected) //{ if (x == chkbxlstQ34.Items.Count) { break; } else { add = x + 1; row["PD_DataCollectionProcess_Q34_" + add] = chkbxlstQ34.Items[x].Selected; } //} //else //{ // add = x + 1; // row["PD_DataCollectionProcess_Q34_" + add] = DBNull.Value; //} } //Q35 for (int x = 0; x < chkbxlstQ35.Items.Count; x++) { int add; //if (chkbxlstQ35.Items[x].Selected) //{ if (x == chkbxlstQ35.Items.Count) { break; } else { add = x + 1; row["PD_DataCollectionProcess_Q35_" + add] = chkbxlstQ35.Items[x].Selected; } //} //else //{ // add = x + 1; // row["PD_DataCollectionProcess_Q35_" + add] = DBNull.Value; //} } //row["Completed"] = "Completed"; //row["CompletedDate"] = DateTime.Now.ToShortDateString(); PD.Update(row); } } toGetInfo getinfo = new toGetInfo(); getinfo.setSchdID(hfSchdID.Value ); getinfo.setSiteID(hfSIteID.Value); Session["Staff_ID"] = hfStaffID.Value; Response.Redirect("~/ProgramDirector/PD_Review.aspx"); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now.AddDays(-1)); Response.Cache.SetNoStore(); } }
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; } }