Пример #1
0
        public JsonResult DoCareerSearch(string searchText)
        {
            var results = new List<spGetCareerListByName_Result>();
            using (var ctx = new CareersEntities())
            {
                var careers = ctx.spGetCareerListByName(searchText);
                results = careers.ToList();
            }

            return Json(new AjaxResponse { success = true, data = results });
        }
Пример #2
0
        public ActionResult SearchResultDetails(string careerId, string searchText)
        {
            var model = new CareerSearchResultDetailsModel();
            model.SearchText = searchText;

            using (var ctx = new CareersEntities())
            {
                var description = ctx.spGetCareerInfoBasic(careerId);
                var tasks = ctx.spGetCareerInfoCareerTasks(careerId);
                var knowledge = ctx.spGetCareerInfoKnowledge(careerId);
                var skills = ctx.spGetCareerInfoSkills(careerId);
                var abilities = ctx.spGetCareerInfoAbilities(careerId);
                var activities = ctx.spGetCareerInfoWorkActivities(careerId);
                var interestes = ctx.spGetCareerInfoInterests(careerId);
                var styles = ctx.spGetCareerInfoWorkStyles(careerId);

                model.DescriptionDetails = description.FirstOrDefault();
                model.Tasks = tasks.ToList();
                model.KnowledgeItems = knowledge.ToList();
                model.Skills = skills.ToList();
                model.Abilities = abilities.ToList();
                model.Activities = activities.ToList();
                model.Interests = interestes.ToList();
                model.Styles = styles.ToList();
            }

            if (model.DescriptionDetails == null)
            {
                return View("Search");
            }

            model.CareerName = model.DescriptionDetails.title;
            return View(model);
        }
Пример #3
0
        public ActionResult Search(string searchText)
        {
            var model = new CareerSearchModel();
            if (CookieHelper.CookieExists(AppConstants.CareerIdCookieName))
            {
                var careerId = Convert.ToInt32(CookieHelper.GetCookie(AppConstants.CareerIdCookieName));
                model.RelatedOccupations = CareerService.GetRelatedOccupations(careerId);
            }

            model.SearchText = searchText;

            if (!String.IsNullOrEmpty(model.SearchText))
            {
                using (var ctx = new CareersEntities())
                {
                    var careers = ctx.spGetCareerListByName(model.SearchText);
                    model.SearchResults = careers.ToList();
                }
            }

            return View(model);
        }