Beispiel #1
0
    void btnNext_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }

        bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCID.Value, Master.CamperUserId);

        if (!isReadOnly)
        {
            ProcessCamperAnswers();
        }

        var strModifiedBy = Master.UserId;
        var 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.RamahPoconos);
                objEligibility.checkEligibilityforStep2(strFJCID, out iStatus);
            }
            Session["STATUS"] = iStatus.ToString();
        }
        Session["FJCID"] = hdnFJCID.Value;
        Response.Redirect("Step2_3.aspx");
    }
Beispiel #2
0
    protected void btnViewapplication_Click(object sender, EventArgs e)
    {
        string strRedirURL = "";

        if (Session["FJCID"] != null)
        {
            DataSet           dsCamperApplication;
            DataRow           drCA;
            CamperApplication oCA = new CamperApplication();
            dsCamperApplication = oCA.getCamperApplication((string)Session["FJCID"]);
            drCA = dsCamperApplication.Tables[0].Rows[0];
            if (!string.IsNullOrEmpty(drCA["AppType"].ToString()))
            {
                if (drCA["AppType"].ToString() == "D")
                {
                    strRedirURL = "DeleteMessage.aspx";
                }
                else
                {
                    strRedirURL = ConfigurationManager.AppSettings["CamperBasicInfo"].ToString();
                }
            }
            else
            {
                strRedirURL = ConfigurationManager.AppSettings["CamperBasicInfo"].ToString();
            }

            Response.Redirect(strRedirURL);
        }
    }
Beispiel #3
0
        protected int GetCamperStatus(string FJCID)
        {
            CamperApplication CamperAppl = new CamperApplication();
            DataSet           dsApp      = CamperAppl.getCamperApplication(FJCID);
            int StatusValue = Convert.ToInt32(dsApp.Tables[0].Rows[0]["Status"]);

            CamperAppl = null;
            return(StatusValue);
        }
Beispiel #4
0
    void btnNext_Click(object sender, EventArgs e)
    {
        CheckForRedirect();

        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;
        int    iStatus       = Convert.ToInt32(StatusInfo.SystemInEligible);

        if (strFJCID != "" && strModifiedBy != "")
        {
            if (isReadOnly)
            {
                DataSet dsApp = CamperAppl.getCamperApplication(strFJCID);
                iStatus = Convert.ToInt32(dsApp.Tables[0].Rows[0]["Status"]);
            }
            else
            {
                var objEligibility = EligibilityFactory.GetEligibility(FederationEnum.WashingtonDC);
                EligibilityBase.EligibilityResult result = objEligibility.checkEligibilityforStep2(strFJCID, out iStatus, SessionSpecialCode.GetPJLotterySpecialCode());

                if (result.SchoolType == StatusInfo.EligiblePJLottery)
                {
                    iStatus = (int)StatusInfo.EligiblePJLottery;
                }
                else if (result.CurrentUserStatusFromDB == StatusInfo.SystemInEligible ||
                         result.Grade == StatusInfo.SystemInEligible ||
                         result.SchoolType == StatusInfo.SystemInEligible ||
                         result.TimeInCamp == StatusInfo.SystemInEligible)
                {
                    iStatus = (int)StatusInfo.SystemInEligible;
                }
                else
                {
                    iStatus = (int)StatusInfo.SystemEligible;
                }
            }
            Session["STATUS"] = iStatus.ToString();
        }
        Session["FJCID"] = hdnFJCID.Value;

        var status = (StatusInfo)iStatus;

        Response.Redirect(AppRouteManager.GetNextRouteBasedOnStatus(status, HttpContext.Current.Request.Url.AbsolutePath));
    }
Beispiel #5
0
    protected void Page_Init(object sender, EventArgs e)
    {
        btnNext.Click                  += new EventHandler(btnNext_Click);
        btnPrevious.Click              += new EventHandler(btnPrevious_Click);
        btnSaveandExit.Click           += new EventHandler(btnSaveandExit_Click);
        btnReturnAdmin.Click           += new EventHandler(btnReturnAdmin_Click);
        CusValComments.ServerValidate  += new ServerValidateEventHandler(CusValComments_ServerValidate);
        CusValComments1.ServerValidate += new ServerValidateEventHandler(CusValComments_ServerValidate);

        if (Session["FedId"] != null)
        {
            General           objGeneral           = new General();
            CamperApplication objCamperApplication = new CamperApplication();
            string            navigationUrl        = string.Empty;
            string            campID = string.Empty;
            if (Session["CampID"] != null)
            {
                campID = Session["CampID"].ToString();
            }
            else if (Session["FJCID"] != null)
            {
                DataSet dsCamperApplication = objCamperApplication.getCamperApplication(Session["FJCID"].ToString());
                campID = dsCamperApplication.Tables[0].Rows.Count > 0?dsCamperApplication.Tables[0].Rows[0]["Camp"].ToString():string.Empty;
            }
            DataSet dsFederationDetails = new DataSet();
            if (campID != string.Empty)
            {
                dsFederationDetails = objGeneral.GetFederationDetailsUsingCampID(Session["FedId"].ToString(), campID);
            }
            else
            {
                dsFederationDetails = objGeneral.GetFederationDetails(Session["FedId"].ToString());
            }
            if (dsFederationDetails.Tables[0].Rows.Count > 0)
            {
                navigationUrl = dsFederationDetails.Tables[0].Rows[0]["NavigationURL"].ToString();
            }
            //if ((Request.UrlReferrer.AbsolutePath.Contains("URJ/Acadamy") || (campID== "1146")) && (navigationUrl.Contains("URJ")))3146
            if ((campID == "1146" || campID == "2146" || campID == "3146") && (Session["FedId"].ToString() == "7"))
            {
                federationFolderURL = navigationUrl.Remove(navigationUrl.IndexOf("Summary.aspx")) + "/Acadamy";
            }
            else
            {
                federationFolderURL = navigationUrl.Remove(navigationUrl.IndexOf("Summary.aspx")) + "/";
            }
        }
        else
        {
            federationFolderURL = "";
        }
    }
Beispiel #6
0
        public static int getDaysInCamp(string FJCID)
        {
            CamperApplication oCA = new CamperApplication();
            DataSet           dsCamperApplication;
            DataRow           drCamper;
            int Days = 0;

            dsCamperApplication = oCA.getCamperApplication(FJCID);
            if (dsCamperApplication.Tables[0].Rows.Count > 0)
            {
                drCamper = dsCamperApplication.Tables[0].Rows[0];
                if (!Convert.IsDBNull(drCamper["Days"]))
                {
                    Days = Convert.ToInt32(drCamper["Days"]);
                }
            }

            //if number of days was not entered by Camp Director
            //it needs to be retirieved from a camper application
            if (Days == 0)
            {
                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.IsNullOrEmpty(drEndDate["Answer"].ToString()))
                    {
                        try
                        {
                            string strStartDate = Convert.ToString(drStartDate["Answer"]);
                            string strEndDate   = Convert.ToString(drEndDate["Answer"]);

                            DateTime dtStartDate = Convert.ToDateTime(strStartDate);
                            DateTime dtEndDate   = Convert.ToDateTime(strEndDate);

                            TimeSpan span = dtEndDate.Subtract(dtStartDate);
                            Days = span.Days + 1;
                        }
                        catch { Days = 0; }  //in case of wrong data
                    }
                }
            }
            return(Days);
        }
