Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Properties For The Base Class and Check Login
            LoginID = Request.QueryString["LoginID"];
            LoginInfo = CCLib.Login.GetLoginInfo(LoginID);
            Redirect();
            PageTitle = GetPortText(5357, false);
            Section = "portfolio_tool";
            CSS = "student";
            HeadTag = "<STYLE TYPE='TEXT/CSS'><!--.btnDescription {  font: 11px Verdana, Arial, Helvetica, sans-serif; margin: 0px 15px}--></STYLE>";
            BodyTag = " alink='#990000' style='background-image:url(/media/shared/bg_left_bar_grey.gif);background-repeat:repeat-y;' bgcolor='#ffffff' leftmargin=0 link='#003366' text='#000000' topmargin=0 vlink='#003366' marginwidth='0' marginheight='0'";
            LeftBar = "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='0'><TR VALIGN='TOP' BGCOLOR='#669966'><td background='/media/portfolio_tool/bg_bar_tan_top.gif'><img height=23 src='/media/student_parent/icons/icon_arrow.gif' alt='' width=24><img height=23 src='/media1/" + this.PortType + "/h_h_main" + this.SuffixCode() + ".gif' alt='' width=141>";
            #endregion Properties For The Base Class and Check Login

            #region Initialize Values and Form Execution
            CheckPortSession();
            strSubSection = (CCLib.Common.Strings.GetQueryString("SubSection") == "") ? "List" : CCLib.Common.Strings.GetQueryString("SubSection");
            strAP = Request.QueryString["AP"];
            strStOrder = CCLib.Common.Strings.GetQueryString("storder");
            strSt = CCLib.Common.Strings.GetQueryString("st");
            strAction = CCLib.Common.Strings.GetQueryString("action");
            strLbl = CCLib.Common.Strings.GetQueryString("Lbl"); //matchMaker Label
            strYear = CCLib.Common.Strings.GetQueryString("year"); //Archive Year
            strMMID = CCLib.Common.Strings.GetQueryString("MMID");

            SavedMMResults.PortfolioID = PortInfo["PortfolioID"].ToString();
            SavedMMResults.LoginID = LoginID;
            SavedMMResults.MMEduLevel = LoginInfo["MMEduLevel"].ToString().ToLower();
            SavedMMResults.SuffixCode = SuffixCode();
            SavedMMResults.NonEngSuffixCode = NonEngSuffixCode();
            SavedMMResults.JSGenericHrefLink = JSGenericHrefLink;
            SavedMMResults.CountryLanguageSuffixCode = SuffixCountryLanguageCode();
            SavedMMResults.SortColumn = strSt;
            SavedMMResults.SortBy = strStOrder;
            SavedMMResults.CtrlType = "SK";
            SavedMMResults.ArchiveYear = strYear;
            SavedMMResults.ParentID = "";
            SavedMMResults.ArchiveYear = strYear;

            BestMatchResults.PortfolioID = PortInfo["PortfolioID"].ToString();
            BestMatchResults.LoginID = LoginID;
            BestMatchResults.MMEduLevel = LoginInfo["MMEduLevel"].ToString().ToLower();
            BestMatchResults.SuffixCode = SuffixCode();
            BestMatchResults.NonEngSuffixCode = NonEngSuffixCode();
            BestMatchResults.JSGenericHrefLink = JSGenericHrefLink;
            BestMatchResults.CountryLanguageSuffixCode = SuffixCountryLanguageCode();
            BestMatchResults.CtrlType = "SK";
            BestMatchResults.ParentID = "";
            BestMatchResults.ArchiveYear = strYear;

            ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName = CareerCruisingWeb.CCLib.Common.Strings.GetDatabaseName();

            if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
            {
                strSavedMatchMakerID = CCLib.Common.Strings.GetFormString("SavedMatchMakerID");

                if (strAction == "archive")
                {
                    BestMatchResults.MMID = strSavedMatchMakerID;
                }
            }

            if (strAction == "new")
            {
                CCLib.MatchingObject.ClientStorage clientStorage = new CCLib.MatchingObject.ClientStorage();
                clientStorage.ClearSession();
                if (clientStorage.LoadFromPortfolio(LoginInfo["PID"].ToString(), Convert.ToInt32(strSavedMatchMakerID)))
                    clientStorage.Save(LoginID);
                Response.Redirect("/MatchMaker/k_skills_intro.aspx?LoginID=" + LoginID + "&MMID=" + strMMID);
                //if (!ClientScript.IsOnSubmitStatementRegistered("Submit"))
                //{
                //    ClientScript.RegisterOnSubmitStatement(Page.GetType(), "Submit", "showLyr('appendReviewDiv');document.reviewrevise.TargetPage.value='/MatchMaker/k_skills_intro.aspx?LoginID=" + LoginID + "&MMID=" + strSavedMatchMakerID + "';location.hash = 'page_top'; void 0;"); //"CareerCruisingWeb.CCLib.Common.Strings.GenerateHrefString("/MatchMaker/k_list_matched.aspx?LoginID="+LoginID+"&BM=1", JSGenericHrefLink)%>");
                //}
            }

            dtMatchMaker = CCLib.Common.DataAccess.GetDataTable("select SavedMatchMakerID,OccNumbers,Ref,Res,Education,Cluster,Skill,SkillRank,Convert(varchar(10),UpdateDate,101) UpdateDate,APMatch,APNotMatch,Label,BestMatch from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "Port_SavedMatchMaker where PortfolioID=" + PortInfo["PortfolioID"].ToString());
            for (int i = 0; i < dtMatchMaker.Rows.Count; i++)
            {
                if (dtMatchMaker.Rows[i]["Skill"].ToString() != "")
                    blHasSkills = true;
            }
            drBM = dtMatchMaker.Select("BestMatch=1");
            if (drBM.Length > 0)
            {
                strSavedMatchMakerID = drBM[0]["SavedMatchMakerID"].ToString();
                strMMLabel = drBM[0]["Label"].ToString();
                if (drBM[0]["OccNumbers"].ToString() != "")
                {
                    bBMNoSkills = (drBM[0]["SkillRank"].ToString() != "") ? false : true;
                }
            }

            #endregion Initialize Values and Form Execution

            #region Properties For The Individual Base Class
            SetCustomJS();
            AddArchiveButton = true;
            PortTitle = GetPortText(5372, false);
            SetTitleBar();
            SetLeftButtons();
            //LeftButtons = LeftButtons + ((Convert.ToBoolean(PortTypeElements["Mnu_LeftButtonImage"])) ? "<script>subMenu(2,'img16');</script>" : "");
            PortSubTitle = TextCode(8799);
            SetSubTitleBar();
            SetFooter();
            #endregion Properties For The Individual Base Class
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Properties For The Base Class and Check Login
            LoginID = Request.QueryString["LoginID"];
            LoginInfo = CCLib.Login.GetLoginInfo(LoginID);
            Redirect();
            PageTitle = GetPortText(5357, false);
            Section = "portfolio_tool";
            CSS = "student";
            HeadTag = "<STYLE TYPE='TEXT/CSS'><!--.btnDescription {  font: 11px Verdana, Arial, Helvetica, sans-serif; margin: 0px 15px}--></STYLE>";
            BodyTag = " alink='#990000' style='background-image:url(/media/shared/bg_left_bar_grey.gif);background-repeat:repeat-y;' bgcolor='#ffffff' leftmargin=0 link='#003366' text='#000000' topmargin=0 vlink='#003366' marginwidth='0' marginheight='0'";
            LeftBar = "<TABLE WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='0'><TR VALIGN='TOP' BGCOLOR='#669966'><td background='/media/portfolio_tool/bg_bar_tan_top.gif'><img height=23 src='/media/student_parent/icons/icon_arrow.gif' alt='' width=24><img height=23 src='/media1/" + this.PortType + "/h_h_main" + this.SuffixCode() + ".gif' alt='' width=141>";
            #endregion Properties For The Base Class and Check Login

            #region Initialize Values and Form Execution
            CheckPortSession();
            strSubSection = (CCLib.Common.Strings.GetQueryString("SubSection") == "") ? "List" : CCLib.Common.Strings.GetQueryString("SubSection");
            strAP = Request.QueryString["AP"];
            strStOrder = CCLib.Common.Strings.GetQueryString("storder");
            strSt = CCLib.Common.Strings.GetQueryString("st");
            strAction = CCLib.Common.Strings.GetQueryString("action");
            strLbl = CCLib.Common.Strings.GetQueryString("Lbl"); //matchMaker Label
            strYear = CCLib.Common.Strings.GetQueryString("year"); //Archive Year

            SavedMMResults.PortfolioID = PortInfo["PortfolioID"].ToString();
            SavedMMResults.LoginID = LoginID;
            SavedMMResults.MMEduLevel = LoginInfo["MMEduLevel"].ToString().ToLower();
            SavedMMResults.SuffixCode = SuffixCode();
            SavedMMResults.NonEngSuffixCode = NonEngSuffixCode();
            SavedMMResults.JSGenericHrefLink = JSGenericHrefLink;
            SavedMMResults.CountryLanguageSuffixCode = SuffixCountryLanguageCode();
            SavedMMResults.SortColumn = strSt;
            SavedMMResults.SortBy = strStOrder;
            SavedMMResults.CtrlType = "MM";
            SavedMMResults.ParentID = "";
            SavedMMResults.ArchiveYear = strYear;

            BestMatchResults.PortfolioID = PortInfo["PortfolioID"].ToString();
            BestMatchResults.LoginID = LoginID;
            BestMatchResults.MMEduLevel = LoginInfo["MMEduLevel"].ToString().ToLower();
            BestMatchResults.SuffixCode = SuffixCode();
            BestMatchResults.NonEngSuffixCode = NonEngSuffixCode();
            BestMatchResults.JSGenericHrefLink = JSGenericHrefLink;
            BestMatchResults.CountryLanguageSuffixCode = SuffixCountryLanguageCode();
            BestMatchResults.CtrlType = "MM";
            BestMatchResults.ParentID = "";
            BestMatchResults.ArchiveYear = strYear;

            ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName = CareerCruisingWeb.CCLib.Common.Strings.GetDatabaseName();
            if (strAction == "new")
            {
                CCLib.MatchingObject.ClientStorage clientStorage = new CCLib.MatchingObject.ClientStorage();
                clientStorage.ClearSession();
                if (LoginInfo["MMEduLevel"].ToString().ToLower() == "true")
                    Response.Redirect("/MatchMaker/k_educationLevel.aspx?LoginID=" + LoginID);
                else
                    Response.Redirect("/MatchMaker/k_aspects_intro.aspx?LoginID=" + LoginID);
            }
            //form post and execution
            if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
            {

                strSavedMatchMakerID = CCLib.Common.Strings.GetFormString("SavedMatchMakerID");
                strUpdateMatchMakerID = CCLib.Common.Strings.GetFormString("UpdateMatchMakerID");
                strNotBestMatchLabel = CCLib.Common.Strings.GetFormString("NotBestMatchLabel");
                if (strSavedMatchMakerID != "")
                {
                    if (strAction == "changeBestMatch")
                    {
                        DataTable dt = CCLib.Common.DataAccess.GetDataTable("select SavedMatchMakerID from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "Port_SavedmatchMaker where BestMatch=1 and PortfolioID=" + PortInfo["PortfolioID"].ToString());
                        if (dt.Rows.Count > 0)
                        {
                            CCLib.Common.DataAccess.ExecuteNonQuery("update " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "Port_SavedMatchMaker set BestMatch=0 where SavedMatchMakerID=" + dt.Rows[0]["SavedMatchMakerID"].ToString() + ";update " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "Port_SavedMatchMaker set BestMatch=1 where SavedMatchMakerID=" + strSavedMatchMakerID);
                        }
                    }

                    if (strAction == "edit")
                    {
                        string strMMNumbers = LabelinDB(strLbl);
                        if (strMMNumbers != "0") strLbl = LabelName(strLbl);
                        CCLib.Common.DataAccess.ExecuteNonQuery("update " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "Port_SavedMatchMaker set Label='" + CCLib.Common.Strings.FormatUserInput(strLbl.Replace("'", "''")) + "',updatedate=getdate() where SavedMatchMakerID=" + strSavedMatchMakerID);
                    }
                    if (strAction == "delete1")
                    {

                        CCLib.Common.DataAccess.ExecuteNonQuery("delete from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "Port_SavedMatchMaker where SavedMatchMakerID=" + strSavedMatchMakerID + " and PortfolioID=" + PortInfo["PortfolioID"].ToString());
                        UpdatePCSStatusFromSection("MatchMaker");
                        //clear mm session
                        CCLib.MatchingObject.ClientStorage cStorage = new CCLib.MatchingObject.ClientStorage();
                        cStorage.ClearSession();
                    }
                    if (strAction == "delete2")
                    {
                        CCLib.Common.DataAccess.ExecuteNonQuery("delete from Port_SavedMatchMaker where SavedMatchMakerID=" + strSavedMatchMakerID + " and PortfolioID=" + PortInfo["PortfolioID"].ToString() + "; Update Port_SavedMatchMaker set BestMatch=1 where SavedMatchmakerID = (select SavedMatchMakerID from Port_SavedMatchMaker where PortfolioID=" + PortInfo["PortfolioID"].ToString() + ")");
                        UpdatePCSStatusFromSection("MatchMaker");
                    }
                    if (strAction == "delete3")
                    {
                        CCLib.Common.DataAccess.ExecuteNonQuery("delete from Port_SavedMatchMaker where SavedMatchMakerID=" + strSavedMatchMakerID + " and PortfolioID=" + PortInfo["PortfolioID"].ToString() + "; Update Port_SavedMatchMaker set BestMatch=1 where SavedMatchmakerID =" + strUpdateMatchMakerID);
                        UpdatePCSStatusFromSection("MatchMaker");
                    }
                    if (strAction == "archive")
                    {
                        BestMatchResults.MMID = strSavedMatchMakerID;
                    }
                }
            }

            //generate values
            dtMatchMaker = CCLib.Common.DataAccess.GetDataTable("select SavedMatchMakerID,OccNumbers,Ref,Res,Education,Cluster,Skill,SkillRank,Convert(varchar(10),UpdateDate,101) UpdateDate,APMatch,APNotMatch,Label,BestMatch from " + ((CareerCruisingWeb.PageBase.IndividualBase)Page).DatabaseName + "Port_SavedMatchMaker where PortfolioID=" + PortInfo["PortfolioID"].ToString());

            #endregion Initialize Values and Form Execution

            #region Properties For The Individual Base Class
            SetCustomJS();
            AddArchiveButton = true;
            PortTitle = GetPortText(5372, false);
            SetTitleBar();
            SetLeftButtons();
            //LeftButtons = LeftButtons + ((Convert.ToBoolean(PortTypeElements["Mnu_LeftButtonImage"])) ? "<script>subMenu(2,'img16');</script>" : "");
            PortSubTitle = TextCode(4023);
            SetSubTitleBar();
            SetFooter();
            #endregion Properties For The Individual Base Class
        }
Example #3
0
        //used to check user session and log out user
        public void CheckPortSession()
        {
            string strPortTypeFolder = (PortTypeID == "4") ? "SD" : PortType;
            LoginPage = (PortTypeSettings["HasCustomLogin"].ToString() == "True") ? "/" + strPortTypeFolder + "/Default.aspx" : "/Individual/Default.aspx";
            UserLanguage = GetUserLanguage();
            //first time access, check if it is valid login (has to be withing one minute of login to avoid url copying/pasting)
            if (CCLib.Common.Strings.GetQueryString("PID") != "" && CCLib.Common.Strings.GetQueryString("PID") == LoginInfo["PID"].ToString() && DateTime.Compare(DateTime.Now.AddDays(1), ((DateTime)(LoginInfo["ExpiredTime"])).AddMinutes(1)) < 0)
            {
                //Re-initialize Portfolio Session due to the scenarios like load balancing redirection
                //if (Session["PortInfo"] == null)
                //{
                //    CCLib.Login.PortLoginInitSession(PortTypeID, PortType, LoginInfo["PID"].ToString(), SchoolID);
                //}

                //SD user's should be redirected to the main page upon login to home page
                if (PortTypeID == "4" && ScriptName.ToLower() == "/individual/home.aspx")
                {
                    if (Session["PortInfo"] != null)
                    {
                        DataRow drwPortInfo = (DataRow)Session["PortInfo"];
                        //matchmaker session initialization
                        CCLib.MatchingObject.ClientStorage clientStorage = new CCLib.MatchingObject.ClientStorage();
                        if (clientStorage.LoadFromPortfolio(drwPortInfo["PortfolioID"].ToString()))
                        {
                            //it's worked so save it back to the session state
                            clientStorage.Save(LoginID);
                        }
                        else
                        {
                            //clear previous session if the current user does NOT have matchmaker
                            clientStorage.ClearSession();
                        }
                        if (drwPortInfo["Agreement"].ToString() == "True")
                            Response.Redirect("/Main/Index.aspx?LoginID=" + LoginID);
                        else
                            Response.Redirect("/Individual/Agreement.aspx?LoginID=" + LoginID);
                    }
                }
            }
            else if (CCLib.Common.Strings.GetQueryString("PID") == "" && LoginInfo["PID"].ToString() == "")//school port login, reset login session for portfolio login page
            {
                CCLib.Login.ExpireUserLoginSession();
            }

            if (Session["PortInfo"] != null)
            {
                PortInfo = (DataRow)Session["PortInfo"];
                if (Convert.ToInt16(PortInfo["GradeNumber"]) < 5)
                    PortInfo["GradeNumber"] = 5;
                else if (Convert.ToInt16(PortInfo["GradeNumber"]) > 13)
                    PortInfo["GradeNumber"] = 13;

                if (PortTypeID != "5")
                    AppSettings = CCLib.Login.GetAppSettings(PortInfo["SchoolID"].ToString());

                //PortSettings = (DataRow)Session["PortSettings"];
                //PortTypeSettings = (DataRow)Session["PortTypeSettings"];
                PortTypeElements = GetPortTypeElements(ToolTypeID);

                #region set menu grade

                if (Convert.ToInt16(PortInfo["GradeNumber"]) <= 13 && Convert.ToInt16(PortInfo["GradeNumber"]) > 4)
                    MenuGrade = PortInfo["GradeNumber"].ToString();
                else if (Convert.ToInt16(PortInfo["GradeNumber"]) > 13)
                    MenuGrade = "13";
                else
                    MenuGrade = "5";

                #endregion set menu grade

                GetPCSCriteria();

                if (Session["PCSStatus"] != null)
                {
                    PCSStatus = (DataRow)Session["PCSStatus"];
                }

                //first time access or session is not initialized, generate PCS session variable
                if (CCLib.Common.Strings.GetQueryString("PID") == LoginInfo["PID"].ToString() || Session["PCSStatus"] == null)
                    GetPCSStatus();

                //check AltComp flag, if so, update PCSStatus["AltComp"]
                if (Convert.ToInt16(PortTypeElements["PCS_AltComp_View"]) == 1 && IsAltComp(PortInfo["PortfolioID"].ToString()) && PCSStatus != null)
                    PCSStatus["AltComp"] = true;

                //customized code for ILP below, need to be changed later
                SetPCSDescription();

                //Get Port SectionID based on page name
                GetPortSectionID();

                //course planning flag
                if (LoginInfo["CoursePlanner"].ToString() != "" && (PortInfo["Active"].ToString() == "True" || PortInfo["CP_Demo"].ToString() == "1" || PortInfo["CP_Demo"].ToString() == "2"))
                {
                    CPCoursePlanner = LoginInfo["CoursePlanner"].ToString();
                    isCEP = Convert.ToBoolean(LoginInfo["isCEP"]);
                }

                //matchmaker session initialization
                CCLib.MatchingObject.ClientStorage clientStorage = new CCLib.MatchingObject.ClientStorage();
                if (clientStorage.LoadFromPortfolio(PortInfo["PortfolioID"].ToString()))
                {
                    //it's worked so save it back to the session state
                    clientStorage.Save(LoginID);
                }
                else
                {
                    //clear previous session if the current user does NOT have matchmaker
                    clientStorage.ClearSession();
                }
            }
            else
            {
                Session["LastPortPage"] = ScriptName;//used to remember the last Port page when re-login
                Session["LastPortPageQueryString"] = CCLib.Common.Strings.TrimQueryString(CCLib.Common.Strings.TrimQueryString(Request.QueryString.ToString(), "LoginID=" + LoginID), "PID=" + LoginInfo["PID"].ToString());//used to remember the last Port page's querystring (excluding LoginID and PID) when re-login

                string strLanguagePar = (UserLanguage == "") ? "" : "&Language=" + UserLanguage;
                Response.Redirect(LoginPage + "?LoginID=" + LoginID + strLanguagePar);//user clicked portfolio button outside portfoio, either from top nav bar or from the main home page
            }
        }