protected void Page_Load(object sender, EventArgs e) { try { CamperAppl = new CamperApplication(); objGeneral = new General(); RadioButtonQ7Option1 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option1"); // <!-- Rajesh --> RadioButtonQ7Option2 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option2"); imgbtnCalStartDt.Attributes.Add("onclick", "return ShowCalendar('" + txtStartDate.ClientID + "');"); imgbtnCalEndDt.Attributes.Add("onclick", "return ShowCalendar('" + txtEndDate.ClientID + "');"); if (Session["STATUS"] != null) { if (Convert.ToInt32(Session["STATUS"].ToString()) == Convert.ToInt32(StatusInfo.SystemInEligible)) { lblEligibility.Visible = false; } else { lblEligibility.Visible = true; } } if (!(Page.IsPostBack)) { //get_States(); getCamps("0"); //to get all the camps and fill in //to get the FJCID which is stored in session if (Session["FJCID"] != null) { hdnFJCIDStep2_3.Value = (string)Session["FJCID"]; getCamperAnswers(); //Session["FJCID"] = null; //if (RadioButtonQ7Option1.Checked) //{ // btnChkEligibility.Enabled = false; //} } } RadioButtonQ7Option1.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg');"); RadioButtonQ7Option2.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg');"); //RadioButtonQ7Option3.Attributes.Add("onclick", "windowopen(this,'PnlQ8','PnlQ9','PnlQ10');"); //RadioButtonQ7Option4.Attributes.Add("onclick", "windowopen(this,'PnlQ8','PnlQ9','PnlQ10');"); //to enable / disable the panel states based on the radio button selected SetPanelStates(); } catch (Exception ex) { Response.Write(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { try { RadioButtonQ7Option1 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option1"); RadioButtonQ7Option2 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option2"); CamperAppl = new CamperApplication(); objGeneral = new General(); imgbtnCalStartDt.Attributes.Add("onclick", "return ShowCalendar('" + txtStartDate.ClientID + "');"); imgbtnCalEndDt.Attributes.Add("onclick", "return ShowCalendar('" + txtEndDate.ClientID + "');"); if (Session["STATUS"] != null) { if (Convert.ToInt32(Session["STATUS"].ToString()) == Convert.ToInt32(StatusInfo.SystemInEligible)) { lblEligibility.Visible = false; } else { lblEligibility.Visible = true; } } if (!(Page.IsPostBack)) { //Added by Ram if (Session["FedId"] != null) { getCamps(Session["FedId"].ToString(), Master.CampYear);//to get all camps for this federation } else { getCamps("0", Master.CampYear); //to get all the camps and fill in } //to get the FJCID which is stored in session if (Session["FJCID"] != null) { hdnFJCIDStep2_3.Value = (string)Session["FJCID"]; getCamperAnswers(); } } RadioButtonQ7Option1.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg');"); RadioButtonQ7Option2.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg');"); //to enable / disable the panel states based on the radio button selected SetPanelStates(); } catch (Exception ex) { Response.Write(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { try { CamperAppl = new CamperApplication(); objGeneral = new General(); RadioButtonQ7Option1 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option1"); RadioButtonQ7Option2 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option2"); imgbtnCalStartDt.Attributes.Add("onclick", "return ShowCalendar('" + txtStartDate.ClientID + "');"); imgbtnCalEndDt.Attributes.Add("onclick", "return ShowCalendar('" + txtEndDate.ClientID + "');"); if (Session["STATUS"] != null) { divStatusMessageBox.Visible = Convert.ToInt32(Session["STATUS"].ToString()) != Convert.ToInt32(StatusInfo.SystemInEligible); } if (!(Page.IsPostBack)) { GetCamps("0"); if (Session["FJCID"] != null) { hdnFJCIDStep2_3.Value = (string)Session["FJCID"]; getCamperAnswers(); } } RadioButtonQ7Option1.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg','',true);"); RadioButtonQ7Option2.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg','',true);"); SetPanelStates(); } catch (Exception ex) { Response.Write(ex.Message); } }
//to get the camper answers from the database void getCamperAnswers() { string strFJCID; DataSet dsAnswers; int iCount; DataView dv; RadioButton rb; string strFilter; strFJCID = hdnFJCIDStep2_3.Value; if (!strFJCID.Equals(string.Empty)) { dsAnswers = CamperAppl.getCamperAnswers(strFJCID, "9", "12", "N"); if (dsAnswers.Tables[0].Rows.Count > 0) //if there are records for the current FJCID { dv = dsAnswers.Tables[0].DefaultView; //to display answers for the QuestionId from 1001 - 1004 in Other info page for (int i = 9; i <= 12; i++) { strFilter = "QuestionId = '" + i.ToString() + "'"; iCount = dsAnswers.Tables[0].Rows.Count; switch (i) { case 9: //assigning the answer for question 9 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["OptionID"].Equals(DBNull.Value)) { rb = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option" + dr["OptionID"].ToString()); rb.Checked = true; } } break; case 10: // assigning the answer for question 10 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["OptionID"].Equals(DBNull.Value)) { switch (dr["OptionID"].ToString()) { case "2": //for camp ddlCamp.SelectedValue = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); break; } } } break; case 11: // assigning the answer for question 11 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["Answer"].Equals(DBNull.Value)) { txtCampSession.Text = dr["Answer"].ToString(); } } break; case 12: // assigning the answer for question 12 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["OptionID"].Equals(DBNull.Value)) { switch (dr["OptionID"].ToString()) { case "1": //for Start Date txtStartDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); break; case "2": //for End Date txtEndDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); break; } } } break; } } } } //end if for null check of fjcid }
protected void Page_Load(object sender, EventArgs e) { CamperAppl = new CamperApplication(); objGeneral = new General(); RadioButtonQ7Option1 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option1"); // <!-- Rajesh --> RadioButtonQ7Option2 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option2"); imgbtnCalStartDt.Attributes.Add("onclick", "return ShowCalendar('" + txtStartDate.ClientID + "');"); imgbtnCalEndDt.Attributes.Add("onclick", "return ShowCalendar('" + txtEndDate.ClientID + "');"); if (Session["STATUS"] != null) { if (Convert.ToInt32(Session["STATUS"].ToString()) == Convert.ToInt32(StatusInfo.SystemInEligible)) { lblEligibility.Visible = false; } else { lblEligibility.Visible = true; } } if (Session["CampID"] != null) { campID = Session["CampID"].ToString(); } else if (Session["FJCID"] != null) { DataSet dsCamperDetails = CamperAppl.getCamperAnswers(Session["FJCID"].ToString(), "10", "10", "N"); if (dsCamperDetails.Tables[0].Rows.Count > 0) { foreach (DataRow dr in dsCamperDetails.Tables[0].Rows) { if (!dr["QuestionID"].Equals(DBNull.Value) && dr["QuestionID"].ToString() == "10") { if (!dr["OptionID"].Equals(DBNull.Value) && dr["OptionID"].ToString() == "2") { if (!dr["Answer"].Equals(DBNull.Value)) { campID = dr["Answer"].ToString(); } } } } } } if (!(Page.IsPostBack)) { DataSet dsCamps = objGeneral.GetCampByCampID(campID); if (dsCamps.Tables[0].Rows.Count > 0) { for (int i = 0; i < dsCamps.Tables[0].Rows.Count; i++) { if (dsCamps.Tables[0].Rows[i]["Camp"].ToString().IndexOf("California") != -1) { Qincrement = 1; hdnQNoIncrement.Value = Qincrement.ToString(); } } } //increment question nos by 1 if the camp selected is california if (Qincrement != 0) { Label14.Text = Convert.ToString(Int32.Parse(Label14.Text) + Qincrement); Label18.Text = Convert.ToString(Int32.Parse(Label18.Text) + Qincrement); Label22.Text = Convert.ToString(Int32.Parse(Label22.Text) + Qincrement); Label25.Text = Convert.ToString(Int32.Parse(Label25.Text) + Qincrement); } //get_States(); getCamps("0"); //to get all the camps and fill in //to get the FJCID which is stored in session if (Session["FJCID"] != null) { hdnFJCIDStep2_3.Value = (string)Session["FJCID"]; getCamperAnswers(); } } RadioButtonQ7Option1.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg','',true);"); RadioButtonQ7Option2.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg','',true);"); SetPanelStates(); }
//to get the camper answers from the database void getCamperAnswers() { string strFJCID; DataSet dsAnswers; int iCount; DataView dv; RadioButton rb; string strFilter; strFJCID = hdnFJCIDStep2_3.Value; if (!strFJCID.Equals(string.Empty)) { dsAnswers = CamperAppl.getCamperAnswers(strFJCID, "9", "12", "N"); if (dsAnswers.Tables[0].Rows.Count > 0) //if there are records for the current FJCID { dv = dsAnswers.Tables[0].DefaultView; //to display answers for the QuestionId from 1001 - 1004 in Other info page for (int i = 9; i <= 12; i++) { strFilter = "QuestionId = '" + i.ToString() + "'"; iCount = dsAnswers.Tables[0].Rows.Count; switch (i) { case 9: //assigning the answer for question 9 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["OptionID"].Equals(DBNull.Value)) { //rb = (RadioButton)Panel2.FindControl("RadioButtonQ7Option" + dr["OptionID"].ToString()); //rb.Checked = true; rb = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option" + dr["OptionID"].ToString()); rb.Checked = true; } } break; case 10: // assigning the answer for question 10 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["OptionID"].Equals(DBNull.Value)) { switch (dr["OptionID"].ToString()) { case "2": //for camp ddlCamp.SelectedValue = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); if (ddlCamp.SelectedItem != null) { string campIDLast3Digits = ddlCamp.SelectedItem.Value.Substring(ddlCamp.SelectedItem.Value.Length - 3); if (campIDLast3Digits == "132" || campIDLast3Digits == "133" || campIDLast3Digits == "190") { //lblSessionDays.Text = "<font color='red'><b>In order to be eligible for the incentive grant, camper must attend camp for at least 12 consecutive days.</b></font>"; } } break; } } } break; case 11: // assigning the answer for question 11 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["Answer"].Equals(DBNull.Value)) { txtCampSession.Text = dr["Answer"].ToString(); } } break; case 12: // assigning the answer for question 12 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["OptionID"].Equals(DBNull.Value)) { switch (dr["OptionID"].ToString()) { case "1": //for Start Date txtStartDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); break; case "2": //for End Date txtEndDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); break; } } } break; } } } } //end if for null check of fjcid }
protected void Page_Load(object sender, EventArgs e) { try { CamperAppl = new CamperApplication(); objGeneral = new General(); RadioButtonQ7Option1 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option1"); // <!-- Rajesh --> RadioButtonQ7Option2 = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option2"); imgbtnCalStartDt.Attributes.Add("onclick", "return ShowCalendar('" + txtStartDate.ClientID + "');"); imgbtnCalEndDt.Attributes.Add("onclick", "return ShowCalendar('" + txtEndDate.ClientID + "');"); if (Session["STATUS"] != null) { if (Convert.ToInt32(Session["STATUS"].ToString()) == Convert.ToInt32(StatusInfo.SystemInEligible)) { lblEligibility.Visible = false; } else { lblEligibility.Visible = true; } } if (!(Page.IsPostBack)) { //Added by Ram if (Session["FedId"] != null) { getCamps((string)Session["FedId"], Master.CampYear);//to get all camps for this federation } else { getCamps("0", Master.CampYear); //to get all the camps and fill in } //getCamps("0"); //to get all the camps and fill in //to get the FJCID which is stored in session if (Session["FJCID"] != null) { hdnFJCIDStep2_3.Value = (string)Session["FJCID"]; getCamperAnswers(); //Session["FJCID"] = null; } } RadioButtonQ7Option1.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg','',true);"); RadioButtonQ7Option2.Attributes.Add("onclick", "JavaScript:popupCall(this,'noCampRegistrationMsg','',true);"); //RadioButtonQ7Option3.Attributes.Add("onclick", "windowURJopen(this,'PnlQ8','PnlQ9','PnlQ10');"); //RadioButtonQ7Option4.Attributes.Add("onclick", "windowURJopen(this,'PnlQ8','PnlQ9','PnlQ10');"); //to enable / disable the panel states based on the radio button selected SetPanelStates(); //added to display name of federation /*if ((String)Session["CampID"] == "2110") * campName.Text = "Cedar Lake Camp (New Jersey Y Camps)";*/ campName.Text = ddlCamp.SelectedItem.Text; } catch (Exception ex) { Response.Write(ex.Message); } }
//to get the camper answers from the database void getCamperAnswers() { DataSet dsAnswers, dsAcknowledge; int iCount; DataView dv; RadioButton rb; TextBox tb; DropDownList ddl; HiddenField hdnval; DataRow dr1; DataRow[] drows; string strFilter, strFJCID, strModifiedBy; strFJCID = hdnFJCID.Value; strModifiedBy = Master.UserId; if (!strFJCID.Equals(string.Empty)) { dsAnswers = CamperAppl.getCamperAnswers(strFJCID, "9", "12", "N"); //to set the acknowledgement flag by getting the value from the database dsAcknowledge = CamperAppl.getCamperApplication(strFJCID); if (dsAcknowledge.Tables[0].Rows.Count > 0) { if (!dsAcknowledge.Tables[0].Rows[0]["confirm4"].Equals(DBNull.Value)) { chkAcknowledgement.Checked = (Boolean)dsAcknowledge.Tables[0].Rows[0]["confirm4"]; } } //end of setting the acknowledgement flag if (dsAnswers.Tables[0].Rows.Count > 0) //if there are records for the current FJCID { dv = dsAnswers.Tables[0].DefaultView; //to display answers for the QuestionId from 6 - 9 for (int i = 7; i <= 10; i++) { //to get the QuestionId for the Questions hdnval = (HiddenField)PnlHidden.FindControl("hdnQ" + i.ToString() + "Id"); strFilter = "QuestionId = '" + hdnval.Value + "'"; iCount = dsAnswers.Tables[0].Rows.Count; tb = null; rb = null; ddl = null; switch (i) { case 7: //assigning the answer for question 7 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["OptionID"].Equals(DBNull.Value)) { //rb = (RadioButton)Panel2.FindControl("RadioButtonQ7Option" + dr["OptionID"].ToString()); //rb.Checked = true; rb = (RadioButton)RegControls1.FindControl("RadioButtonQ7Option" + dr["OptionID"].ToString()); rb.Checked = true; } } break; case 8: // assigning the answer for question 8 ddl = ddlCamp; goto default; case 9: // assigning the answer for question 9 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["Answer"].Equals(DBNull.Value)) { txtCampSession.Text = dr["Answer"].ToString(); } } break; //ddl = ddlCampSession; //getCampSession(ddlCamp.SelectedValue); //goto default; case 10: // assigning the answer for question 10 foreach (DataRow dr in dv.Table.Select(strFilter)) { if (!dr["OptionID"].Equals(DBNull.Value)) { switch (dr["OptionID"].ToString()) { case "1": //for Start Date //lblStartDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); txtStartDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); break; case "2": //for End Date //lblEndDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); txtEndDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); break; } } /*if (!dr["OptionID"].Equals(DBNull.Value)) * { * switch (dr["OptionID"].ToString()) * { * case "1": //for Start Date * //txtStartDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); * break; * case "2": //for End Date * //txtEndDate.Text = dr["Answer"].Equals(DBNull.Value) ? "" : dr["Answer"].ToString(); * break; * } * }*/ } break; default: //to implement the common logic drows = dv.Table.Select(strFilter); if (drows.Length > 0) //if there are rows for the filter { dr1 = (DataRow)drows.GetValue(0); if (ddl != null) { if (!dr1["OptionID"].Equals(DBNull.Value)) { ddl.SelectedValue = dr1["OptionID"].ToString(); } } /*if (tb != null) * { * if (!dr1["Answer"].Equals(DBNull.Value)) * tb.Text = dr1["Answer"].ToString(); * }*/ } break; } } } } //end if for null check of fjcid }