public override bool checkEligibility(string FJCID, out int StatusValue) { StatusValue = 0; int daysInCamp; double Amount = 0.00; if (checkEligibilityCommon(FJCID, out StatusValue)) { return(true); } CamperApplication oCA = new CamperApplication(); daysInCamp = DaysInCamp(FJCID); StatusValue = StatusBasedOnGrade(FJCID, StatusValue); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } StatusValue = StatusBasedOnSchool(FJCID, StatusValue); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } StatusValue = StatusBasedOnSibling(FJCID, StatusValue); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } StatusValue = StatusBasedOnCamp(FJCID, StatusValue); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } //actually we should not have this status - the UI does not allow NEXT //if a camp was not selected else if (StatusValue == Convert.ToInt32(StatusInfo.EligibleNoCamp)) { if (TimeInCamp(FJCID) == 1) { Amount = 1500.00; oCA.UpdateAmount(FJCID, Amount, 0, ""); return(true); } else if (TimeInCamp(FJCID) == 2) { Amount = 500.00; oCA.UpdateAmount(FJCID, Amount, 0, ""); return(true); } } //daysInCamp = DaysInCamp(FJCID); if (daysInCamp > 0) { Amount = getCamperGrant(FJCID, daysInCamp, out StatusValue); } oCA.UpdateAmount(FJCID, Amount, 0, ""); return(true); //int FirstTimeCamperOption = 0; //int SecondTimeCamperOption = 0; //int IncentiveOption = 0; //Boolean FirstTimeCamper = false; //Boolean SecondTimeCamper = false; ////int JewishSchool = 0; ////int Grade = 0; //StatusValue = 0; //double Amount = 0.00; //if (checkEligibilityCommon(FJCID, out StatusValue)) //{ // return true; //} //CamperApplication oCA = new CamperApplication(); ////Is this your first time to attend a Non-profit Jewish overnight camp, for 3 weeks or longer: //DataSet dsFirstTimeCamper; //dsFirstTimeCamper = oCA.getCamperAnswers(FJCID, "23", "23", "N"); //DataRow drFTC; //if (dsFirstTimeCamper.Tables[0].Rows.Count > 0) //{ // drFTC = dsFirstTimeCamper.Tables[0].Rows[0]; // FirstTimeCamperOption = Convert.ToInt32(drFTC["OptionID"]); // if (FirstTimeCamperOption == 2) // { // DataSet dsSecondTimeCamper; // dsSecondTimeCamper = oCA.getCamperAnswers(FJCID, "24", "24", "N"); // DataRow drSTC; // if (dsSecondTimeCamper.Tables[0].Rows.Count > 0) // { // drSTC = dsSecondTimeCamper.Tables[0].Rows[0]; // if (!string.IsNullOrEmpty(drSTC["OptionID"].ToString())) // { // SecondTimeCamperOption = Convert.ToInt32(drSTC["OptionID"]); // if (SecondTimeCamperOption == 2) // { // StatusValue = (int)StatusInfo.SystemInEligible; // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // DataSet dsThirdTimeCamper; // dsThirdTimeCamper = oCA.getCamperAnswers(FJCID, "21", "21", "N"); // DataRow drTTC; // if (dsThirdTimeCamper.Tables[0].Rows.Count > 0) // { // drTTC = dsThirdTimeCamper.Tables[0].Rows[0]; // IncentiveOption = Convert.ToInt32(drTTC["OptionID"]); // if (IncentiveOption == 2) // { // StatusValue = (int)StatusInfo.SystemInEligible; // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // StatusValue = (int)StatusInfo.SystemEligible; // SecondTimeCamper = true; // } // } // } // } // } // } // else // { // FirstTimeCamper = true; // StatusValue = (int)StatusInfo.SystemEligible; // } //} //DataSet dsIncentiveGrant; //dsIncentiveGrant = oCA.getCamperAnswers(FJCID, "22", "22", "N"); //DataRow drIncentiveGrant; //int SiblingIncentiveOption = 0; //if (FirstTimeCamper) //{ // if (dsIncentiveGrant.Tables[0].Rows.Count > 0) // { // drIncentiveGrant = dsIncentiveGrant.Tables[0].Rows[0]; // SiblingIncentiveOption = Convert.ToInt32(drIncentiveGrant["OptionID"]); // if (SiblingIncentiveOption == 1) // { // StatusValue = (int)StatusInfo.SystemInEligible; // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // StatusValue = (int)StatusInfo.SystemEligible; // } // } //} ////Camp check //DataSet dsCamp; //dsCamp = oCA.getCamperAnswers(FJCID, "10", "10", "N"); //DataRow drCamp; //int CampID = 0; //if (dsCamp.Tables[0].Rows.Count > 0) //{ // drCamp = dsCamp.Tables[0].Rows[0]; // // Camper Camp value is null // if (DBNull.Value.Equals(drCamp["OptionID"])) // { // StatusValue = Convert.ToInt32(StatusInfo.EligibleNoCamp); // if (FirstTimeCamper) // { // Amount = 1500.00; // } // if (SecondTimeCamper) // { // Amount = 500.00; // } // oCA.UpdateAmount(FJCID, Amount, 0, ""); // return true; // } // else // { // CampID = Convert.ToInt32(drCamp["OptionID"]); // if (CampID == 0) // { // StatusValue = Convert.ToInt32(StatusInfo.EligibleNoCamp); // if (FirstTimeCamper) // { // Amount = 1500.00; // } // if (SecondTimeCamper) // { // Amount = 500.00; // } // oCA.UpdateAmount(FJCID, Amount, 0, ""); // return true; // } // else // { // StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); // } // } //} ////Camp Session check - Eligible only if registered for 21 days //DataSet dsCampSession; //dsCampSession = oCA.getCamperAnswers(FJCID, "12", "12", "N"); //DataRow drStartDate; //DataRow drEndDate; //if (dsCampSession.Tables[0].Rows.Count > 1) //{ // drStartDate = dsCampSession.Tables[0].Rows[0]; // drEndDate = dsCampSession.Tables[0].Rows[1]; // if (!string.IsNullOrEmpty(drStartDate["Answer"].ToString())) // { // string strStartDate = Convert.ToString(drStartDate["Answer"]); // string strEndDate = Convert.ToString(drEndDate["Answer"]); // DateTime dtStartDate = Convert.ToDateTime(strStartDate); // DateTime dtEndDate = Convert.ToDateTime(strEndDate); // //int iDays = DateTime. // TimeSpan span = dtEndDate.Subtract(dtStartDate); // int iDays = span.Days + 1; // if (iDays < 19) // { // StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); // oCA.UpdateAmount(FJCID, Amount, 0, ""); // return true; // } // else // { // StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); // if (FirstTimeCamper) // { // Amount = 1500.00; // } // if (SecondTimeCamper) // { // Amount = 500.00; // } // } // } // // update amount in the database // oCA.UpdateAmount(FJCID, Amount, 0, ""); //} //return true; }
public override bool checkEligibility(string FJCID, out int StatusValue) { StatusValue = 0; int daysInCamp; double Amount = 0.00; if (checkEligibilityCommon(FJCID, out StatusValue)) { return(true); } CamperApplication oCA = new CamperApplication(); StatusValue = StatusBasedOnGrade(FJCID, StatusValue); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } StatusValue = StatusBasedOnSchool(FJCID, StatusValue); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } StatusValue = StatusBasedOnCamp(FJCID, StatusValue); if (StatusValue != Convert.ToInt32(StatusInfo.SystemEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } daysInCamp = DaysInCamp(FJCID); if (daysInCamp > 0) { Amount = getCamperGrant(FJCID, daysInCamp, out StatusValue); } else { StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); Amount = 0; } oCA.UpdateAmount(FJCID, Amount, 0, ""); return(true); ////int Age = 0; ////DateTime dBirthDate; //int FirstTimeCamperOption = 0; //int JewishSchoolOption = 0; //StatusValue = 0; //int Grade = 0; //Boolean FirstTimeCamper = false; //Boolean SecondTimeCamper = false; //if (checkEligibilityCommon(FJCID, out StatusValue)) //{ // return true; //} //CamperApplication oCA = new CamperApplication(); ////Grade check //DataSet dsGrade; //dsGrade = oCA.getCamperAnswers(FJCID, "6", "6", "N"); //DataRow drGrade; //if (dsGrade.Tables[0].Rows.Count > 0) //{ // drGrade = dsGrade.Tables[0].Rows[0]; // if (DBNull.Value.Equals(drGrade["Answer"])) // { // StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // // Camper grade value must be between 3 - 12 // Grade = Convert.ToInt32(drGrade["Answer"]); // if ((Grade > 0) && (Grade < 13)) // { // StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); // } // else // { // StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // } //} ////Is this your first time to attend a Non-profit Jewish overnight camp, for 3 weeks or longer: //DataSet dsFirstTimeCamper; //dsFirstTimeCamper = oCA.getCamperAnswers(FJCID, "3", "3", "N"); //DataRow drFTC; //if (dsFirstTimeCamper.Tables[0].Rows.Count > 0) //{ // drFTC = dsFirstTimeCamper.Tables[0].Rows[0]; // FirstTimeCamperOption = Convert.ToInt32(drFTC["OptionID"]); // if (FirstTimeCamperOption == 2) // { // StatusValue = (int)StatusInfo.SystemInEligible; // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // StatusValue = (int)StatusInfo.SystemEligible; // oCA.UpdateAmount(FJCID, 1000.00, 0, ""); // FirstTimeCamper = true; // } //} ////What kind of the school the camper go to //DataSet dsJewishSchool; //dsJewishSchool = oCA.getCamperAnswers(FJCID, "7", "7", "N"); //DataRow drJewishSchool; //if (dsJewishSchool.Tables[0].Rows.Count > 0) //{ // drJewishSchool = dsJewishSchool.Tables[0].Rows[0]; // if (!string.IsNullOrEmpty(drJewishSchool["OptionID"].ToString())) // { // JewishSchoolOption = Convert.ToInt32(drJewishSchool["OptionID"]); // if (JewishSchoolOption == 4) // { // StatusValue = (int)StatusInfo.SystemInEligible; // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // StatusValue = (int)StatusInfo.SystemEligible; // } // } //} ////Camp check //DataSet dsCamp; //dsCamp = oCA.getCamperAnswers(FJCID, "10", "10", "N"); //DataRow drCamp; //int CampID = 0; //int CampOption = 0; //if (dsCamp.Tables[0].Rows.Count > 0) //{ // int i; // for (i = 0; i < dsCamp.Tables[0].Rows.Count; i++) // { // drCamp = dsCamp.Tables[0].Rows[i]; // if (!DBNull.Value.Equals(drCamp["OptionID"])) // { // CampOption = Convert.ToInt32(drCamp["OptionID"]); // } // if (CampOption == 2) // { // CampID = Convert.ToInt32(drCamp["Answer"]); // if (CampID == 0) // { // StatusValue = Convert.ToInt32(StatusInfo.EligibleNoCamp); // return true; // } // else // { // StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); // } // } // } //} ////Camp Session check - Eligible only if registered for 21 days //DataSet dsCampSession; //dsCampSession = oCA.getCamperAnswers(FJCID, "12", "12", "N"); //DataRow drStartDate; //DataRow drEndDate; //if (dsCampSession.Tables[0].Rows.Count > 1) //{ // drStartDate = dsCampSession.Tables[0].Rows[0]; // drEndDate = dsCampSession.Tables[0].Rows[1]; // if (!string.IsNullOrEmpty(drStartDate["Answer"].ToString())) // { // string strStartDate = Convert.ToString(drStartDate["Answer"]); // string strEndDate = Convert.ToString(drEndDate["Answer"]); // DateTime dtStartDate = Convert.ToDateTime(strStartDate); // DateTime dtEndDate = Convert.ToDateTime(strEndDate); // //int iDays = DateTime. // TimeSpan span = dtEndDate.Subtract(dtStartDate); // int NoOfSat; // NoOfSat = calNoOfSaturdays(dtStartDate, dtEndDate); // int iDays = span.Days + 1; // double Amount = 0; // if (NoOfSat < 3) // { // StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); // } // } //} //return true; }
//page unload protected void Page_Unload(object sender, EventArgs e) { CamperAppl = null; objGeneral = null; }
void btnNext_Click(object sender, EventArgs e) { int iStatus; string strModifiedBy, strFJCID; EligibilityBase objEligibility = EligibilityFactory.GetEligibility(FederationEnum.JWest); try { if (Page.IsValid) { if (!objGeneral.IsApplicationReadOnly(hdnFJCID.Value, Master.CamperUserId)) { ProcessCamperAnswers(); } bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCID.Value, Master.CamperUserId); //Modified by id taken from the Master Id strModifiedBy = Master.UserId; strFJCID = hdnFJCID.Value; if (strFJCID != "" && strModifiedBy != "") { if (isReadOnly) { DataSet dsApp = CamperAppl.getCamperApplication(strFJCID); iStatus = Convert.ToInt32(dsApp.Tables[0].Rows[0]["Status"]); } else { //to check whether the camper is eligible objEligibility.checkEligibilityforStep2(strFJCID, out iStatus); } Session["STATUS"] = iStatus.ToString(); if (RadioBtnQ4.SelectedIndex == 1 && RadioBtnQ3.SelectedIndex == 1) { iStatus = Convert.ToInt32(StatusInfo.SystemInEligible); } if (iStatus != Convert.ToInt32(StatusInfo.SystemEligible)) { if (Convert.ToInt32(Session["codeValue"]) == 1) // PJL Day School codes validation { if (Session["SpecialCodeValue"] != null) { CamperApplication oCA = new CamperApplication(); int validate = oCA.validatePJLDSCode(Session["SpecialCodeValue"].ToString()); if (validate == 0 || validate == 2) { oCA.updatePJLDSCode(Session["SpecialCodeValue"].ToString(), hdnFJCID.Value); Session["FJCID"] = hdnFJCID.Value; Session["FedId"] = ConfigurationManager.AppSettings["PJL"].ToString(); CamperAppl.UpdateFederationId(Session["FJCID"].ToString(), "63"); Response.Redirect("~/Enrollment/PJL/Summary.aspx"); } } } else { Response.Redirect("~/Enrollment/Step1_NL.aspx"); } } } Session["FJCID"] = hdnFJCID.Value; Response.Redirect("Step2_3.aspx"); } } catch (Exception ex) { Response.Write(ex.Message); } }