public FixedList <StepDescriptorDto> SearchSteps(SearchStepsCommand searchCommand) { Assertion.Require(searchCommand, "searchCommand"); var list = Step.GetList(searchCommand); return(StepMapper.MapToShortModel(list)); }
public CollectionModel SearchSteps([FromBody] SearchStepsCommand searchCommand) { base.RequireBody(searchCommand); using (var usecases = StepsDesignUseCases.UseCaseInteractor()) { FixedList <StepDescriptorDto> list = usecases.SearchSteps(searchCommand); return(new CollectionModel(this.Request, list)); } }
public void Should_Search_Steps() { var searchCommand = new SearchStepsCommand { PageSize = 100, }; FixedList <StepDescriptorDto> list = _usecases.SearchSteps(searchCommand); Assert.NotEmpty(list); int moreGeneralListItemsCount = list.Count; searchCommand.Keywords = "cnh hidrocarburos"; list = _usecases.SearchSteps(searchCommand); Assert.True(list.Count <= moreGeneralListItemsCount, "Search by keyword must return the same or fewer steps."); }
static internal FixedList <Process> GetProcessList(SearchStepsCommand searchCommand) { var processType = StepType.Process; var sql = $"SELECT * FROM STPSteps WHERE " + $"(StepTypeId = {processType.Id}) AND (DesignStatus <> 'X')"; if (!String.IsNullOrWhiteSpace(searchCommand.Keywords)) { var keywordsFilter = SearchExpression.ParseAndLikeKeywords("Keywords", searchCommand.Keywords); sql += $" AND {keywordsFilter}"; } sql += $"ORDER BY {searchCommand.OrderBy}"; var op = DataOperation.Parse(sql); return(DataReader.GetFixedList <Process>(op)); }
static private string GetStepsTypeFilter(SearchStepsCommand searchCommand) { switch (searchCommand.StepsType) { case "All": return($"(StepTypeId <> 230847)"); case "Processes": return($"(StepTypeId = {StepType.Process.Id})"); case "Activities": return($"(StepTypeId = {StepType.Task.Id})"); case "Events": return($"(StepTypeId = {StepType.Event.Id})"); default: throw Assertion.EnsureNoReachThisCode($"Invalid steps type '{searchCommand.StepsType}'."); } }
static internal FixedList <Step> GetList(SearchStepsCommand searchCommand) { Assertion.Require(searchCommand, "searchCommand"); return(StepsData.GetStepsList(searchCommand)); }
static internal new FixedList <Process> GetList(SearchStepsCommand searchCommand) { Assertion.Require(searchCommand, "searchCommand"); return(StepsData.GetProcessList(searchCommand)); }