Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Properties For The Base Class and Check Login
            LoginID = Request.QueryString["LoginID"];
            base.LoginInfo = CCLib.Login.GetLoginInfo(LoginID);
            base.Redirect();
            base.PageTitle = TextCode(336);
            base.Section = "mm";
            base.CSS = "global_css";
            base.HeadTag = "<STYLE TYPE='TEXT/CSS'><!--.MMBackLink {text-decoration:none;}.MMBackLink:hover {text-decoration:underline}.PrintLink {color: #FFFFFF; font-size:10px; text-decoration:underline;}.PrintLink:hover {color: #FFFFFF;font-size:10px; font-weight:bold}--></STYLE>";
            base.BodyTag = @" ALINK=#990000 style='background-image:url(/media/shared/bg_else.gif); background-repeat:no-repeat; background-color:#FFFFFF;' LEFTMARGIN=0 LINK=#003366 TEXT=#000000 TOPMARGIN=0 VLINK=#666666 ";
            base.LeftBar = @"<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH='100%'><TR BGCOLOR=#336699 VALIGN=top><TD BACKGROUND='../media/mm/i_top_bar_bg.gif'><IMG HEIGHT=23 SRC='../media/mm/i_c_mm_icon.gif' WIDTH=24 alt=''><IMG HEIGHT=23 SRC='../media/mm/h_c_mm.gif' WIDTH=141 alt='" + TextCode(336) + "'>";
            IsLongPage = false;
            #endregion Properties For The Base Class and Check Login

            // place Page initialisation here for now
            JSGenericHrefLink = "onul";

            // Put user code to initialize the page here
            strMMID = Request.QueryString["MMID"]; //SavedMatchMakerID

            ClientStorage clientStorage = new ClientStorage();
            clientStorage.Retrieve(LoginID);

            // we use this as a list of questions
            if ((Request.QueryString["RES"] == "") || (Request.QueryString["RES"] == null))// have they answered a question or is this the first time around
            {

                // it doesn't exist so lets build it....
                    Session.Add("skillsset", CCLib.MatchingObject.CCobject.buildSkillsResultSet(SuffixCountryLanguageCode()));

            }

            //JM 15/08/2006 if we have no questionset in the session then the session must have timed out between answering questions so redirect them to to k_list_matched.aspx
            if (Session["skillsset"] == null)
            {
                Response.Redirect("k_list_matched.aspx?LoginID=" + LoginID + "&SVP=1&AP=0&MMID=" + strMMID);
            }

            // lets pull the results into a local variable rather than keep accessing it through the session interface
            SkillsResultSet skillsset = Session["skillsset"] as SkillsResultSet; // get resultset from session

            // save the value away
            if ((Request.QueryString["RES"] != "") && (Request.QueryString["RES"] != null))// a resultset already exists, have they answered a question
            {

                SkillsResult skillsResult = clientStorage.ClientSkills.Find(
                                                             delegate(SkillsResult sr)
                                                             {
                                                                 return sr.SkillsRef == Convert.ToInt16(Request.QueryString["REF"]);
                                                             }
                                                             );
                if (skillsResult == null)
                {
                    //it's not there so add to resultset
                    skillsResult = new SkillsResult();
                    skillsResult.SkillsRef = Convert.ToInt16(Request.QueryString["REF"]);
                    clientStorage.ClientSkills.Add(skillsResult);
                }
                // then we set the value...
                if (skillsResult != null) { skillsResult.SkillsResponse = Convert.ToInt16(Request["RES"].ToString()); };

                //now we flag the question as answered
                skillsResult = skillsset.Find(
                                                             delegate(SkillsResult sr)
                                                             {
                                                                 return sr.SkillsRef == Convert.ToInt16(Request.QueryString["REF"]);
                                                             }
                                                             );

                if (skillsResult != null) { skillsResult.SkillsResponse = Convert.ToInt16(Request["RES"].ToString()); };

            }

            //see which question to ask
            SkillsResult skillNext = skillsset.Find(delegate(SkillsResult sr) { return sr.SkillsResponse == -1; });
            if (skillNext == null)
            {
                //they have answered all the questions - we'll show the results in a grid to prove it worked...
                clientStorage.SkillsIndicator = 1;
                clientStorage.Save(LoginID);
                //set LEG=1 to force display of Legend when returning to matched list
                Session["LEG"] = "1";
                Response.Redirect("k_list_matched.aspx?loginid=" + LoginID + "&SVP=1&AP=0&MMID=" + strMMID);
            }
            else
            {

                DataRow skill = CCLib.MatchingObject.CCobject.getSkill(skillNext.SkillsRef , SuffixCountryLanguageCode());
                int wPos = skillsset.IndexOf(skillNext);
                // set skill info
                svrProgressLit.Text = Convert.ToString(wPos + 1) + "&nbsp;" + TextCode(2972) + "&nbsp;" + Convert.ToString(skillsset.Count) + "&nbsp;&nbsp;";
                svrSkillNameLit.Text = skill["question"].ToString();
                svrSkillNoteLit.Text = skill["notes"].ToString();

                //set progress bar
                svrProgressImg.Width = Convert.ToInt16((wPos + 1) * (7));
                svrProgressImg.Alt = TextCode(3292) + " = " + Convert.ToString(wPos + 1) + " " + TextCode(2972) + " " + Convert.ToString(skillsset.Count);

                //set response URL
                string wURL = "k_skills_question.aspx?&REF=" + skill["ref"].ToString() + "&LoginID=" + base.LoginID + "&MMID=" + strMMID;
                checkbox1.Attributes.Add("onclick", "chkMark('" + wURL + "&RES=5',1)");
                checkbox2.Attributes.Add("onclick", "chkMark('" + wURL + "&RES=4',2)");
                checkbox3.Attributes.Add("onclick", "chkMark('" + wURL + "&RES=3',3)");
                checkbox4.Attributes.Add("onclick", "chkMark('" + wURL + "&RES=2',4)");
                checkbox5.Attributes.Add("onclick", "chkMark('" + wURL + "&RES=1',5)");

            };
            //Save the client record
            clientStorage.Save(LoginID);
        }