Beispiel #7
0
    void btnPrevious_Click(object sender, EventArgs e)
    {
        try
        {
            if (Page.IsValid)
            {
                InsertCamperAnswers();
                Session["FJCID"] = hdnFJCIDStep1_NL.Value;

                DataSet ds;
                int     iCount;
                General objGeneral = new General();

                //Ram 8 Nov'10
                string strZipCode = Session["ZIPCODE"].ToString();
                ds     = objGeneral.GetFederationForZipCode(strZipCode);
                iCount = ds.Tables[0].Rows.Count;
                string strFJCID, strAppType, strFJCIDFedId;
                strFJCID   = Session["FJCID"] != null ? Session["FJCID"].ToString() : string.Empty;
                strAppType = strFJCIDFedId = string.Empty;

                if (strFJCID != string.Empty)
                {
                    CamperApplication oCA = new CamperApplication();
                    DataSet           dsCamperApplication; dsCamperApplication = oCA.getCamperApplication(strFJCID);
                    DataRow           drCA; drCA = dsCamperApplication.Tables[0].Rows[0];
                    strFJCIDFedId = drCA["FederationId"] != null ? drCA["FederationId"].ToString().ToLower() : string.Empty;
                    strAppType    = drCA["AppType"] != null ? drCA["AppType"].ToString().ToLower() : string.Empty;
                }

                if (iCount > 1 && (strAppType != string.Empty && strAppType != "c"))
                {
                    Response.Redirect("Step1_Questions.aspx");
                }
                else if (ddlCamp.SelectedItem.Text.ToLower().Contains("camps airy louise"))
                {
                    Response.Redirect("Step1_WDC_CAL.aspx");
                }
                else
                {
                    Response.Redirect("Step1.aspx");
                }
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
    }
Beispiel #8
0
    private void PopulateDropdowns(int iCurrentStatus, string strCurrentStatus, int iFedID)
    {
        //Populate Camps dropdown
        DataSet dsCamps;

        _objGen       = new General();
        _objCamperApp = new CamperApplication();
        string _campYear = string.Empty;

        if (Session["FJCID"] != null)
        {
            DataSet dsCamperApplication = _objCamperApp.getCamperApplication(Session["FJCID"].ToString());
            if (dsCamperApplication.Tables.Count > 0 && dsCamperApplication.Tables[0].Rows.Count > 0)
            {
                _campYear = dsCamperApplication.Tables[0].Rows[0]["CampYear"].ToString();
            }
        }
        if (_campYear == string.Empty)
        {
            _campYear = Master.CampYear;
        }
        dsCamps                = _objGen.get_AllCampsBackend(_campYear);
        ddlCamp.DataSource     = dsCamps;
        ddlCamp.DataTextField  = "Camp";
        ddlCamp.DataValueField = "ID";

        ddlCamp.DataBind();
        if ((ddlCamp.Items.Count != 0))
        {
            ddlCamp.Items.Insert(0, new ListItem("--Select--", "-1"));
        }

        int iRoleId = Convert.ToInt32(Session["RoleID"]);

        //Populate Status dropdown
        DataSet dsStatus;

        _objGen                  = new General();
        dsStatus                 = _objGen.GetNextPossibleStatus(iRoleId, iCurrentStatus, iFedID);
        ddlStatus.DataSource     = dsStatus;
        ddlStatus.DataTextField  = "Status";
        ddlStatus.DataValueField = "StatusId";
        ddlStatus.DataBind();
        ddlStatus.Items.Remove(ddlStatus.Items.FindByValue("17"));
        ListItem li = new ListItem(strCurrentStatus, iCurrentStatus.ToString());

        ddlStatus.Items.Add(li);
    }
Beispiel #9
0
        public static int getCampID(string FJCID)
        {
            CamperApplication oCA = new CamperApplication();
            DataSet           dsCamperApplication;
            DataRow           drCamper;
            int CampID = 0;

            dsCamperApplication = oCA.getCamperApplication(FJCID);
            if (dsCamperApplication.Tables[0].Rows.Count > 0)
            {
                drCamper = dsCamperApplication.Tables[0].Rows[0];
                if (!Convert.IsDBNull(drCamper["Camp"]))
                {
                    CampID = Convert.ToInt32(drCamper["Camp"]);
                }
            }
            return(CampID);
        }
Beispiel #10
0
    void btnNext_Click(object sender, EventArgs e)
    {
        int iStatus;
        string strModifiedBy, strFJCID;
        EligibilityBase objEligibility = EligibilityFactory.GetEligibility(FederationEnum.Memphis);
        
        try
        {
            if (Page.IsValid)
            {
                if (!objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_2.Value, Master.CamperUserId))
                {
                    ProcessCamperAnswers();
                }
                bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_2.Value, Master.CamperUserId);
                //Modified by id taken from the Master Id
                strModifiedBy = Master.UserId;
                strFJCID = hdnFJCIDStep2_2.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();
                }
                Session["FJCID"] = hdnFJCIDStep2_2.Value;
                Response.Redirect("Step2_3.aspx");
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
    }
Beispiel #11
0
    private string GetGrantAmount()
    {
        var amount = "";

        if (Session["FJCID"] != null)
        {
            var     CamperAppl = new CamperApplication();
            DataSet dsTerms    = CamperAppl.getCamperApplication(Session["FJCID"].ToString());
            if (dsTerms.Tables[0].Rows.Count > 0)
            {
                DataRow dr1 = dsTerms.Tables[0].Rows[0];
                if (dr1["Amount"] != null)
                {
                    amount = dr1["Amount"].ToString();
                }
            }
        }
        return(amount);
    }
Beispiel #12
0
    private void checkNationalProgramRedirection()
    {
        CamperApplication oCA = new CamperApplication();
        string            strFJCID;

        strFJCID = Session["FJCID"].ToString();
        DataSet dsCamperApplication;
        DataRow drCA;

        dsCamperApplication = oCA.getCamperApplication(strFJCID);
        drCA = dsCamperApplication.Tables[0].Rows[0];

        if (!string.IsNullOrEmpty(drCA["AppType"].ToString()))
        {
            if (drCA["AppType"].ToString() == "C")
            {
                Response.Redirect("Step1_NL.aspx");
            }
        }
    }
Beispiel #13
0
    void btnNext_Click(object sender, EventArgs e)
    {
        //General objGen = new General();
        //int ZipCodeCount = objGen.ValidateNYZipCode(Session["ZIPCODE"].ToString());
        //if (ZipCodeCount == 0)
        //{
        //    Session["STATUS"] = "3";
        //    Response.Redirect("Step2_3.aspx");
        //}

        bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_2.Value, Master.CamperUserId);

        if (!isReadOnly)
        {
            ProcessCamperAnswers();
        }

        //Modified by id taken from the Master Id
        string strModifiedBy = Master.UserId;
        string strFJCID      = hdnFJCIDStep2_2.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.Poyntelle);
                objEligibility.checkEligibilityforStep2(strFJCID, out iStatus);
            }

            Session["STATUS"] = iStatus.ToString();
        }
        Session["FJCID"] = hdnFJCIDStep2_2.Value;

        Response.Redirect("Step2_3.aspx");
    }
