//

        private List <FrameworkResultSet> DoThreadedFrameworkSearch(List <FrameworkSearchItem> items, FrameworkSearchMethod searchMethod, int skipResults = 0, int takeResults = 50)
        {
            //Denullify
            items = items ?? new List <FrameworkSearchItem>();
            //Hold filtered items
            var preparedItems = new List <FrameworkSearchItem>();

            //Process items
            foreach (var item in items)
            {
                //Filter out duplicate frameworks by CTID and assign the search method
                if (preparedItems.FirstOrDefault(m => m.FrameworkCTID == item.FrameworkCTID) == null)
                {
                    item.ProcessMethod = searchMethod;
                    item.SkipResults   = skipResults;
                    item.TakeResults   = takeResults;
                    item.ClientIP      = Request.UserHostAddress;
                    preparedItems.Add(item);
                }
            }
            //Do the search
            var searchResults = CompetencyFrameworkServices.ThreadedFrameworkSearch(preparedItems);

            //Convert the results and return them
            return(searchResults.ConvertAll(m => new FrameworkResultSet(m)));
        }
Beispiel #2
0
        public JsonResult GetCredentialsForCompetencies(List <string> competencyCTIDs)
        {
            competencyCTIDs = competencyCTIDs ?? new List <string>();
            var total   = 0;
            var data    = CompetencyFrameworkServices.GetCredentialsForCompetencies(competencyCTIDs, 0, 50, ref total);
            var results = data.ConvertAll(m => m.ToString(Newtonsoft.Json.Formatting.None));

            return(JsonResponse(results, true, "", null));
        }
Beispiel #3
0
        //

        public ActionResult CompetencyFramework(string id, string name = "")
        {
            var ctid = id;

            if (int.TryParse(id, out int fId))
            {
                var entity = CompetencyFrameworkServices.Get(fId);
                if (entity != null && !string.IsNullOrWhiteSpace(entity.CTID))
                {
                    ctid = entity.CTID.ToLower();
                }
            }
            //Competency Framework search is powered by the registry, so id will always be a CTID (for now?)
            return(View("~/Views/Detail/CompetencyFrameworkV2.cshtml", model: ctid));
        }