Exemplo n.º 1
0
        private void PopulateHotJobs(Modes mode)
        {
            int    questionId = 0;
            string answerId   = string.Empty;

            CareerSiteSettings cs = Utility.GetCareerSiteSettings();

            // Set Masked Hiring Org values for the form menu controls
            // (without the DataBind the data will not be fetched)
            hjcfRepeater1.MaskedHiringOrgId = cs.MaskedHiringOrgId;
            hjcfRepeater1.EMediaId          = cs.EMediaId;
            hjcfRepeater1.CategoryIds       = "-1";
            hjcfRepeater1.CityIds           = "-1";
            hjcfRepeater1.StateIds          = "-1";
            hjcfRepeater1.Keywords          = string.Empty;
            hjcfRepeater1.PageIndex         = 1;
            hjcfRepeater1.RecordsPerPage    = cs.HotJobsCount;

            if (mode == Modes.JobFamily)
            {
                questionId = cs.RetrieveTagValueQuestionId("JobFamily");
            }
            else
            {
                questionId = cs.RetrieveTagValueQuestionId("TalentArea");
            }

            answerId = cs.RetrieveAnswerIdsByQuestionIdPageId(questionId.ToString(), hotJobsPageName);
            hjcfRepeater1.QuestionIdList       = questionId.ToString();
            hjcfRepeater1.QuestionId1          = questionId;
            hjcfRepeater1.QuestionId1AnswerIds = answerId;

            this.hjcfRepeater1.GetRecords();
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CareerSiteSettings cs = Utility.GetCareerSiteSettings();

            targetpage = ConfigurationManager.AppSettings["targetpage"];

            //write the boa buttons
            boanet_safebutton.writeBOASafeButton("Remove", phRemove, "Remove Selected", Remove_Click, this.Request, "");

            //if(ViewState["Cookie"]==null)
            //{

            SearchReturn.NavigateUrl = Request.UrlReferrer.ToString();
            string jobIdList = Cookie.ReadCookie(Cookie.JOB_CART_COOKIE_NAME);

            if (!(string.IsNullOrEmpty(jobIdList)))
            {
                grdJobcart.MaskedHiringOrgId = cs.MaskedHiringOrgId;
                grdJobcart.EMediaId          = cs.EMediaId;
                grdJobcart.JobIdList         = jobIdList;
                grdJobcart.GetRecords();

                phRemove.Visible     = grdJobcart.RowCount > 0;
                lblNoResults.Visible = grdJobcart.RowCount == 0;
            }
            else
            {
                phRemove.Visible     = false;
                lblNoResults.Visible = true;
            }
        }
