Ejemplo n.º 1
0
        /// <summary>
        /// Provide search with the specified query.
        /// </summary>
        /// <param name="options">The search options.</param>
        /// <returns>The search result.</returns>
        public virtual GridData Search(SearchOptions options)
        {
            var builder  = new CatalogQueryBuilder();
            var query    = builder.BuildQuery(options);
            var provider = new LuceneSearchProvider();

            return(new ItemResultDataConverter().Convert(provider.Search(query), options.GridColumns));
        }
        /// <summary>
        /// Provide search with the specified query.
        /// </summary>
        /// <param name="options">The search options.</param>
        /// <returns>The search result.</returns>
        public virtual GridData Search(SearchOptions options)
        {
            var builder = new CatalogQueryBuilder();
              var query = builder.BuildQuery(options);
              var provider = new LuceneSearchProvider();

              return new ItemResultDataConverter().Convert(provider.Search(query), options.GridColumns);
        }
        /// <summary>
        /// Provide search with the specified query.
        /// </summary>
        /// <param name="options">The search options.</param>
        /// <returns>The search result.</returns>
        public virtual GridData Search(SearchOptions options)
        {
            var builder = new CatalogQueryBuilder();
              var query = builder.BuildQuery(options);

              var productRepository = Context.Entity.Resolve<IProductRepository>();
              var products = productRepository.Get<ProductBaseData, Query>(query);
              var productBaseDatas = products as ProductBaseData[] ?? products.ToArray();
              return productBaseDatas.IsNullOrEmpty() ? new GridData() : new EntityResultDataConverter<ProductBaseData>().Convert(productBaseDatas, options.GridColumns);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Provide search with the specified query.
        /// </summary>
        /// <param name="options">The search options.</param>
        /// <returns>The search result.</returns>
        public virtual GridData Search(SearchOptions options)
        {
            var builder = new CatalogQueryBuilder();
            var query   = builder.BuildQuery(options);

            var productRepository = Context.Entity.Resolve <IProductRepository>();
            var products          = productRepository.Get <ProductBaseData, Query>(query);
            var productBaseDatas  = products as ProductBaseData[] ?? products.ToArray();

            return(productBaseDatas.IsNullOrEmpty() ? new GridData() : new EntityResultDataConverter <ProductBaseData>().Convert(productBaseDatas, options.GridColumns));
        }
        /// <summary>
        /// Provide search with the specified query.
        /// </summary>
        /// <param name="options">The search options.</param>
        /// <returns>The search result.</returns>
        public virtual GridData Search(SearchOptions options)
        {
            var builder = new CatalogQueryBuilder();
              var query = builder.BuildQuery(options);

              var orderManager = Context.Entity.Resolve<IOrderManager<Order>>();
              var orders = orderManager.GetOrders(query);

              var rules = new List<IMappingRule<Order>>();
              foreach (var order in orders)
              {
            var rule = Context.Entity.Resolve<IMappingRule<Order>>("OrderMappingRule");
            rule.MappingObject = order;
            rules.Add(rule);
              }

              return new EntityResultDataConverter<IMappingRule<Order>>().Convert(rules, options.GridColumns);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Provide search with the specified query.
        /// </summary>
        /// <param name="options">The search options.</param>
        /// <returns>The search result.</returns>
        public virtual GridData Search(SearchOptions options)
        {
            var builder = new CatalogQueryBuilder();
            var query   = builder.BuildQuery(options);

            var orderManager = Context.Entity.Resolve <IOrderManager <Order> >();
            var orders       = orderManager.GetOrders(query);

            var rules = new List <IMappingRule <Order> >();

            foreach (var order in orders)
            {
                var rule = Context.Entity.Resolve <IMappingRule <Order> >("OrderMappingRule");
                rule.MappingObject = order;
                rules.Add(rule);
            }

            return(new EntityResultDataConverter <IMappingRule <Order> >().Convert(rules, options.GridColumns));
        }
Ejemplo n.º 7
0
        protected virtual Query GetQuery()
        {
            var builder = new CatalogQueryBuilder();

            return(builder.BuildQuery(this.SearchOptions));
        }