Beispiel #14
0
    void btnNext_Click(object sender, EventArgs e)
    {
        int    iStatus;
        string strModifiedBy, strFJCID;

        if (!objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_2.Value, Master.CamperUserId))
        {
            ProcessCamperAnswers();
        }
        bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_2.Value, Master.CamperUserId);

        //Modified by id taken from the Master Id
        strModifiedBy = Master.UserId;
        strFJCID      = hdnFJCIDStep2_2.Value;
        if (strFJCID != "" && strModifiedBy != "")
        {
            if (isReadOnly)
            {
                DataSet dsApp = CamperAppl.getCamperApplication(strFJCID);
                iStatus = Convert.ToInt32(dsApp.Tables[0].Rows[0]["Status"]);
            }
            else
            {
                EligibilityBase objEligibility = EligibilityFactory.GetEligibility(FederationEnum.HabonimTavor);
                objEligibility.checkEligibilityforStep2(strFJCID, out iStatus);
            }

            Session["STATUS"] = iStatus.ToString();
        }
        Session["FJCID"] = hdnFJCIDStep2_2.Value;
        if (Request.QueryString["camp"] == "tavor")
        {
            Response.Redirect("Step2_3.aspx?camp=tavor");
        }
        else
        {
            Response.Redirect("Step2_3.aspx");
        }
    }
Beispiel #15
0
        public static void checkEligibilityDays2(string FJCID, int CampDays, out int StatusValue)
        {
            CamperApplication oCA           = new CamperApplication();
            decimal           StandardGrant = 0;
            bool SecondApprovalNeeded       = false;

            DataSet dsCamperApplication;

            dsCamperApplication = oCA.getCamperApplication(FJCID);
            DataRow drCamper;

            if (dsCamperApplication.Tables[0].Rows.Count > 0)
            {
                drCamper = dsCamperApplication.Tables[0].Rows[0];
                if (!Convert.IsDBNull(drCamper["SecondApproval"]))
                {
                    SecondApprovalNeeded = Convert.ToBoolean(drCamper["SecondApproval"]);
                }
            }

            StandardGrant = oCA.getCamperGrantForDays(FJCID, CampDays);

            if (StandardGrant > 0)
            {
                if (SecondApprovalNeeded)
                {
                    StatusValue = Convert.ToInt32(StatusInfo.SecondApproval);
                }
                else
                {
                    StatusValue = Convert.ToInt32(StatusInfo.PaymentPending);
                }
            }
            else
            {
                StatusValue = Convert.ToInt32(StatusInfo.IneligibleBasedonDays);
            }
        }
Beispiel #16
0
    // check for national program redirection.
    void checkNationalProgramRedirection()
    {
        CamperApplication oCA = new CamperApplication();
        string            strFJCID;

        strFJCID = Session["FJCID"].ToString();
        DataSet dsCamperApplication;
        DataRow drCA;

        dsCamperApplication = oCA.getCamperApplication(strFJCID);
        drCA = dsCamperApplication.Tables[0].Rows[0];

        //string strNextURL = string.Empty, strAction, strCamperUserId, strCheckUpdate, strFedId = string.Empty;
        UserDetails Info;
        string      strCheckUpdate;

        if (!string.IsNullOrEmpty(drCA["AppType"].ToString()))
        {
            if (drCA["AppType"].ToString() == "C")
            {
                Info = getUserInfoStructwithValues();
                //strAction = hdnPerformAction.Value;
                //strCamperUserId = Master.CamperUserId;

                strCheckUpdate = CheckforUpdate();
                //values has been changed and comments field is empty (only for Admin)

                if (strCheckUpdate == "0") //some modification done and user is not admin
                {
                    ProcessCamperInfo(Info);
                }

                Response.Redirect("Step1_NL.aspx");
            }
        }
    }
Beispiel #17
0
    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");
                }
            }
        }
    }
Beispiel #18
0
    void btnChkEligibility_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }

        General objGeneral = new General();
        bool    isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_3.Value, Master.CamperUserId);
        //Modified by id taken from the Master Id
        string strModifiedBy = Master.UserId;

        if (!isReadOnly)
        {
            var startDate = Convert.ToDateTime(txtStartDate.Text);
            var endDate   = Convert.ToDateTime(txtEndDate.Text);

            if (startDate > endDate)
            {
                lblMsg.Text = "Error: Start date must be earlier than end date.";
                return;
            }

            txtStartDate.Text = startDate.ToShortDateString();
            txtEndDate.Text   = endDate.ToShortDateString();

            InsertCamperAnswers();
        }
        int iCampId = Int32.Parse(ddlCamp.SelectedValue);

        Session["CampID"] = iCampId;
        string strFJCID = hdnFJCIDStep2_3.Value;
        //comments used only by the Admin user
        string strComments = txtComments.Text.Trim();

        int iStatus;

        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));

                EligibilityBase objEligibility = EligibilityFactory.GetEligibility(FederationEnum.Habonim, iCampId);
                objEligibility.checkEligibility(strFJCID, out iStatus);
            }

            var checkStatus = Convert.ToInt32(Session["STATUS"]);
            if (checkStatus == (int)StatusInfo.SystemInEligible)
            {
                iStatus = checkStatus;
            }
            else
            {
                Session["STATUS"] = iStatus;
            }

            if (iStatus == Convert.ToInt32(StatusInfo.SystemInEligible))
            {
                string strRedirURL;
                if (Master.UserId != Master.CamperUserId) //then the user is admin
                {
                    strRedirURL = ConfigurationManager.AppSettings["AdminRedirURL"];
                }
                else //the user is Camper
                {
                    strRedirURL = "../ThankYou.aspx";
                }
                //to update the status to the database
                if (!isReadOnly)
                {
                    CamperAppl.submitCamperApplication(strFJCID, strComments, Convert.ToInt32(strModifiedBy), iStatus);
                }
                Response.Redirect(strRedirURL, false);
            }
            else //if he/she is eligible
            {
                Session["FJCID"] = hdnFJCIDStep2_3.Value;

                if (Request.QueryString["camp"] == "tavor")
                {
                    Response.Redirect("../Step2_1.aspx?camp=tavor");
                }
                else
                {
                    Response.Redirect("../Step2_1.aspx");
                }
            }
        }
    }
