public override bool checkEligibility(string FJCID, out int StatusValue) { 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); } intSynagogueID = StatusBasedOnSynagogue(FJCID, StatusValue); daysInCamp = DaysInCamp(FJCID); if (daysInCamp > 0) { Amount = getCamperGrant(FJCID, daysInCamp, out StatusValue); } else { StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); Amount = 0; } if (Amount > 0) { // 2015 Kibbutz Bob Waldorf or Camp Gesher is always $250 if (Amount != 250) { var originalAmount = Amount; // 2015-09-07 San Diego Sibling Rule - if this camper has sibling attended before, no matter how many days // of camping, the amount is only 500. Amount = 500; DataSet dsSchoolOption = oCA.getCamperAnswers(FJCID, "1032", "1032", "N"); if (dsSchoolOption.Tables[0].Rows.Count > 0) { DataRow drSchoolOption = dsSchoolOption.Tables[0].Rows[0]; if (!string.IsNullOrEmpty(drSchoolOption["OptionID"].ToString())) { if ("2" == drSchoolOption["OptionID"].ToString()) { Amount = originalAmount; } } } } } 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 - 11 // Grade = Convert.ToInt32(drGrade["Answer"]); // if ((Grade > 1) && (Grade < 11)) // { // 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 iDays = span.Days + 1; // double Amount = 0; // if (iDays < 21) // { // StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); // } // } //} //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 SchoolOption = 0; ////int JewishSchool = 0; //int Grade = 0; //StatusValue = 0; //int FirstTimeCamperOption = 0; //int SecondTimeCamperOption = 0; //int IncentiveOption = 0; //Boolean FirstTimeCamper = false; //Boolean SecondTimeCamper = false; ////Boolean PendingSchool = false; //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, "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)//no // { // ///************************* // ///Is this your second time? // ///************************* // DataSet dsSecondTimeCamper; // dsSecondTimeCamper = oCA.getCamperAnswers(FJCID, "13", "13", "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, Amount, 0, ""); // return true; // } // else // { // //***************************************************************************************** // //Did the camper receive an incentive grant through the Jewish Federation of Greater Dallas’ // //Campership Incentive Program last summer? // //***************************************************************************************** // DataSet dsThirdTimeCamper; // dsThirdTimeCamper = oCA.getCamperAnswers(FJCID, "39", "39", "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; // } //} ////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); // return true; // } // else // { // // Camper grade value must be between 3 - 10 // Grade = Convert.ToInt32(drGrade["Answer"]); // if ((Grade >= 3) && (Grade <= 10)) // { // StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); // } // else // { // StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // } //} //// set the amount value //if (FirstTimeCamper) //{ // Amount = 1000.00; //} //else if (SecondTimeCamper) //{ // Amount = 1000.00; //} //else //{ // Amount = 0.00; //} //oCA.UpdateAmount(FJCID, Amount, 0, ""); ////****************************************************************** ////What kind of the school the camper go to ////If Jewish Day School is selected then a dropdown with 2 day school ////****************************************************************** //DataSet dsSchoolOption; //dsSchoolOption = oCA.getCamperAnswers(FJCID, "7", "7", "N"); //DataRow drSchoolOption; //if (dsSchoolOption.Tables[0].Rows.Count > 0) //{ // drSchoolOption = dsSchoolOption.Tables[0].Rows[0]; // if (!string.IsNullOrEmpty(drSchoolOption["OptionID"].ToString())) // { // SchoolOption = Convert.ToInt32(drSchoolOption["OptionID"]); // if (SchoolOption == 4) // { // StatusValue = (int)StatusInfo.SystemInEligible; // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // StatusValue = (int)StatusInfo.SystemEligible; // } // } //} ////*********************************** ////Camp check ////Have you registered for a camp yet? ////*********************************** //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 iDays = span.Days + 1; // if (iDays < 21) // { // StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); // oCA.UpdateAmount(FJCID, 0.00, 0, ""); // return true; // } // else // { // StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); // } // oCA.UpdateAmount(FJCID, Amount, 0, ""); // } //} //return true; }
public override bool checkEligibility(string FJCID, out int StatusValue) { int daysInCamp; double Amount = 0.00; bool EligibleNoCamp = false; if (checkEligibilityCommon(FJCID, out StatusValue)) { return(true); } General objGeneral = new General(); CamperApplication oCA = new CamperApplication(); StatusValue = StatusBasedOnCamp(FJCID, out EligibleNoCamp); daysInCamp = DaysInCamp(FJCID); if (daysInCamp < 12) { StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); Amount = 0; return(false); } string Previous2011FJCID = "", Previous2012FJCID = ""; int Previous2011Status = 0, Previous2012Status = 0; double GrantAmount2011 = 0.0, GrantAmount2012 = 0.0; DataSet dsPreviousFJCIDs = objGeneral.GetPreviousFJCIDs(FJCID); DataRow[] ds2011ExistingCampers = dsPreviousFJCIDs.Tables[0].Select("campyearid=3"); if (ds2011ExistingCampers.Length > 0) { Previous2011FJCID = ds2011ExistingCampers[0].ItemArray[0].ToString(); Previous2011Status = Convert.ToInt32(ds2011ExistingCampers[0].ItemArray[6].ToString()); GrantAmount2011 = Convert.ToDouble(ds2011ExistingCampers[0]["Amount"]); } DataRow[] ds2012ExistingCampers = dsPreviousFJCIDs.Tables[0].Select("campyearid=4"); if (ds2012ExistingCampers.Length > 0) { Previous2012FJCID = ds2012ExistingCampers[0].ItemArray[0].ToString(); Previous2012Status = Convert.ToInt32(ds2012ExistingCampers[0].ItemArray[6].ToString()); GrantAmount2012 = Convert.ToDouble(ds2012ExistingCampers[0]["Amount"]); } if (Previous2011FJCID != "" && Previous2012FJCID != "") { Amount = 0.0; StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); if (!(Previous2012Status == 29 || Previous2012Status == 30 || Previous2012Status == 31 || Previous2012Status == 32 || Previous2011Status == 29 || Previous2011Status == 30 || Previous2011Status == 31 || Previous2011Status == 32)) { if (GrantAmount2011 == 1000 && GrantAmount2012 == 1000) { StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); Amount = 500; } } } else { Amount = 0.0; StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); } // 2012-11-17 In Camp Year 2013, there will be JWest/JWest special codes with amount = 500. Look at tblSpecialCodes for those 20 initial codes given by Val if (HttpContext.Current.Session["SpecialCodeValue"] != null) { string currentCode = HttpContext.Current.Session["SpecialCodeValue"].ToString(); List <string> codes = SpecialCodeManager.GetAvailableJWestJWestLACodes(5); // when moved to .NET 3.5 or above, remember to use lamda expression foreach (string code in codes) { if (code == currentCode) { Amount = 500; StatusValue = Convert.ToInt32(StatusInfo.SystemEligible); int CampYearID = 5; if (HttpContext.Current.Application["CampYearID"] != null) { CampYearID = Convert.ToInt32(HttpContext.Current.Application["CampYearID"]); } SpecialCodeManager.UseCode(CampYearID, 3, currentCode, FJCID); break; } } } if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0, 0, ""); return(true); } else { StatusValue = StatusBasedOnSchool(FJCID, EligibleNoCamp, StatusValue); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0, 0, ""); return(true); } else { oCA.UpdateAmount(FJCID, Amount, 0, ""); return(true); } } }
public override bool checkEligibility(string FJCID, out int StatusValue) { StatusValue = 0; bool PendingSchool = false; if (checkEligibilityCommon(FJCID, out StatusValue)) { return(true); } var oCA = new CamperApplication(); StatusValue = StatusBasedOnGrade(FJCID, StatusValue); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } StatusBasedOnSchool(FJCID, out StatusValue); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } StatusValue = StatusBasedOnCamp(FJCID, StatusValue, PendingSchool); if (StatusValue != Convert.ToInt32(StatusInfo.SystemEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } int daysInCamp = DaysInCamp(FJCID); double amount = 0.00; if (daysInCamp > 0) { var dsSchoolOption = oCA.getCamperAnswers(FJCID, "1", "1", "7"); var schoolTypeId = dsSchoolOption.Tables[0].Select("QuestionID = 7")[0]["OptionID"].ToString(); // Berkshires has special rule that allow Jewish Day School, 19+ days camper for $500 if (daysInCamp >= 19 && schoolTypeId == "4") { amount = 500; } else if (schoolTypeId != "4") { amount = getCamperGrant(FJCID, daysInCamp, out StatusValue); } } oCA.UpdateAmount(FJCID, amount, 0, ""); if (amount == 0.00) { StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); } return(true); }
public override bool checkEligibility(string FJCID, out int StatusValue) { StatusValue = 0; bool PendingSchool = false; if (checkEligibilityCommon(FJCID, out StatusValue)) { return(true); } var 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, out PendingSchool); if (StatusValue == Convert.ToInt32(StatusInfo.SystemInEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } StatusValue = StatusBasedOnCamp(FJCID, StatusValue, PendingSchool); if (StatusValue != Convert.ToInt32(StatusInfo.SystemEligible)) { oCA.UpdateAmount(FJCID, 0.00, 0, ""); return(true); } int daysInCamp = DaysInCamp(FJCID); double Amount = 0; if (daysInCamp > 0) { var dsSchoolOption = oCA.getCamperAnswers(FJCID, "1", "1", "3,7,10"); var timeInCamp = dsSchoolOption.Tables[0].Select("QuestionID = 3")[0]["OptionID"].ToString(); var schoolTypeId = dsSchoolOption.Tables[0].Select("QuestionID = 7")[0]["OptionID"].ToString(); var campId = dsSchoolOption.Tables[0].Select("QuestionID = 10")[0]["Answer"].ToString(); string last3Digits = campId.Substring(campId.Length - 3); if (last3Digits == "082") // Berkshires { if (daysInCamp >= 19 && schoolTypeId == "4") { Amount = 500; } else if (daysInCamp >= 19) { Amount = 1000; } } else if (last3Digits == "079") // California { if (timeInCamp == "1" && daysInCamp >= 19) { Amount = 1000; } else if (timeInCamp == "1" && daysInCamp >= 12) { Amount = 700; } else if (timeInCamp == "2" && daysInCamp >= 19) { Amount = 750; } else if (timeInCamp == "2" && daysInCamp >= 12) { Amount = 500; } } else if (last3Digits == "080" || last3Digits == "084") // Canada, Wisconsin { if (daysInCamp >= 19) { Amount = 1000; } } else if (last3Digits == "083") // Poconos { if (timeInCamp == "1" && daysInCamp >= 19) { Amount = 1000; } else if (timeInCamp == "2" && daysInCamp >= 19) { Amount = 750; } } else if (last3Digits == "150") // Outdoor Adventure { if (timeInCamp == "1" && daysInCamp >= 19) { Amount = 1000; } else if (timeInCamp == "1" && daysInCamp >= 12) { Amount = 700; } else if (timeInCamp == "2" && daysInCamp >= 19) { Amount = 750; } else if (timeInCamp == "2" && daysInCamp >= 12) { Amount = 350; } } else // all other camps { Amount = getCamperGrant(FJCID, daysInCamp, out StatusValue); } } else { StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); } oCA.UpdateAmount(FJCID, Amount, 0, ""); if (Amount == 0.00) { StatusValue = Convert.ToInt32(StatusInfo.SystemInEligible); } 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(); 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; }