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();
        }
Beispiel #2
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("");
        }