Example #1
0
    protected void lnkCopyApp_Click(object sender, EventArgs e)
    {
        var camperAppl = new CamperApplication();

        var redirectionLogic = new Redirection_Logic();

        string newFJCID;

        camperAppl.CopyCamperApplication(Session["FJCID"].ToString(), out newFJCID);
        redirectionLogic.PageName = (int)Redirection_Logic.PageNames.ThankYou;// Added this flag to avoid confusion of setting federation id if new app is created and set the newfederationid =0
        redirectionLogic.GetNextFederationDetails(Session["FJCID"].ToString());
        int nextFederationId = redirectionLogic.NextFederationId;

        if ((nextFederationId == 72 || nextFederationId == 93) && !String.IsNullOrEmpty(newFJCID))
        {
            camperAppl.DeleteCamperAnswerUsingFJCID(newFJCID);
        }

        if (nextFederationId == 0)
        {
            Session["FedId"] = null;
        }
        else
        {
            Session["FedId"] = nextFederationId.ToString();
        }

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



        // 2013-10-31 we must delete the codeValue Session variable
        if (redirectionLogic.BeenToPJL)
        {
            Session["codeValue"] = null;
        }

        // 2014-10-15 no one should pass to PJL now because PJL only accept JDS users but JDS users are routed to PJ Lottery already
        // all other failed applicants must
        if (redirectionLogic.NextFederationURL == "~/Enrollment/PJL/Summary.aspx")
        {
            camperAppl.UpdateFederationId(Session["FJCID"].ToString(), "0");
            redirectionLogic.NextFederationId = 0;
            Session["FedId"]     = null;
            Session["codeValue"] = null;
            Response.Redirect("Step1_NL.aspx");
        }
        else
        {
            camperAppl.UpdateFederationId(Session["FJCID"].ToString(), nextFederationId.ToString());
            Response.Redirect(redirectionLogic.NextFederationURL);
        }
    }