Beispiel #19
0
    void btnChkEligibility_Click(object sender, EventArgs e)
    {
        int             iStatus, iCampId;
        string          strModifiedBy, strFJCID, strComments;
        EligibilityBase objEligibility = EligibilityFactory.GetEligibility(FederationEnum.SurpriseLake);

        try
        {
            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));

                        //to check whether the camper is eligible
                        objEligibility.checkEligibility(strFJCID, out iStatus);
                    }

                    var checkStatus = Convert.ToInt32(Session["STATUS"]);
                    if (checkStatus == (int)StatusInfo.SystemInEligible)
                    {
                        iStatus = checkStatus;
                    }
                    else
                    {
                        Session["STATUS"] = iStatus;
                    }

                    if (iStatus == Convert.ToInt32(StatusInfo.SystemInEligible))
                    {
                        string strRedirURL;
                        if (Master.UserId != Master.CamperUserId) //then the user is admin
                        {
                            strRedirURL = ConfigurationManager.AppSettings["AdminRedirURL"];
                        }
                        else //the user is Camper
                        {
                            strRedirURL = "../ThankYou.aspx";
                        }
                        //to update the status to the database
                        if (!isReadOnly)
                        {
                            CamperAppl.submitCamperApplication(strFJCID, strComments, Convert.ToInt32(strModifiedBy), iStatus);
                        }
                        Response.Redirect(strRedirURL, false);
                    }
                    else //if he/she is eligible
                    {
                        Session["FJCID"] = hdnFJCIDStep2_3.Value;
                        Response.Redirect("../Step2_1.aspx");
                    }
                }
                //Session["ZIPCODE"] = null;
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
        finally
        {
            objEligibility = null;
        }
    }
Beispiel #20
0
    void btnChkEligibility_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }

        bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_3.Value, Master.CamperUserId);

        string strModifiedBy = Master.UserId;

        if (!isReadOnly)
        {
            InsertCamperAnswers();
        }
        int iCampId     = Convert.ToInt32(ddlCamp.SelectedValue);
        var strFJCID    = hdnFJCIDStep2_3.Value;
        var strComments = txtComments.Text.Trim();

        if (strFJCID != "" && strModifiedBy != "")
        {
            int iStatus;
            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.RamahPoconos);
                objEligibility.checkEligibility(strFJCID, out iStatus);
            }

            var checkStatus = Convert.ToInt32(Session["STATUS"]);
            if (checkStatus == (int)StatusInfo.SystemInEligible)
            {
                iStatus = checkStatus;
            }
            else
            {
                Session["STATUS"] = iStatus;
            }

            if (iStatus == Convert.ToInt32(StatusInfo.SystemInEligible))
            {
                string strRedirURL;
                if (Master.UserId != Master.CamperUserId) //then the user is admin
                {
                    strRedirURL = ConfigurationManager.AppSettings["AdminRedirURL"];
                }
                else //the user is Camper
                {
                    strRedirURL = "../ThankYou.aspx";
                }
                //to update the status to the database
                if (!isReadOnly)
                {
                    CamperAppl.submitCamperApplication(strFJCID, strComments, Convert.ToInt32(strModifiedBy), iStatus);
                }
                Response.Redirect(strRedirURL, false);
            }
            else //if he/she is eligible
            {
                Session["FJCID"] = hdnFJCIDStep2_3.Value;
                Response.Redirect("../Step2_1.aspx");
            }
        }
    }
Beispiel #21
0
    protected void gvApplications_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "FJCID")
        {
            Session["FJCID"] = e.CommandArgument.ToString();
            //Session["CampYear"] = Session["FJCID"].ToString().Substring(0, 4);
            string strRedirURL = "";

            DataSet           dsCamperApplication;
            DataRow           drCA;
            CamperApplication oCA = new CamperApplication();
            dsCamperApplication = oCA.getCamperApplication(e.CommandArgument.ToString());
            drCA = dsCamperApplication.Tables[0].Rows[0];

            if (!string.IsNullOrEmpty(drCA["AppType"].ToString()))
            {
                if (drCA["AppType"].ToString() == "D")
                {
                    strRedirURL = "DeleteMessage.aspx";
                }
                else
                {
                    strRedirURL = ConfigurationManager.AppSettings["CamperBasicInfo"].ToString();
                }
            }
            else
            {
                strRedirURL = ConfigurationManager.AppSettings["CamperBasicInfo"].ToString();
            }

            Server.Transfer(strRedirURL);
        }
        else if (e.CommandName == "CLONE_FJCID")
        {
            string            strRedirURL = ConfigurationManager.AppSettings["CamperBasicInfo"].ToString();
            string            sOldFJCID   = e.CommandArgument.ToString();
            CamperApplication CamperAppl  = new CamperApplication();
            string            newFJCID;
            int retVal;

            retVal = CamperAppl.CopyCamperApplication(sOldFJCID, out newFJCID);

            Session["FJCID"]  = newFJCID;
            Session["STATUS"] = 5;

            // reset the session values
            Session["FEDNAME"] = null;

            Server.Transfer(strRedirURL);
        }
        else if (e.CommandName == "CheckStatus")
        {
            Session["FJCID"] = e.CommandArgument.ToString();
            string strRedirURL = "~/TrackMyStatus.aspx";
            Server.Transfer(strRedirURL);
        }
        else if (e.CommandName == "ViewApplication")
        {
            Session["FJCID"] = e.CommandArgument.ToString();
            string strRedirURL = "";

            DataSet           dsCamperApplication;
            DataRow           drCA;
            CamperApplication oCA = new CamperApplication();
            dsCamperApplication = oCA.getCamperApplication(e.CommandArgument.ToString());
            drCA = dsCamperApplication.Tables[0].Rows[0];

            if (!string.IsNullOrEmpty(drCA["AppType"].ToString()))
            {
                if (drCA["AppType"].ToString() == "D")
                {
                    strRedirURL = "DeleteMessage.aspx";
                }
                else
                {
                    strRedirURL = ConfigurationManager.AppSettings["CamperBasicInfo"].ToString();
                }
            }
            else
            {
                strRedirURL = ConfigurationManager.AppSettings["CamperBasicInfo"].ToString();
            }

            Response.Redirect(strRedirURL);
            //Server.Transfer(strRedirURL);
        }
    }
Beispiel #22
0
    void btnChkEligibility_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }

        if (ddlCamp.SelectedValue == "-1")
        {
            Response.Redirect("../Step1_NL.aspx");
        }

        int    iStatus, iCampId;
        string strModifiedBy, strFJCID, strComments;

        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));

                //to check whether the camper is eligible
                EligibilityBase objEligibility = EligibilityFactory.GetEligibility(FederationEnum.Toronto);
                objEligibility.checkEligibility(strFJCID, out iStatus);
            }

            // 2013-08-26 Make sure we keep the EligiblePendingNumberOfDays alive here, so the final Thank you page will show the right info
            if ((StatusInfo)Session["STATUS"] != StatusInfo.EligiblePendingNumberOfDays)
            {
                Session["STATUS"] = iStatus;
            }

            if (iStatus == (int)StatusInfo.SystemInEligible)
            {
                if (!isReadOnly)
                {
                    CamperAppl.submitCamperApplication(strFJCID, strComments, Convert.ToInt32(strModifiedBy), iStatus);
                }

                if (Master.UserId != Master.CamperUserId) //then the user is admin
                {
                    Response.Redirect(ConfigurationManager.AppSettings["AdminRedirURL"]);
                }
                else //the user is Camper
                {
                    Response.Redirect("../ThankYou.aspx");
                }
            }
            else // Eligible or related status
            {
                Session["FJCID"] = hdnFJCIDStep2_3.Value;
                Response.Redirect("../Step2_1.aspx");
            }
        }
    }
Beispiel #23
0
    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");
        }
    }
Beispiel #24
0
        public static void checkEligibilityDays(string FJCID, int CampDays, out int StatusValue)
        {
            CamperApplication oCA = new CamperApplication();

            Boolean TwoWeeksSession      = false;
            Boolean ThreeWeeksSession    = false;
            Boolean SecondApprovalNeeded = false;

            DataSet dsCamperApplication;

            dsCamperApplication = oCA.getCamperApplication(FJCID);
            DataRow drCamper;

            if (dsCamperApplication.Tables[0].Rows.Count > 0)
            {
                drCamper             = dsCamperApplication.Tables[0].Rows[0];
                SecondApprovalNeeded = Convert.ToBoolean(drCamper["SecondApproval"]);
            }

            DataSet dsCampSession;

            dsCampSession = oCA.getCamperAnswers(FJCID, "12", "12", "N");
            DataRow drStartDate;
            DataRow drEndDate;

            StatusValue = Convert.ToInt32(StatusInfo.RegAcceptedCamp);

            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 > 11) && (iDays < 19))
                    {
                        TwoWeeksSession = true;
                    }
                    if ((iDays > 18))
                    {
                        ThreeWeeksSession = true;
                    }


                    if (TwoWeeksSession || ThreeWeeksSession)
                    {
                        if (TwoWeeksSession)
                        {
                            if (CampDays > 11)
                            {
                                if (SecondApprovalNeeded)
                                {
                                    StatusValue = Convert.ToInt32(StatusInfo.SecondApproval);
                                }
                                else
                                {
                                    StatusValue = Convert.ToInt32(StatusInfo.PaymentPending);
                                }
                            }
                            else
                            {
                                StatusValue = Convert.ToInt32(StatusInfo.IneligibleBasedonDays);
                            }
                        }
                        if (ThreeWeeksSession)
                        {
                            if (CampDays > 18)
                            {
                                if (SecondApprovalNeeded)
                                {
                                    StatusValue = Convert.ToInt32(StatusInfo.SecondApproval);
                                }
                                else
                                {
                                    StatusValue = Convert.ToInt32(StatusInfo.PaymentPending);
                                }
                            }
                            else
                            {
                                StatusValue = Convert.ToInt32(StatusInfo.IneligibleBasedonDays);
                            }
                        }
                    }
                    else
                    {
                        StatusValue = Convert.ToInt32(StatusInfo.IneligibleBasedonDays);
                    }
                }
            }
            else
            {
                StatusValue = Convert.ToInt32(StatusInfo.IneligibleBasedonDays);
            }
        }
Beispiel #25
0
    void btnNext_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }

        bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_2.Value, Master.CamperUserId);

        if (!isReadOnly)
        {
            ProcessCamperAnswers();
        }

        //Modified by id taken from the Master Id
        string strModifiedBy = Master.UserId;
        string strFJCID      = hdnFJCIDStep2_2.Value;

        if (strFJCID != "" && strModifiedBy != "")
        {
            int iStatus;
            if (isReadOnly)
            {
                DataSet dsApp = CamperAppl.getCamperApplication(strFJCID);
                iStatus = Convert.ToInt32(dsApp.Tables[0].Rows[0]["Status"]);
            }
            else
            {
                //EligibilityBase objEligibility = EligibilityFactory.GetEligibility(FederationEnum.PJL);
                var pjl = new EligibilityPJL(FederationEnum.PJL);
                pjl.checkEligibilityforStep2(strFJCID, out iStatus, (StatusInfo)Convert.ToInt32(Session["STATUS"]));
            }

            // 2014-07-28 Starting for Year 2015, PJL has lottery system that campers failed through other community program could land this page with EligiblePJLottery status
            if (Session["STATUS"] != null)
            {
                var checkStatus = (StatusInfo)Convert.ToInt32(Session["STATUS"]);

                // if this page's iStatus is ineligible, we don't even allow it to have PendingLottery
                if ((checkStatus == StatusInfo.EligiblePJLottery || checkStatus == StatusInfo.SystemInEligible) && (StatusInfo)iStatus != StatusInfo.SystemInEligible)
                {
                    iStatus = (int)checkStatus;
                }
            }

            var isOn = false;
            if (ConfigurationManager.AppSettings["PJLottery"] == "On")
            {
                isOn = true;
            }

            if (!isOn && iStatus == (int)StatusInfo.EligiblePJLottery)
            {
                iStatus = (int)StatusInfo.SystemInEligible;
            }

            Session["STATUS"] = iStatus.ToString();
        }
        Session["FJCID"] = hdnFJCIDStep2_2.Value;

        var nextUrl = "Step2_3.aspx";

        if (Request.QueryString["prev"] != null)
        {
            nextUrl += "?prev=" + Request.QueryString["prev"];

            if (Request.QueryString["prevfedid"] != null)
            {
                nextUrl += "&prevfedid=" + Request.QueryString["prevfedid"];
            }
        }

        Response.Redirect(nextUrl);
    }
Beispiel #26
0
        /// <summary>
        /// GetCamperApplicationDetails (CurrentFederation, PJLCode,MiiPCode,SadiegoZipCode if JWest,etc  required for the redirection logic from the FJCID)
        /// </summary>
        /// <param name="FJCID"></param>
        private void GetCamperApplicationDetails(string FJCID)
        {
            CamperApplication _objCamperApplication = new CamperApplication();
            DataSet           dsCamperApplication   = _objCamperApplication.getCamperApplication(FJCID);
            string            zipCode  = string.Empty;
            string            pjlCode  = string.Empty;
            string            camperID = string.Empty;

            if (dsCamperApplication.Tables.Count > 0)
            {
                if (dsCamperApplication.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = dsCamperApplication.Tables[0].Rows[0];
                    if (String.IsNullOrEmpty(dr["CMART_MiiP_ReferalCode"].ToString()))
                    {
                        IsValidMiiPCodeEntered = false;
                    }
                    else
                    {
                        IsValidMiiPCodeEntered = true;
                    }

                    if (String.IsNullOrEmpty(dr["PJLCode"].ToString()))
                    {
                        IsValidPJLCodeEntered = false;
                    }
                    else
                    {
                        IsValidPJLCodeEntered = true;
                        pjlCode = dr["PJLCode"].ToString();
                    }

                    if (String.IsNullOrEmpty(dr["FederationId"].ToString()))
                    {
                        CurrentFederationId = 0;
                    }
                    else
                    {
                        CurrentFederationId = Int32.Parse(dr["FederationId"].ToString());
                    }

                    if (!String.IsNullOrEmpty(dr["Zip"].ToString()))
                    {
                        zipCode = dr["Zip"].ToString();
                    }

                    if (!String.IsNullOrEmpty(dr["CamperID"].ToString()))
                    {
                        camperID = dr["CamperID"].ToString();
                    }
                }
            }

            if (zipCode != String.Empty)
            {
                General _objGeneral  = new General();
                DataSet dsFederation = _objGeneral.GetFederationForZipCode(zipCode);
                if (dsFederation.Tables.Count > 0)
                {
                    if (dsFederation.Tables[0].Rows.Count > 0)
                    {
                        DataRow dr = dsFederation.Tables[0].Rows[0];
                        if (dr["Federation"].ToString() == "72")
                        {
                            IsSandiegoZipCode = true;
                        }
                        else
                        {
                            IsSandiegoZipCode = false;
                        }

                        if (dr["Federation"].ToString() == "93")
                        {
                            IsColoradoZipCode = true;
                        }
                        else
                        {
                            IsColoradoZipCode = false;
                        }

                        if (dr["Federation"].ToString() == "95")
                        {
                            IsPalmSpringsZipCode = true;
                        }
                        else
                        {
                            IsPalmSpringsZipCode = false;
                        }

                        if (dr["Federation"].ToString() == "98")
                        {
                            IsSanFranciscoZipCode = true;
                        }
                        else
                        {
                            IsSanFranciscoZipCode = false;
                        }
                    }
                }
            }
            else
            {
                IsSandiegoZipCode     = false;
                IsColoradoZipCode     = false;
                IsPalmSpringsZipCode  = false;
                IsSanFranciscoZipCode = false;
            }

            if (zipCode != String.Empty)
            {
                General _objGeneral  = new General();
                DataSet dsFederation = _objGeneral.GetFederationForZipCode(zipCode);
                if (dsFederation.Tables.Count > 0)
                {
                    if (dsFederation.Tables[0].Rows.Count > 0)
                    {
                        DataRow dr = dsFederation.Tables[0].Rows[0];
                        if (dr["Federation"].ToString() == "23")
                        {
                            IsLACIPZipCode = true;
                        }
                        else
                        {
                            IsLACIPZipCode = false;
                        }
                    }
                }
            }
            else
            {
                IsLACIPZipCode = false;
            }

            if (camperID != string.Empty) // This will check if the camper has already submitted MiiP/PJL application using this redirection logic
            {
                DataSet   dsListOfDeletedCamperApplications = new DataSet();
                DataRow[] drArray = new DataRow[0];
                dsListOfDeletedCamperApplications = _objCamperApplication.GetCamperApplicationsFromCamperID(camperID);
                if (dsListOfDeletedCamperApplications.Tables.Count > 0)
                {
                    if (dsListOfDeletedCamperApplications.Tables[0].Rows.Count > 0)
                    {
                        drArray = dsListOfDeletedCamperApplications.Tables[0].Select("Type='D'", "FJCID ASC");
                    }
                }
                if (drArray.Length > 0)
                {
                    foreach (DataRow dr in drArray)
                    {
                        if (dr["FederationID"].ToString() == "72")
                        {
                            BeenToSandiego = true;
                        }
                        if (dr["FederationID"].ToString() == "98")
                        {
                            BeenToSanFrancisco = true;
                        }
                        if (dr["FederationID"].ToString() == "93")
                        {
                            BeenToColorado = true;
                        }
                        if (dr["FederationID"].ToString() == "23")
                        {
                            BeenToLACIP = true;
                        }
                        if (dr["FederationID"].ToString() == "48")
                        {
                            BeenToMiiP = true;
                        }
                        if (dr["FederationID"].ToString() == "63" || pjlCode.ToLower() == ConfigurationManager.AppSettings["SpecialPJLCode"].ToLower())
                        {
                            BeenToPJL = true;
                        }
                    }
                }
            }
        }
Beispiel #27
0
    void btnNext_Click(object sender, EventArgs e)
    {
        int             iStatus;
        string          strModifiedBy, strFJCID;
        EligibilityBase objEligibility = EligibilityFactory.GetEligibility(FederationEnum.JWestLA);

        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);
        }
    }
Beispiel #28
0
    void btnNext_Click(object sender, EventArgs e)
    {
        bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_2.Value, Master.CamperUserId);

        if (!isReadOnly)
        {
            ProcessCamperAnswers();
        }

        //Modified by id taken from the Master Id
        string strModifiedBy = Master.UserId;
        string strFJCID      = hdnFJCIDStep2_2.Value;
        int    iStatus       = Convert.ToInt32(StatusInfo.SystemInEligible);

        if (strFJCID != "" && strModifiedBy != "")
        {
            if (isReadOnly)
            {
                DataSet dsApp = CamperAppl.getCamperApplication(strFJCID);
                iStatus = Convert.ToInt32(dsApp.Tables[0].Rows[0]["Status"]);
            }
            else
            {
                var objEligibility = EligibilityFactory.GetEligibility(FederationEnum.Atlanta);
                EligibilityBase.EligibilityResult result = objEligibility.checkEligibilityforStep2(strFJCID, out iStatus, SessionSpecialCode.GetPJLotterySpecialCode());

                if (result.SchoolType == StatusInfo.EligiblePJLottery)
                {
                    iStatus = (int)StatusInfo.EligiblePJLottery;
                }
                else if (result.CurrentUserStatusFromDB == StatusInfo.SystemInEligible ||
                         result.Grade == StatusInfo.SystemInEligible ||
                         result.SchoolType == StatusInfo.SystemInEligible ||
                         result.TimeInCamp == StatusInfo.SystemInEligible)
                {
                    iStatus = (int)StatusInfo.SystemInEligible;
                }
                //else if (rdoNo160.Checked)
                //{
                //    // 2015-01-07 If Income is not less thant $160K, we make them ineligible.
                //    iStatus = (int)StatusInfo.SystemInEligible;
                //}
                //else
                //{
                //    iStatus = (int) StatusInfo.SystemEligible;
                //}

                if (rdoFirstTimerNo.Checked || rdoFirstTimerNo11days.Checked)
                {
                    iStatus = (int)StatusInfo.SystemInEligible;
                }

                //if (iStatus == (int)StatusInfo.SystemEligible)
                //{
                //    if (rdoFirstTimerNo.Checked)
                //    {
                //        if (rdoLastYearNo.Checked)
                //            iStatus = (int)StatusInfo.SystemInEligible;
                //        else if (rdoLastYearYes.Checked)
                //        {
                //            if (rdoNo160.Checked)
                //                iStatus = (int)StatusInfo.SystemInEligible;
                //        }
                //    }
                //}
            }
            Session["STATUS"] = iStatus.ToString();
        }
        Session["FJCID"] = hdnFJCIDStep2_2.Value;

        var status = (StatusInfo)iStatus;

        Response.Redirect(AppRouteManager.GetNextRouteBasedOnStatus(status, HttpContext.Current.Request.Url.AbsolutePath));
    }
Beispiel #29
0
    void btnChkEligibility_Click(object sender, EventArgs e)
    {
        if (ddlCamp.SelectedValue == "-1")
        {
            Response.Redirect("../Step1_NL.aspx");
        }

        int    iStatus, iCampId;
        string strComments, strFJCID, strModifiedBy;

        if (Page.IsValid)
        {
            bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCID.Value, Master.CamperUserId);
            if (!isReadOnly)
            {
                DateTime startDate, endDate;
                try
                {
                    startDate = Convert.ToDateTime(txtStartDate.Text);
                    endDate   = Convert.ToDateTime(txtEndDate.Text);
                }
                catch (Exception)
                {
                    lblMsg.Text = "Error: The dates are wrong format.";
                    return;
                }

                if (startDate > endDate)
                {
                    lblMsg.Text = "Error: Start date must be earlier than end date.";
                    return;
                }

                txtStartDate.Text = startDate.ToShortDateString();
                txtEndDate.Text   = endDate.ToShortDateString();

                InsertCamperAnswers();
            }
            //if (RadioBtnQ7.Items[1].Selected)
            //{
            //    lblMsgCA.Visible = true;
            //    return;
            //}
            //else
            //    lblMsgCA.Visible = false;
            iCampId = Convert.ToInt32(ddlCamp.SelectedValue);

            //to get the comments (used only by the Admin user);
            strComments = txtComments.Text.Trim();

            strFJCID      = hdnFJCID.Value;
            strModifiedBy = Master.UserId;

            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.LACIP);
                    objEligibility.checkEligibility(strFJCID, out iStatus);
                }

                var checkStatus = Convert.ToInt32(Session["STATUS"]);
                if (checkStatus == (int)StatusInfo.SystemInEligible)
                {
                    iStatus = checkStatus;
                }
                else
                {
                    Session["STATUS"] = iStatus;
                }

                if (iStatus == Convert.ToInt32(StatusInfo.SystemInEligible))
                {
                    string strRedirURL;
                    if (Master.UserId != Master.CamperUserId) //then the user is admin
                    {
                        strRedirURL = ConfigurationManager.AppSettings["AdminRedirURL"];
                    }
                    else //the user is Camper
                    {
                        strRedirURL = "../ThankYou.aspx";
                    }
                    //to update the status to the database
                    if (!isReadOnly)
                    {
                        CamperAppl.submitCamperApplication(strFJCID, strComments, Convert.ToInt32(strModifiedBy), iStatus);
                    }
                    Response.Redirect(strRedirURL, false);
                }
                else //if he/she is eligible
                {
                    Session["FJCID"] = strFJCID;
                    Response.Redirect("../Step2_1.aspx");
                }
            }
        }
    }