Пример #2
0
        public bool LoadFromDB(string strPassword, string strMMUsername, string strMMPassword, string strFirstname, string strLastname)
        {
            string strSQL = "SELECT  UserID, FirstName, LastName, Passwrd, MMUsername, MMPassword, Ref, Res, Education, Skill FROM tblUsers WHERE (FirstName LIKE '" + strFirstname + "') AND (LastName LIKE '" + strLastname + "') AND (Passwrd LIKE '" + strPassword + "') AND (MMUsername LIKE '" + strMMUsername + "') AND (MMPassword LIKE '" + strMMPassword + "')";
            DataTable dt=CCLib.Common.DataAccess.GetDataTable(strSQL);
            if (dt.Rows.Count > 0)
            {
            FirstName = dt.Rows[0]["firstname"].ToString();
            LastName = dt.Rows[0]["lastname"].ToString();
            //aspects
            string strAspectRef = dt.Rows[0]["Ref"].ToString();
            string strAspectRes = dt.Rows[0]["Res"].ToString();
            ClientAspects = new AspectResultSet();
            for (int i = 0; i<strAspectRes.Length; i++)
            {
                AspectResult ar =new AspectResult();
                ar.AspectRef = Convert.ToInt32(strAspectRef.Substring(i*3,3));
                ar.AspectResponse = Convert.ToInt32(strAspectRes.Substring(i,1));
                ClientAspects.Add(ar);

            }
            string strLevels = dt.Rows[0]["Education"].ToString();
            ClientLevels = new LevelResultSet();
            for (int i = 0; i<strLevels.Length; i=i+3)
            {
                LevelResult lv =new LevelResult();
                lv.LevelRef = Convert.ToInt32(strLevels.Substring(i,3));
                //JM 02/11/2006 changed from lv.LevelRef = Convert.ToInt32(strLevels.Substring(i*3,3));
                lv.LevelResponse = true;
                ClientLevels.Add(lv);
            }
            ClientSkills = new SkillsResultSet();
            string strSkills = dt.Rows[0]["Skill"].ToString();
            for (int i = 1; i<=strSkills.Length; i++)
            {
                SkillsResult sr =new SkillsResult();
                sr.SkillsResponse  = Convert.ToInt32(strSkills.Substring(i-1,1));
                sr.SkillsRef = i;
                ClientSkills.Add(sr);
            }
            //calculate Aspect Indicator
            AspectIndicator =1;
            if (ClientAspects.Count >=39) {AspectIndicator=2;};
            if (ClientAspects.Count >=116) {AspectIndicator=4;};
            if (ClientSkills.Count >= 44) { SkillsIndicator = 1; };

            return (true);
            }
            else
            {
            return (false);
            }
        }