Exemplo n.º 3
0
        protected string GetCustomFieldValue(List <CareerSiteWebControls.CustomField> lstCustomFields, string customFieldTagValue)
        {
            CareerSiteSettings cs = Utility.GetCareerSiteSettings();

            try
            {
                // Get Question ID value for "Location Detail" custom field
                int intCustomFieldId = cs.RetrieveTagValueQuestionId(customFieldTagValue);

                // Loop through the custom field list looking for the custom field
                // when found return the Answer text for it
                DateTime datetime;
                string   strLocationDetail;

                foreach (CareerSiteWebControls.CustomField cf in lstCustomFields)
                {
                    if (intCustomFieldId == cf.QuestionId)
                    {
                        // check if custome field is unpost date, and if so, format it accordingly.

                        if (DateTime.TryParseExact(cf.AnswerText, "MMM d, yyyy, HH:mm:ss tt", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.NoCurrentDateDefault, out datetime) ||
                            DateTime.TryParseExact(cf.AnswerText, "MMM dd, yyyy, HH:mm:ss tt", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.NoCurrentDateDefault, out datetime))
                        {
                            datetime          = Convert.ToDateTime(cf.AnswerText);
                            strLocationDetail = datetime.ToString("MMM dd, yyyy");
                        }
                        else
                        {
                            strLocationDetail = cf.AnswerText;
                        }

                        // Return LocationDetail value
                        return(strLocationDetail);
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.HandleException(ex);
            }

            return("");
        }
Exemplo n.º 4
0
    public static CareerSiteSettings GetCareerSiteSettings()
    {
        string configId = System.Configuration.ConfigurationSettings.AppSettings["cmsconfigID"].ToString();

        return(CareerSiteSettings.LoadCareerSiteSettings(System.Convert.ToInt16(configId)));
    }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CareerSiteSettings cs = Utility.GetCareerSiteSettings();

            // Retrieve the JobId from the query string
            try
            {
                try
                {
                    CountryId = this.Request.QueryString["CountryId"].ToString();
                }
                catch
                {
                    // Assume United States if no country is found
                    CountryId = Location.USA;
                }

                JobId = this.Request.QueryString["JobId"].ToString();


                this.jobDetails1.MaskedHiringOrgId = cs.MaskedHiringOrgId;
                this.jobDetails1.EMediaId          = cs.EMediaId;
                this.jobDetails1.JobId             = System.Convert.ToInt32(JobId);
                this.jobDetails1.QuestionIdList    = cs.RetrieveDisplayQuestionIdList();

                try
                {
                    this.jobDetails1.DataBind();
                }
                catch (Exception ex)
                {
                    // Log the error to the database
                    Utility.HandleException(ex);
                    Response.Redirect(ConfigurationManager.AppSettings["jobnotfoundredirectpage"] + "?nf=1");
                }
            }
            catch
            {
                // Log the fact that an invalid JobId was passed in
                Utility.HandleException(new Exception("Invalid JobId: " + this.Request.QueryString["JobId"].ToString()));
                Response.Redirect(ConfigurationManager.AppSettings["jobnotfoundredirectpage"] + "?nf=1");
            }

            try
            {
                this.ltrlCorremetrixProductTag.Text = "";

                UseTinyUrl = Request.QueryString["UseTinyUrl"] != null ? Request.QueryString["UseTinyUrl"].ToString() : "0";
                targetpage = ConfigurationManager.AppSettings["targetpage"];
                if (this.Request.UrlReferrer != null &&
                    (this.Request.UrlReferrer.ToString().ToLowerInvariant().Contains("jobsearch.aspx") || this.Request.UrlReferrer.ToString().ToLowerInvariant().Contains("advancesearch.aspx") ||
                     this.Request.UrlReferrer.ToString().ToLowerInvariant().Contains("jobdetails.aspx") || this.Request.UrlReferrer.ToString().ToLowerInvariant().Contains("tell_a_friend.aspx")))
                {
                    ((HyperLink)this.FindControlInDataTemplate("returntoJobsearch")).Visible = true;
                }

                Jobs Jobs = new Jobs();

                string srcvalue   = string.IsNullOrEmpty(Request["src"]) ? string.Empty : Request["src"];
                string countryid  = Request["countryid"] == null ? "1" : Request["countryid"].ToString();
                string LocationId = Request["LocationID"] == null ? "0" : Request["LocationID"].ToString();
                string FeedName   = Request["FeedName"] == null ? "" : Request["FeedName"].ToString();
                string taleoReqID = "";

                taleoReqID = ((HiddenField)this.FindControlInDataTemplate("hdnReqNo")).Value;
                jobtitle   = ((HiddenField)this.FindControlInDataTemplate("hdnJobTitle")).Value + " : " + taleoReqID;

                strPrimayLoc = ((HiddenField)this.FindControlInDataTemplate("hdnPrimaryLocation")).Value;
                strMultiLocs = ((HiddenField)this.FindControlInDataTemplate("hdnMultiLocations")).Value;
                //strMultiLocs = GetJobMultiLocations(JobId, "");
                //((Label)this.FindControlInDataTemplate("lblLocation")).Text = GetJobMultiLocations2(strPrimayLoc, strMultiLocs);

                pageTitle             = "Bank of America Careers: " + jobtitle;
                lblJobTitle.InnerText = jobtitle;



                if (CountryId == "1")
                {
                    ((Label)this.FindControlInDataTemplate("lblDescripton")).Text    = LinkBuilder(((Label)this.FindControlInDataTemplate("lblDescripton")).Text, "Description");
                    ((Label)this.FindControlInDataTemplate("lblQualification")).Text = LinkBuilder(((Label)this.FindControlInDataTemplate("lblQualification")).Text, "Qualification");
                }
                string CANADAURL = ConfigurationManager.AppSettings["CanadaApplyURL"].ToString();

                if (CountryId == Location.CANADA && CANADAURL != "")
                {
                    ApplyURL = CANADAURL;
                }
                else
                {
                    ApplyURL = ((HiddenField)this.FindControlInDataTemplate("hdnApplyURL")).Value + "&src=" + Request["src"];

                    /*
                     * if (CountryId == "1")
                     * {
                     *  //This is only for usa job.  How does hdnApplyUrl get set?
                     *  ApplyURL = ((HiddenField)this.FindControlInDataTemplate("hdnApplyURL")).Value + "&src=" + Request["src"];
                     *  //ApplyURL = this.jobDetails1.ResolveClientUrl();
                     *  //ApplyURL = "https://bacfhrs.taleo.net/careersection/application.jss?lang=en&type=1&csNo=2&portal=140160497&reqNo=" + this.jobDetails1.JobId + "&postdata=$QEbCcxFGN7OUb1h-_JXJTg==";
                     * }
                     * else
                     * {
                     * }
                     */
                }

                ((HiddenField)this.FindControlInDataTemplate("hApplyNow")).Value = targetpage + "countryid=" + CountryId + "&url=" + HttpUtility.UrlEncode(ApplyURL);
                ViewState["pageTitle"] = pageTitle;
                ViewState["jobtitle"]  = jobtitle;

                ((HyperLink)this.FindControlInDataTemplate("returntoJobsearch")).NavigateUrl = "jobsearch.aspx?" + Request.QueryString;

                string applyJobTitle = CleanJobTitle(jobtitle);

                boanet_safebutton.writeBOASafeButton("Apply1", ((PlaceHolder)this.FindControlInDataTemplate("phApply1")), "ApplyNow|*|" + applyJobTitle, Apply_Click_NoJS, this.Request, ((HiddenField)this.FindControlInDataTemplate("hApplyNow")).Value + "&jobpipeline=" + this.Request.QueryString["jobpipeline"]);
                boanet_safebutton.writeBOASafeButton("Apply2", ((PlaceHolder)this.FindControlInDataTemplate("phApply2")), "ApplyNow|*|" + applyJobTitle, Apply_Click_NoJS, this.Request, ((HiddenField)this.FindControlInDataTemplate("hApplyNow")).Value + "&jobpipeline=" + this.Request.QueryString["jobpipeline"]);

                prepbuttons();

                //not ready For Pro Yet!!
                ((HyperLink)this.FindControlInDataTemplate("TellaFriend")).NavigateUrl = "Tell_a_friend.aspx?" + Request.QueryString;

                //check if this job is in the jobcart. If so, display remove Job Cart Link
                if (Cookie.CookieContainsValue(Cookie.JOB_CART_COOKIE_NAME, JobId))
                {
                    ((Button)this.FindControlInDataTemplate("btnRemoveFromJobCart")).Visible = true;
                    ((Button)this.FindControlInDataTemplate("btnRemoveFromCart")).Visible    = true;
                    ((Button)this.FindControlInDataTemplate("btnAddToJobCart")).Visible      = false;
                    ((Button)this.FindControlInDataTemplate("btnAddToCart")).Visible         = false;
                }

                string cmJobID = "";

                if (countryid == "1")
                {
                    cmJobID = "US" + taleoReqID;
                }
                else
                {
                    //international job
                    //ApplyURL split this by & and get 'id=' value
                    string[] arrUrl = ApplyURL.Split('&');
                    foreach (string parm in arrUrl)
                    {
                        if (parm.StartsWith("id="))
                        {
                            //split by = to get reqno
                            cmJobID = JobId.Substring(0, 3) + parm.Substring(3);
                        }
                    }
                }

                hdnJobId.Value = cmJobID;
                BuildCorremetrixProductTag(cmJobID, CleanJobTitle(jobtitle));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }