コード例 #1
0
 public string BuildPredicate(SearchCriteria criteria)
 {
     string predicate = string.Empty;
     if (criteria != null)
     {
         var elements = Build(criteria).Where(item => !string.IsNullOrEmpty(item));
         predicate = string.Join(" AND ", elements);
     }
     return predicate.Trim();
 }
コード例 #2
0
        public IList<Instrument> SearchInstruments(SearchCriteria criteria)
        {
            string query = "SELECT * FROM RMS.RMS_INSTRUMENTS_VIEW";
            string predicate = queryBuilder.BuildPredicate(criteria);
            if (!string.IsNullOrEmpty(predicate))
            {
                query += (" WHERE " + predicate);
            }

            return db.Connection().QuerySql<Instrument>(query);
        }
コード例 #3
0
ファイル: TestDAL.cs プロジェクト: Romuald-Szymanski/Hack
        public static void test_search_query_builder()
        {
            var builder = new OracleSearchQueryBuilder();
            var criteria = new SearchCriteria()
            {
                Connections = new[] { "value1", "value2" }
            };
            string predicate = builder.BuildPredicate(criteria);

            Assert.Equal("(REGEXP_LIKE(CONNECTION_STATUS, 'value1', 'i') OR REGEXP_LIKE(CONNECTION_STATUS, 'value2', 'i'))", predicate);
        }
コード例 #4
0
 private IEnumerable<string> Build(SearchCriteria criteria)
 {
     yield return ProcessArray("CONNECTION_STATUS", criteria.Connections);
     yield return ProcessValue("EXT_INSTANCE_NO", criteria.InstanceId);
     yield return ProcessValue("SERIAL_NO", criteria.SerialNumber);
     yield return ProcessValue("RA_ID", criteria.RA_Id);
     yield return ProcessArray("INSTRUMENT_MODEL_NAME", criteria.Models);
     yield return ProcessArray("SUB_MODEL", criteria.SubModels);
     yield return ProcessValue("SITE_NAME", criteria.InstitutionName);
     yield return ProcessValue("SITE_CITY", criteria.City);
     yield return ProcessArray("SITE_STATE", criteria.States);
     yield return ProcessValue("SITE_COUNTRY", criteria.Country);
 }
コード例 #5
0
 public IList<Instrument> FindInstrument(SearchCriteria criteria)
 {
     return repository.FindInstruments(criteria);
 }
コード例 #6
0
 public IList<Instrument> FindInstruments(SearchCriteria criteria)
 {
     return db.Connection().QuerySql<Instrument>($"SELECT * FROM RMS.RMS_INSTRUMENTS_VIEW");
 }
コード例 #7
0
 public IList<Instrument> SearchInstruments(SearchCriteria criteria)
 {
     return searchService.SearchInstruments(criteria);
 }
コード例 #8
0
 public IList<Instrument> FindInstrument(SearchCriteria criteria)
 {
     return this.searchBusinessService.FindInstrument(criteria);
 }
コード例 #9
0
 public IList<Instrument> SearchInstruments(SearchCriteria criteria)
 {
     return searchRepository.SearchInstruments(criteria);
 }
コード例 #10
0
 public IList<Instrument> FindInstruments(SearchCriteria criteria)
 {
     return this.instrumentRepository.FindInstruments(criteria);
 }