protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var fedId = Convert.ToInt32(FederationEnum.URJGreeneFamily); var isDisabled = ConfigurationManager.AppSettings["DisableOnSummaryPageFederations"].Split(',').Any(x => x == fedId.ToString()); if (isDisabled && Session["UsrID"] == null) { tblDisable.Visible = true; tblRegular.Visible = false; if (Session["SpecialCodeValue"] != null) { var currentCode = Session["SpecialCodeValue"].ToString(); var campYearId = Convert.ToInt32(Application["CampYearID"]); if (SpecialCodeManager.GetAvailableCodes(campYearId, fedId).Any(x => x == currentCode)) { tblDisable.Visible = false; tblRegular.Visible = true; } } } else { tblDisable.Visible = false; tblRegular.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Two possible scenarios - either the regular summary page, or then camp is full, show the close message int FedID = Convert.ToInt32(FederationEnum.Charleston); var FED_ID = FedID.ToString(); bool isDisabled = ConfigurationManager.AppSettings["DisableOnSummaryPageFederations"].Split(',').Any(x => x == FED_ID); if (isDisabled) { tblDisable.Visible = true; tblRegular.Visible = false; if (Session["SpecialCodeValue"] != null) { var currentCode = Session["SpecialCodeValue"].ToString(); var CampYearID = Convert.ToInt32(Application["CampYearID"]); if (SpecialCodeManager.GetAvailableCodes(CampYearID, FedID).Any(x => x == currentCode)) { tblDisable.Visible = false; tblRegular.Visible = true; Session["isGrantAvailable"] = true; } } } else { tblDisable.Visible = false; tblRegular.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int FedID = Convert.ToInt32(FederationEnum.Poyntelle); string FED_ID = FedID.ToString(); bool isDisabled = ConfigurationManager.AppSettings["DisableOnSummaryPageFederations"].Split(',').Any(x => x == FED_ID); if (isDisabled) { tblDisable.Visible = true; tblRegular.Visible = false; if (Session["SpecialCodeValue"] != null) { string currentCode = Session["SpecialCodeValue"].ToString(); int CampYearID = Convert.ToInt32(Application["CampYearID"]); if (SpecialCodeManager.GetAvailableCodes(CampYearID, FedID).Any(x => x == currentCode)) { tblDisable.Visible = false; tblRegular.Visible = true; } } } else { tblDisable.Visible = false; tblRegular.Visible = true; } } }
// 2014-07-28 We only mark the special code as used ONLY when an application is completed successfully // Once it's used successfully, nobody else can use it, including the original owner. private void MarkSpecialCodeUsed(int fedId) { if (Session["SpecialCodeValue"] != null) { string currentCode = Session["SpecialCodeValue"].ToString(); int campYearId = Convert.ToInt32(Application["CampYearID"]); SpecialCodeManager.UseCode(campYearId, fedId, currentCode, Session["FJCID"].ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { const string FED_ID = "58"; bool isDisabled = false; string[] FedIDs = ConfigurationManager.AppSettings["DisableOnSummaryPageFederations"].Split(','); for (int i = 0; i < FedIDs.Length; i++) { if (FedIDs[i] == FED_ID) { isDisabled = true; break; } } if (isDisabled) { tblDisable.Visible = true; tblRegular.Visible = false; btnNext.Visible = false; if (Session["SpecialCodeValue"] != null) { // 2013-02-21 Now Camp Barney use tblSpecialCodes table string currentCode = Session["SpecialCodeValue"].ToString(); int CampYearID = Convert.ToInt32(Application["CampYearID"]); int FedID = Convert.ToInt32(FederationEnum.Barney); List <string> specialCodes = SpecialCodeManager.GetAvailableCodes(CampYearID, FedID); // when moved to .NET 3.5 or above, remember to use lamda expression foreach (string code in specialCodes) { if (code == currentCode) { tblDisable.Visible = false; tblRegular.Visible = true; btnSaveandExit.Visible = true; btnNext.Visible = true; break; } } } } else { tblDisable.Visible = false; tblRegular.Visible = true; btnSaveandExit.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var fjcid = Session["FJCID"].ToString(); var camperApp = new CamperApplication(); camperApp.UpdateFederationId(fjcid, ((int)FederationEnum.WashingtonDC).ToString()); Session["FedId"] = (int)FederationEnum.WashingtonDC; int FedID = Convert.ToInt32(FederationEnum.WashingtonDC); string FED_ID = FedID.ToString(); bool isDisabled = ConfigurationManager.AppSettings["DisableOnSummaryPageFederations"].Split(',').Any(x => x == FED_ID); // Session UserID == null means current logged user is regular camper, not admin. We don't want to block admins from accessing the application even if the program is in closed state. if (isDisabled && Session["UsrID"] == null) { tblDisable.Visible = true; tblRegular.Visible = false; if (Session["SpecialCodeValue"] != null) { string currentCode = Session["SpecialCodeValue"].ToString(); int CampYearID = Convert.ToInt32(Application["CampYearID"]); if (SpecialCodeManager.GetAvailableCodes(CampYearID, FedID).Any(x => x == currentCode)) { tblDisable.Visible = false; tblRegular.Visible = true; Session["isGrantAvailable"] = true; } else if (SessionSpecialCode.GetPJLotterySpecialCode() == "PJGTC2017") { tblDisable.Visible = false; tblRegular.Visible = false; tblPJLottery.Visible = true; ScriptManager.RegisterStartupScript(this, GetType(), "replacePageHeaderText", "replacePageHeaderText();", true); } } } else { tblDisable.Visible = false; tblRegular.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int FedID = Convert.ToInt32(FederationEnum.PJL); string FED_ID = FedID.ToString(); bool isDisabled = ConfigurationManager.AppSettings["DisableOnSummaryPageFederations"].Split(',').Any(x => x == FED_ID); if (isDisabled) { tblDisable.Visible = true; tblRegular.Visible = false; if (Session["SpecialCodeValue"] != null) { string currentCode = Session["SpecialCodeValue"].ToString(); int CampYearID = Convert.ToInt32(Application["CampYearID"]); if (SpecialCodeManager.GetAvailableCodes(CampYearID, FedID).Any(x => x == currentCode)) { tblDisable.Visible = false; tblRegular.Visible = true; } // 2013-07-11 Currently, tblPJLCodes and tblPJLDSCodes table are still being used in Step1.aspx // DScodes has the special effect of bypassing all the logic and jump directly to the PJL summary page // Val aksed a temporary solution to have super speical code that allows users form LA to jump directly to PJ, this coincides with // the PJL DS codes logic, so I utilize the mechanism here. if (!tblRegular.Visible) { CamperApplication oCA = new CamperApplication(); int validate = oCA.validatePJLDSCode(currentCode); if (validate == 0 || validate == 2) { tblDisable.Visible = false; tblRegular.Visible = true; } } } } else { tblDisable.Visible = false; tblRegular.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { // 2014-02-19 Val asked to have special case that make Memphis disappear so user directly go to the NL page Response.Redirect("../Step1_NL.aspx"); if (!IsPostBack) { // Two possible scenarios - either the regular summary page, or then camp is full, show the close message int FedID = Convert.ToInt32(FederationEnum.Memphis); string FED_ID = FedID.ToString(); bool isDisabled = false; if (ConfigurationManager.AppSettings["DisableOnSummaryPageFederations"].Split(',').Any(x => x == FED_ID)) { isDisabled = true; } if (isDisabled) { tblDisable.Visible = true; tblRegular.Visible = false; if (Session["SpecialCodeValue"] != null) { string currentCode = Session["SpecialCodeValue"].ToString(); int CampYearID = Convert.ToInt32(Application["CampYearID"]); if (SpecialCodeManager.GetAvailableCodes(CampYearID, FedID).Any(x => x == currentCode)) { tblDisable.Visible = false; tblRegular.Visible = true; } } } else { tblDisable.Visible = false; tblRegular.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { int resultCampId = 0; //long resultFedID; if (Session["CampID"] != null) { Int32.TryParse(Session["CampID"].ToString(), out resultCampId); } else if (Session["FJCID"] != null) { DataSet ds = new CamperApplication().getCamperAnswers(Session["FJCID"].ToString(), "10", "10", "N"); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; Int32.TryParse(dr["Answer"].ToString(), out resultCampId); } } string campID = resultCampId.ToString(); string last3digits = campID.Substring(campID.Length - 3); // Olin-Sang-Ruby Union Institute (OSRUI) if (last3digits == "141") { tblDisable.Visible = true; lblDisabledMessage.Text = "For further information on how to apply for the URJ OSRUI One Happy Camper program, please contact the professional listed at the bottom of the screen."; tblRegular.Visible = false; if (Session["SpecialCodeValue"] != null) { var currentCode = Session["SpecialCodeValue"].ToString(); var campYearId = Convert.ToInt32(Application["CampYearID"]); var fedId = Convert.ToInt32(FederationEnum.URJ); if (SpecialCodeManager.GetAvailableCodesPerCamp(campYearId, fedId, Int32.Parse(campID)).Any(x => x == currentCode)) { tblDisable.Visible = false; tblRegular.Visible = true; } } } }
// 2014-07-28 The first routing rule is for PJL - if the user is in EligiblePJLottery (used PJ special code, failed at community due to DS public static string GetNextRouteBasedOnStatus(StatusInfo status, string option) { var url = "Step2_3.aspx"; bool isOn = ConfigurationManager.AppSettings["PJLottery"] == "On"; if (status == StatusInfo.EligiblePJLottery && isOn) { var specialCode = SessionSpecialCode.GetPJLotterySpecialCode(); if (specialCode != "") { var campYearId = Convert.ToInt32(HttpContext.Current.Application["CampYearID"]); if (SpecialCodeManager.IsValidCode(campYearId, (int)FederationEnum.PJL, specialCode)) { url = "../PJL/Step2_2_route_info.aspx?prev=" + option; } } } else if (status == StatusInfo.EligiblePJLottery && !isOn) { HttpContext.Current.Session["STATUS"] = (int)StatusInfo.SystemInEligible; } return(url); }
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); } } }
void btnChkEligibility_Click(object sender, EventArgs e) { int iStatus, iCampId; string strModifiedBy, strFJCID, strComments; if (Page.IsValid) { bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_3.Value, Master.CamperUserId); //Modified by id taken from the Master Id strModifiedBy = Master.UserId; if (!isReadOnly) { InsertCamperAnswers(); } iCampId = Convert.ToInt32(ddlCamp.SelectedValue); strFJCID = hdnFJCIDStep2_3.Value; //comments used only by the Admin user strComments = txtComments.Text.Trim(); if (strFJCID != "" && strModifiedBy != "") { if (isReadOnly) { DataSet dsApp = CamperAppl.getCamperApplication(strFJCID); iStatus = Convert.ToInt32(dsApp.Tables[0].Rows[0]["Status"]); } else { //to update the camp value to the database (to be used for search functionality) CamperAppl.updateCamp(strFJCID, iCampId, strComments, Convert.ToInt32(Master.CamperUserId)); var objEligibility = EligibilityFactory.GetEligibility(FederationEnum.PJL); objEligibility.checkEligibility(strFJCID, out iStatus); } var checkStatus = (StatusInfo)Convert.ToInt32(Session["STATUS"]); if ((checkStatus == StatusInfo.SystemInEligible || checkStatus == StatusInfo.EligiblePJLottery) && (StatusInfo)iStatus != StatusInfo.SystemInEligible) { iStatus = (int)checkStatus; } Session["STATUS"] = iStatus; if (iStatus == Convert.ToInt32(StatusInfo.EligiblePJLottery)) { var strRedirUrl = "EnterLotteryInfo.aspx"; if (Master.UserId != Master.CamperUserId) //then the user is admin { strRedirUrl = ConfigurationManager.AppSettings["AdminRedirURL"]; } //to update the status to the database if (!isReadOnly) { //CamperAppl.submitCamperApplication(strFJCID, strComments, Convert.ToInt32(strModifiedBy), iStatus); CamperAppl.UpdateStatus(strFJCID, iStatus, "", 0); } // Mark the special code as used var currentCode = Session["SpecialCodeValue"].ToString(); int campYearId = Convert.ToInt32(Application["CampYearID"]); SpecialCodeManager.UseCode(campYearId, Convert.ToInt32(FederationEnum.PJL), currentCode, Session["FJCID"].ToString()); Response.Redirect(strRedirUrl, false); } else if (iStatus == Convert.ToInt32(StatusInfo.SystemInEligible)) { if (!isReadOnly) { CamperAppl.submitCamperApplication(strFJCID, strComments, Convert.ToInt32(strModifiedBy), iStatus); } Response.Redirect("../ThankYou.aspx", false); } else //if he/she is eligible { // 2016-07-06 PJL now has new status Eligible - Registration at Camp for people who ware still waiting for camp registration // in this case, admin will move the status to Eligible when campers actually reigstered for camp. if (RadioButtonQ7Option3.Checked) { Session["STATUS"] = Convert.ToInt32(StatusInfo.EligiblePendingRegistrationCamp); } Session["FJCID"] = hdnFJCIDStep2_3.Value; Response.Redirect("../Step2_1.aspx"); } } } }
void btnNext_Click(object sender, EventArgs e) { bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCID.Value, Master.CamperUserId); if (!isReadOnly) { ProcessCamperAnswers(); } //Modified by id taken from the Master Id string strModifiedBy = Master.UserId; string strFJCID = hdnFJCID.Value; if (strFJCID != "" && strModifiedBy != "") { int iStatus; if (isReadOnly) { DataSet dsApp = CamperAppl.getCamperApplication(strFJCID); iStatus = Convert.ToInt32(dsApp.Tables[0].Rows[0]["Status"]); } else { var objEligibility = EligibilityFactory.GetEligibility(FederationEnum.Chicago); objEligibility.checkEligibilityforStep2(strFJCID, out iStatus); } Session["STATUS"] = iStatus.ToString(); } Session["FJCID"] = hdnFJCID.Value; // Chicago coupon for JewishCampers - Other option, then we route to Chicago Coupon page OR Coupon Holding page if the program is not ON yet if (ddlJewishDaySchool.SelectedValue == "3") { // 2014-10-10 Enable Chicaog coupon for in winter every year after PJ Lottery is closed below by commenting the code below, usually this happens end of year or early new year bool isOn = ConfigurationManager.AppSettings["ChicagoCouponProgram"] == "On"; if (isOn) { Response.Redirect("Step2_coupon.aspx"); } // 2014-10-10 In the early fall of every year, we should use PJ lottery var url = "Step2_camp_coupon_holding.aspx?prev="; var session = HttpContext.Current.Session; if (session["SpecialCodeValue"] != null) { var currentCode = session["SpecialCodeValue"].ToString().Substring(0, 9); var campYearId = Convert.ToInt32(HttpContext.Current.Application["CampYearID"]); if (SpecialCodeManager.IsValidCode(campYearId, (int)FederationEnum.PJL, currentCode)) { url = "../PJL/Step2_2_route_info.aspx?prev="; } } Session["STATUS"] = ((int)StatusInfo.EligiblePJLottery).ToString(); Response.Redirect(url + HttpContext.Current.Request.Url.AbsolutePath); } else { Response.Redirect("Step2_3.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int FedID = Convert.ToInt32(FederationEnum.NNJ); string FED_ID = FedID.ToString(); bool isDisabled = ConfigurationManager.AppSettings["DisableOnSummaryPageFederations"].Split(',').Any(x => x == FED_ID); if (isDisabled) { tblDisable.Visible = true; tblRegular.Visible = false; if (Session["SpecialCodeValue"] != null) { string currentCode = Session["SpecialCodeValue"].ToString(); int CampYearID = Convert.ToInt32(Application["CampYearID"]); if (SpecialCodeManager.GetAvailableCodes(CampYearID, FedID).Any(x => x == currentCode)) { tblDisable.Visible = false; tblRegular.Visible = true; } } } else { tblDisable.Visible = false; tblRegular.Visible = true; } } int resultCampId = 0; //long resultFedID; if (Session["CampID"] != null) { Int32.TryParse(Session["CampID"].ToString(), out resultCampId); } else if (Session["FJCID"] != null) { DataSet ds = new CamperApplication().getCamperAnswers(Session["FJCID"].ToString(), "10", "10", "N"); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; Int32.TryParse(dr["Answer"].ToString(), out resultCampId); } } switch (resultCampId) { case 1029: imgLogo.Src = "../../images/Camp Galil.jpg"; //tdtext1.Visible = false; //tdtext2.Visible = true; break; case 1036: imgLogo.Src = "../../images/Camp Gesher.jpg"; //tdtext1.Visible = true; //tdtext2.Visible = false; break; case 1037: imgLogo.Src = "../../images/Camp Gilboa.jpg"; //tdtext1.Visible = false; //tdtext2.Visible = true; break; case 1057: imgLogo.Src = "../../images/Camp Miriam.JPG"; //tdtext1.Visible = true; //tdtext2.Visible = false; break; case 1060: imgLogo.Src = "../../images/Camp Moshava.jpg"; //tdtext1.Visible = true; //tdtext2.Visible = false; break; case 1066: imgLogo.Src = "../../images/Camp Na'aleh.jpg"; //tdtext1.Visible = false; //tdtext2.Visible = true; break; case 1095: imgLogo.Src = "../../images/Camp Tavor.jpg"; //tdtext1.Visible = false; //tdtext2.Visible = true; break; } }