Пример #3
0
        public bool LoadFromPortfolio(string strPortfolioId, int intMMID)
        {
            string strSQL ="";
            strSQL = "SELECT p.FirstName, p.LastName, m.Ref AS MatchMakerRef, m.Res AS MatchMakerRes, m.Education AS MatchMakerEducation, m.Skill AS MatchMakerSkill FROM Portfolio AS p INNER JOIN Port_SavedMatchMaker AS m ON p.PortfolioID = m.PortfolioID WHERE (p.portfolioid=" + strPortfolioId + " and m.SavedMatchMakerID=" + intMMID + ")";
            DataTable dt = CCLib.Common.DataAccess.GetDataTable(strSQL);
            if (dt.Rows.Count > 0)
            {
                FirstName = dt.Rows[0]["firstname"].ToString();
                LastName = dt.Rows[0]["lastname"].ToString();
                //aspects
                string strAspectRef = dt.Rows[0]["MatchMakerRef"].ToString();
                string strAspectRes = dt.Rows[0]["MatchMakerRes"].ToString();
                ClientAspects = new AspectResultSet();
                for (int i = 0; i < strAspectRes.Length; i++)
                {
                    AspectResult ar = new AspectResult();
                    ar.AspectRef = Convert.ToInt32(strAspectRef.Substring(i * 3, 3));
                    ar.AspectResponse = Convert.ToInt32(strAspectRes.Substring(i, 1));
                    ClientAspects.Add(ar);

                }
                string strLevels = dt.Rows[0]["MatchMakerEducation"].ToString();
                ClientLevels = new LevelResultSet();
                for (int i = 0; i < strLevels.Length; i=i+3)
                {
                    LevelResult lv = new LevelResult();
                    lv.LevelRef = Convert.ToInt32(strLevels.Substring(i, 3));
                    lv.LevelResponse = true;
                    ClientLevels.Add(lv);
                }
                ClientSkills = new SkillsResultSet();
                string strSkills = dt.Rows[0]["MatchMakerSkill"].ToString();
                for (int i = 1; i <= strSkills.Length; i++)
                {
                    SkillsResult sr = new SkillsResult();
                    sr.SkillsResponse = Convert.ToInt32(strSkills.Substring(i - 1, 1));
                    sr.SkillsRef = i;
                    ClientSkills.Add(sr);
                }
                //calculate Aspect Indicator
                AspectIndicator = 1;
                if (ClientAspects.Count >= 39) { AspectIndicator = 2; };
                if (ClientAspects.Count >= 116) { AspectIndicator = 4; };
                if (ClientSkills.Count >= 44) { SkillsIndicator = 1; };

                return (true);
            }
            else
            {
                return (false);
            }
        }
Пример #4
0
        public static SkillsResultSet buildSkillsResultSet(string strCountry, JobItem ji, int intSection)
        {
            //build Desirable/Essential skills

            SkillsResultSet ds = new SkillsResultSet();

            DataTable dtAspects = CCLib.Cache.GetCachedDataTableWithNoExpire("ASPECT_DETAILS_" + strCountry, "select * from tblaspects" + strCountry);
            DataRow[] drsAspects = dtAspects.Select("OccNumber=" + ji.JobRef);
            if (drsAspects.Length > 0)
            {
                string strAspectList = "";
                switch (intSection)
                {
                    case 1: strAspectList = drsAspects[0]["EssentialSkills"].ToString(); break;
                    case 2: strAspectList = drsAspects[0]["DesirableSkills"].ToString(); break;

                };

                for (int i = 0; i < strAspectList.Length; i = i + 3)
                {
                    SkillsResult sr = new SkillsResult();
                    sr.SkillsRef = Convert.ToInt16(strAspectList.Substring(i, 3).ToString());
                    ds.Add(sr);
                };

            };
            return (ds);
        }
Пример #5
0
        public static SkillsResultSet buildSkillsResultSet(string strLangCode, SkillsResultSet srsAnswered)
        {
            //build all unanswered skills

            SkillsResultSet ds = new SkillsResultSet();
            DataTable dtAspects = CCLib.Cache.GetCachedDataTableWithNoExpire("QU_ALL_SKILL_IDS_" + strLangCode, "Select ID from tblskills" + strLangCode + " order by id");

            foreach (DataRow rt in dtAspects.Rows)
            {

                SkillsResult skillsResult = srsAnswered.Find(delegate(SkillsResult sr)
                                                     {
                                                         return sr.SkillsRef == Convert.ToInt16(rt["ID"].ToString());
                                                     }
                                                     );
                if (skillsResult == null) //if it's not in the list of aspects the client has answered
                {
                    SkillsResult sr = new SkillsResult();
                    sr.SkillsRef = Convert.ToInt16(rt["ID"].ToString());
                    sr.SkillsResponse = -1;
                    ds.Add(sr);
                }
                else if (skillsResult.SkillsResponse < 1)// or it's in the list but it has no response
                {
                    SkillsResult sr = new SkillsResult();
                    sr.SkillsRef = Convert.ToInt16(rt["ID"].ToString());
                    sr.SkillsResponse = -1;
                    ds.Add(sr);
                }

            };
            return (ds);
        }
Пример #6
0
        public static SkillsResultSet buildSkillsResultSet(string strLangCode)
        {
            //build all skills

            SkillsResultSet ds = new SkillsResultSet();
            DataTable dtAspects = CCLib.Cache.GetCachedDataTableWithNoExpire("QU_PRIMARY_SKILL_IDS_" + strLangCode, "Select ID from tblskills" + strLangCode + "  order by id");

            foreach (DataRow rt in dtAspects.Rows)
            {
                SkillsResult sr = new SkillsResult();
                sr.SkillsRef = Convert.ToInt16(rt["ID"].ToString());
                sr.SkillsResponse = -1;
                ds.Add(sr);
            };
            return (ds);
        }