Beispiel #30
0
    //to get the camper answers from the database
    void getCamperAnswers()
    {
        int         iCount;
        DataView    dv;
        HiddenField hdnval;

        DataRow[]       drows;
        DataRow         dr;
        TextBox         tb;
        RadioButtonList rb;
        DropDownList    ddl;
        CheckBoxList    cb;
        string          strFilter, strFJCID;

        strFJCID = hdnFJCID_OtherInfo.Value;

        DataSet dsAnswers = CamperAppl.getCamperAnswers(strFJCID, "30", "1026", "N");

        if (dsAnswers.Tables[0].Rows.Count == 0) //if there are records for the current FJCID
        {
            return;
        }

        dv = dsAnswers.Tables[0].DefaultView;
        //to display answers for the QuestionId from 1001 - 1004 in Other info page
        for (int i = 1; i <= 15; i++)
        {
            //to get the QuestionId for the Questions
            hdnval    = (HiddenField)PnlHidden.FindControl("hdnQ" + i.ToString() + "Id");
            strFilter = "QuestionId = '" + hdnval.Value + "'";
            rb        = null;
            tb        = null;
            ddl       = null;
            iCount    = dsAnswers.Tables[0].Rows.Count;

            switch (i)
            {
            case 1:      //assigning the answer for question 1
                rb = RadioBtnQ1;
                goto default;

            case 2:     //assigning the answer for question 2
                tb = txtSynagogue;
                goto default;

            case 3:     //assigning the answer for question 3
                rb = RadioBtnQ3;
                goto default;

            case 4:     //assigning the answer for question 4
                rb = RadioBtnQ4;
                goto default;

            case 5:     //assigning the answer for question 5
                rb = RadioBtnQ5;
                goto default;

            case 6:     //assigning the answer for question 6
                foreach (DataRow dr1 in dv.Table.Select(strFilter))
                {
                    if (!dr1["OptionID"].Equals(DBNull.Value))
                    {
                        switch (dr1["OptionID"].ToString())
                        {
                        case "1":          //for Parent 1 Country
                            //txtCountry1.Text = dr1["Answer"].Equals(DBNull.Value) ? "" : dr1["Answer"].ToString();
                            if (!dr1["Answer"].Equals(DBNull.Value))
                            {
                                ddlCountry1.SelectedValue = dr1["Answer"].ToString();
                            }
                            break;

                        case "2":         //for End Date
                            //txtCountry2.Text = dr1["Answer"].Equals(DBNull.Value) ? "" : dr1["Answer"].ToString();
                            if (!dr1["Answer"].Equals(DBNull.Value))
                            {
                                ddlCountry2.SelectedValue = dr1["Answer"].ToString();
                            }
                            break;
                        }
                    }
                }
                break;

            case 7:     //assigning the answer for question 7
            //    rb = RadioBtnQ7;
            //    goto default;
            case 8:     //assigning the answer for question 8
                ddl = ddlQ8;
                goto default;

            case 9:     //assigning the answer for question 9
                //ddl = ddlQ9;
                //goto default;
                foreach (DataRow dr1 in dv.Table.Select(strFilter))
                {
                    if (!dr1["OptionID"].Equals(DBNull.Value))
                    {
                        int value = Convert.ToInt32(dr1["OptionID"].ToString());
                        if (value > 0)
                        {
                            chkQ9.Items.FindByValue(value.ToString()).Selected = true;
                        }
                    }
                }
                break;

            case 10:     //assigning the answer for question 10
                foreach (DataRow dr1 in dv.Table.Select(strFilter))
                {
                    if (!dr1["OptionID"].Equals(DBNull.Value))
                    {
                        int value = Convert.ToInt32(dr1["OptionID"].ToString());
                        if (value > 0)
                        {
                            chkQ10.Items.FindByValue(value.ToString()).Selected = true;
                        }
                    }
                }
                break;

            case 11:     //assigning the answer for question 11
            //    rb = RadioBtnQ11;
            //    goto default;
            case 12:     //assigning the answer for question 12
            //    rb = RadioBtnQ12;
            //    goto default;
            case 13:     //assigning the answer for question 13
                dv.RowFilter = strFilter;
                if (dv.Table.Select(strFilter).Length > 0)
                {
                    div_dtlist.Visible         = true;
                    dlInviteFriends.Visible    = true;
                    dlInviteFriends.DataSource = dv;
                    dlInviteFriends.DataBind();
                }
                break;

            case 14:     //assigning the answer for question 2
                foreach (DataRow dr1 in dv.Table.Select(strFilter))
                {
                    //if (!dr1["OptionID"].Equals(DBNull.Value))
                    //{
                    //if (dr1["OptionID"].ToString().Equals("4"))
                    //{
                    if (!dr1["Answer"].Equals(DBNull.Value))
                    {
                        txtJCC.Text = dr1["Answer"].ToString();
                    }

                    //}
                    //}
                }
                break;

            case 15:     //assigning the answer for question 5
                rb = RadioBtnQ6;
                goto default;

            default:
                drows = dv.Table.Select(strFilter);
                if (drows.Length > 0)     //if there are rows for the filter
                {
                    dr = (DataRow)drows.GetValue(0);
                    //for dropdownlist
                    if (ddl != null)
                    {
                        if (!dr["OptionID"].Equals(DBNull.Value))
                        {
                            ddl.SelectedValue = dr["OptionID"].ToString();
                        }
                    }
                    //for text box
                    if (tb != null)
                    {
                        if (!dr["Answer"].Equals(DBNull.Value))
                        {
                            tb.Text = dr["Answer"].ToString();
                        }
                    }
                    //for radio buttonlist
                    if (rb != null)
                    {
                        if (!dr["OptionID"].Equals(DBNull.Value))
                        {
                            rb.SelectedValue = dr["OptionID"].ToString();
                        }
                    }
                }
                break;
            }
        }

        DataSet dsSynagogues = new DataSet();
        DataSet DsJcc        = new DataSet();

        for (int i = 0; i < dsAnswers.Tables[0].Rows.Count; i++)
        {
            if (dsAnswers.Tables[0].Rows[i][1].ToString() != null)
            {
                if ((dsAnswers.Tables[0].Rows[i][1].ToString() == "30"))
                {
                    if (RadioBtnQ1.SelectedValue == "")
                    {
                        RadioBtnQ1.SelectedValue = "2";
                    }
                    if (RadioBtnQ4.SelectedValue == "")
                    {
                        RadioBtnQ4.SelectedValue = "2";
                    }
                }
                if ((dsAnswers.Tables[0].Rows[i][1].ToString() == "30") && ((SynagogueJCCOther)Convert.ToInt32(dsAnswers.Tables[0].Rows[i][2]) == SynagogueJCCOther.Other))
                {
                    RadioBtnQ1.SelectedValue = "2";
                    RadioBtnQ4.SelectedValue = "2";
                    RadioBtnQ1.Enabled       = false;
                    RadioBtnQ4.Enabled       = false;
                    txtSynagogue.Enabled     = false;
                    txtJCC.Enabled           = false;
                    txtSynagogue.Text        = "";
                    txtJCC.Text = "";
                    break;
                }
                else if ((dsAnswers.Tables[0].Rows[i][1].ToString() == "30") && ((SynagogueJCCOther)Convert.ToInt32(dsAnswers.Tables[0].Rows[i][2]) == SynagogueJCCOther.Synagogue))
                {
                    RadioBtnQ1.SelectedValue = "1";
                    RadioBtnQ1.Enabled       = false;
                    txtJCC.Enabled           = false;
                }
                else if ((dsAnswers.Tables[0].Rows[i][1].ToString() == "30") && ((SynagogueJCCOther)Convert.ToInt32(dsAnswers.Tables[0].Rows[i][2]) == SynagogueJCCOther.JCC))
                {
                    RadioBtnQ4.SelectedValue = "1";
                    RadioBtnQ4.Enabled       = false;
                    txtSynagogue.Enabled     = false;
                }

                if (dsAnswers.Tables[0].Rows[i][1].ToString() == "31")
                {
                    if ((dsAnswers.Tables[0].Rows[i][2].ToString() == "1"))
                    {
                        if ((dsAnswers.Tables[0].Rows[i][3].ToString() != null) && (dsAnswers.Tables[0].Rows[i][3].ToString().Trim() != ""))
                        {
                            int federationID = Convert.ToInt32(Session["FedId"].ToString());
                            dsSynagogues = objGeneral.GetSynagogueByID(dsAnswers.Tables[0].Rows[i][3].ToString(), federationID);
                            if (dsSynagogues.Tables[0].Rows.Count > 0)
                            {
                                txtSynagogue.Text    = dsSynagogues.Tables[0].Rows[0][1].ToString();
                                txtSynagogue.Enabled = false;
                            }
                        }
                    }

                    if ((dsAnswers.Tables[0].Rows[i][2].ToString() == "2"))
                    {
                        if ((dsAnswers.Tables[0].Rows[i][3].ToString() != null) && (dsAnswers.Tables[0].Rows[i][3].ToString().Trim() != ""))
                        {
                            txtSynagogue.Text    = dsAnswers.Tables[0].Rows[i][3].ToString();
                            txtSynagogue.Enabled = false;
                        }
                    }

                    if ((dsAnswers.Tables[0].Rows[i][2].ToString() == "3"))
                    {
                        if ((dsAnswers.Tables[0].Rows[i][3].ToString() != null) && (dsAnswers.Tables[0].Rows[i][3].ToString().Trim() != ""))
                        {
                            DsJcc          = objGeneral.GetJCCByID(dsAnswers.Tables[0].Rows[i][3].ToString());
                            txtJCC.Text    = DsJcc.Tables[0].Rows[0][1].ToString();
                            txtJCC.Enabled = false;
                        }
                    }

                    if ((dsAnswers.Tables[0].Rows[i][2].ToString() == "4"))
                    {
                        if ((dsAnswers.Tables[0].Rows[i][3].ToString() != null) && (dsAnswers.Tables[0].Rows[i][3].ToString().Trim() != ""))
                        {
                            txtJCC.Text    = dsAnswers.Tables[0].Rows[i][3].ToString();
                            txtJCC.Enabled = false;
                        }
                    }
                }
            }
        }

        DataSet dsTerms = CamperAppl.getCamperApplication(strFJCID);

        if (dsTerms.Tables[0].Rows.Count > 0)
        {
            dr = dsTerms.Tables[0].Rows[0];
            if (!dr["ConfirmAcceptance"].Equals(DBNull.Value))
            {
                chkAgreement.Checked = (Boolean)dr["ConfirmAcceptance"];
            }
        }

        //to set the panel status based on the radio button selected
        setPanelStatus();
    }