Ejemplo n.º 1
0
        public async Task <IEnumerable <CellGroupViewModel> > Get([FromQuery] SearchBase request)
        {
            _logger.LogInformation("fetch.cellgroups");
            var data = await _repository.SearchAsync(request);

            return(_mapper.Map <IEnumerable <CellGroupViewModel> >(data));
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <LocationViewModel> > Search([FromQuery] SearchBase request)
        {
            _logger.LogInformation("get.locations");
            var data = await _repository.SearchAsync(request);

            return(_mapper.Map <IEnumerable <LocationViewModel> >(data));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 开始单个文件分析
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnStartFenxi_Click(object sender, EventArgs e)
        {
            // 输入条件检查
            this.baseKeyWords = InputCheck();
            if (string.IsNullOrEmpty(this.baseKeyWords))
            {
                return;
            }

            // 打开要分析的文件
            this.baseFile = Util.SetOpenDailog(string.Empty, string.Empty);
            if (string.IsNullOrEmpty(this.baseFile))
            {
                return;
            }

            // 清空Grid
            this.gridSearchResult.Rows.Clear();

            // 设置不需要查找的文件
            this.notSearchFile = Util.GetNotSearchFile();

            // 设置查询引擎
            this.searchItem = this.GetSearchItem(this.baseFile, this.baseKeyWords);
            if (this.searchItem == null)
            {
                return;
            }

            // 查找单个文件
            this.Do(this.SearchFile);
        }
Ejemplo n.º 4
0
        public CommonRtnEntity GetBuyOrderInfo([FromBody]  SearchBase <string> searchInfo)
        {
            IBuyOrderInfoServices services = new BuyOrderInfoServices();

            BuyOrderInfo orderInfo = services.QueryByID(searchInfo.Data);

            List <WareInfo> wareList = new List <WareInfo>();

            if (orderInfo != null)
            {
                wareList = (new WareInfoServices()).Query(ware => ware.OrderID == orderInfo.ID);
            }

            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = orderInfo != null,
                Data    = new {
                    Info     = orderInfo,
                    WareList = wareList
                },
                Message = orderInfo != null ? "查询成功!" : "查询失败!"
            };

            return(rtnInfo);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 分析整个目录,提高效率
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMuluFenxi_Click(object sender, EventArgs e)
        {
            // 输入条件检查
            this.baseKeyWords = InputCheck();
            if (string.IsNullOrEmpty(this.baseKeyWords))
            {
                return;
            }

            // 取得目录信息
            this.baseFolder = Util.OpenFolder(string.Empty);
            if (string.IsNullOrEmpty(this.baseFolder))
            {
                return;
            }

            // 清空Grid
            this.gridSearchResult.Rows.Clear();

            // 设置查询引擎
            this.searchItem = this.GetSearchItem(this.baseFile, this.baseKeyWords);
            if (this.searchItem == null)
            {
                return;
            }

            // 查找目录
            this.Do(this.SearchFolder);
        }
Ejemplo n.º 6
0
        public CommonRtnEntity List([FromBody] SearchBase <OrderInfo> searchInfo)
        {
            int            result     = 0;
            int            totalCount = 0;
            IOrderServices services   = new OrderServices();

            List <OrderInfo> list = services.QueryPage(x =>
                                                       x.ID.Equals(searchInfo.Data.ID) &&
                                                       x.UserID.Equals(searchInfo.Data.UserID) &&
                                                       x.DeliverType.Equals(searchInfo.Data.DeliverType) &&
                                                       x.DeliverNo.Contains(searchInfo.Data.DeliverNo)
                                                       //&& (searchInfo.Data.IsIncumbency == null || searchInfo.Data.IsIncumbency.Value == x.IsIncumbency)
                                                       , ref totalCount, searchInfo.PageIndex, searchInfo.PageSize, " CreateTime desc ");

            //list.ForEach(x => x.Pwd = "");

            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = list.Count > 0,
                Data    = new
                {
                    TotalCount = totalCount,
                    Data       = list
                },
                Message = "查询成功!"
            };

            return(rtnInfo);
        }
Ejemplo n.º 7
0
        public CommonRtnEntity GetList([FromBody] SearchBase <CustomersSuppliersSearch> searchInfo)
        {
            ICustomersSuppliersInfoServices services = new CustomersSuppliersInfoServices();

            int totalCount = 0;

            List <CustomersSuppliersInfo> list = services.QueryPage(x =>
                                                                    x.Name.Contains(searchInfo.Data.Name) &&
                                                                    x.Type == searchInfo.Data.Type &&
                                                                    x.PersonName.Contains(searchInfo.Data.PersonName) &&
                                                                    x.PersonPhone.Contains(searchInfo.Data.PersonPhone) &&
                                                                    x.QQ.Contains(searchInfo.Data.QQ) &&
                                                                    x.WeiXin.Contains(searchInfo.Data.WeiXin)
                                                                    , ref totalCount, searchInfo.PageIndex, searchInfo.PageSize, " CreateTime desc ");

            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = list.Count > 0,
                Data    = new
                {
                    TotalCount = totalCount,
                    Data       = list
                },
                Message = "查询成功!"
            };

            return(rtnInfo);
        }
Ejemplo n.º 8
0
        public override IQueryable <Gebruiker> Filter(IQueryable <Gebruiker> query, SearchBase <Gebruiker> searchCriteria)
        {
            if (searchCriteria.GetType().Equals(typeof(GebruikerSearch)))
            {
                GebruikerSearch criteria = (GebruikerSearch)searchCriteria;

                if (!string.IsNullOrWhiteSpace(criteria.Email))
                {
                    query = query.Where(x => x.Email == criteria.Email);
                }
                if (!string.IsNullOrEmpty(criteria.Rol))
                {
                    Rol rol;
                    if (Enum.TryParse <Rol>(criteria.Rol, out rol))
                    {
                        query = query.Where(x => x.Rol == rol);
                    }
                }
                if (criteria.MinionOfId.HasValue)
                {
                    query = query.Where(x => x.VerantwoordelijkeId == criteria.MinionOfId.Value);
                }
            }

            return(base.Filter(query, searchCriteria));
        }
Ejemplo n.º 9
0
        public ReaderResponseData SearchUsers(SearchBase searchMeta)
        {
            ReaderResponseData response = new ReaderResponseData(); //= new Dyna;

            try
            {
                UserReader reader = new UserReader();
                reader.SearchObj = searchMeta;
                Collection <User> userCollection = reader.Execute();
                response.PageIndex     = searchMeta.PageIndex;
                response.PageSize      = searchMeta.PageSize;
                response.SearchKey     = searchMeta.SearchKey;
                response.SortDirection = searchMeta.SortDirection;
                response.SortKey       = searchMeta.SortKey;
                response.StatusCode    = RequestStatus.Success;

                if (userCollection.Count > 0)
                {
                    response.Data          = userCollection;
                    response.StatusMessage = "Success";
                }
                else
                {
                    response.StatusMessage = "No Records Found";
                }
            }
            catch (Exception ex)
            {
                response.StatusCode    = RequestStatus.Failure;
                response.StatusMessage = "Failed";
            }
            return(response);
        }
        public override IEnumerable <Produits> GetResult()
        {
            //return _Ville != null ? new Form114Entities().Produits.Where(p => p.IdVille == _Ville).OrderBy(p => p.IdProduit) : new Form114Entities().Produits.OrderBy();
            // TODO : refaire après la mise a jour base de données sur la table Produits, prix ne pas être null

            return(_nombreDePlace != null?SearchBase.GetResult().Where(p => p.NbPlaces >= _nombreDePlace).OrderBy(p => p.IdProduit).ToList() : SearchBase.GetResult().OrderBy(p => p.IdProduit).ToList());
        }
Ejemplo n.º 11
0
        public CommonRtnEntity GetList([FromBody] SearchBase <UserInfo> searchInfo)
        {
            IUserServices services = new UserServices();

            int totalCount = 0;

            List <UserInfo> list = services.QueryPage(x =>
                                                      x.Name.Contains(searchInfo.Data.Name) &&
                                                      x.LoginName.Contains(searchInfo.Data.LoginName) &&
                                                      x.PersonPhone.Contains(searchInfo.Data.PersonPhone) &&
                                                      x.Email.Contains(searchInfo.Data.Email)
                                                      //&& (searchInfo.Data.IsIncumbency == null || searchInfo.Data.IsIncumbency.Value == x.IsIncumbency)
                                                      , ref totalCount, searchInfo.PageIndex, searchInfo.PageSize, " CreateTime desc ");

            list.ForEach(x => x.Pwd = "");


            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = list.Count > 0,
                Data    = new
                {
                    TotalCount = totalCount,
                    Data       = list
                },
                Message = "查询成功!"
            };

            return(rtnInfo);
        }
Ejemplo n.º 12
0
 public override IEnumerable <Produits> GetResult()
 {
     return(_duree.HasValue
         ? SearchBase.GetResult()
            .Where(p => Math.Abs((decimal)(p.Sejours.Duree - _duree)) <= 2)
         : SearchBase.GetResult());
 }
Ejemplo n.º 13
0
 public override IEnumerable <Produits> GetResult()
 {
     return(_categorie != null?
            SearchBase.GetResult()
            .Where(p => _categorie.Contains(p.Sejours.Hotels.Categorie.Value))
                : SearchBase.GetResult());
 }
Ejemplo n.º 14
0
        /// <summary>
        /// 图书点击次数详情
        /// </summary>
        /// <param name="SiteID"></param>
        /// <param name="BookID"></param>
        /// <returns></returns>
        public PageResult <UserClick> GetBookClickDetails(int SiteID, int BookID, SearchBase search)
        {
            List <UserClick>       tempList   = GetBookClickList(SiteID, BookID).OrderByDescending(s => s.ReadTime).ToList();
            PageResult <UserClick> pageResult = new PageResult <UserClick>(search.PageSize, tempList.Count, search.PageIndex, tempList, string.Empty, true);

            return(pageResult);
        }
Ejemplo n.º 15
0
        public override IEnumerable <Produits> GetResult()
        {
            // TODO : refaire après la mise a jour base de données sur la table Produits, prix ne pas être null.
            List <Produits> listeDeProduitsDateDebut = new List <Produits>();
            var             _db   = new Form114Entities();
            var             lDate = _db.Prix.Where(p => p.DateDebut <= _Debut && p.DateFin >= _Debut).ToList();

            foreach (var item in lDate)
            {
                var list = SearchBase.GetResult().Where(p => p.IdProduit == item.IdProduit);

                if (list.Count() > 1)
                {
                    foreach (var item1 in list)
                    {
                        //if(!(listeDeProduitsDateDebut.Contains(item1)))
                        listeDeProduitsDateDebut.Add(item1);
                    }
                }
                else
                {
                    var list1 = list.FirstOrDefault();
                    if (list1 != null /*&& !(listeDeProduitsDateDebut.Contains(list1))*/)
                    {
                        listeDeProduitsDateDebut.Add(list1);
                    }
                }
            }

            //return _Debut != null ? listeDeProduitsDateDebut : SearchBase.GetResult().OrderBy(p => p.IdProduit).ToList();
            return(listeDeProduitsDateDebut);
        }
 public AutoSearchCompleteTextBox(SearchBase search,
                                  object MatchMember,
                                  object DisplayMember,
                                  object ValueMember) : this()
 {
     SetFieldToSearch(search, MatchMember, DisplayMember, ValueMember);
 }
Ejemplo n.º 17
0
        public IActionResult SearchByTitle([FromBody] SearchBase search)
        {
            IQueryable <Tags> query = _tagService.GetTagsBySearch_Query(search.SearchTerm);
            var response            = _dbHelper.GetObjectsByQuery <Tags, TagSummary>(query);

            return(ApiResult(response));
        }
Ejemplo n.º 18
0
        public override IEnumerable <Produits> GetResult()
        {
            var db = new Form115Entities();

            if (_idVille != 0)
            {
                return(SearchBase.GetResult().Where(p => p.Sejours.Hotels.Villes.idVille == _idVille));
            }
            else if (_idPays != null && _idPays != "0")
            {
                return(SearchBase.GetResult()
                       .Where(p => p.Sejours.Hotels.Villes.Pays.CodeIso3 == _idPays));
            }
            else if (_idRegion != 0)
            {
                return(SearchBase.GetResult()
                       .Where(p => p.Sejours.Hotels.Villes.Pays.Regions.idRegion == _idRegion));
            }
            else if (_idContinent != 0)
            {
                return(SearchBase.GetResult()
                       .Where(p => p.Sejours.Hotels.Villes.Pays.Regions.Continents.idContinent == _idContinent));
            }
            else
            {
                return(SearchBase.GetResult());//))
            }
        }
Ejemplo n.º 19
0
 public override IEnumerable <Produits> GetResult()
 {
     if (_region == null || _region == 0)
     {
         return(SearchBase.GetResult());
     }
     return(SearchBase.GetResult().Where(p => p.Villes.Pays.Regions.idRegion == (int)_region));
 }
Ejemplo n.º 20
0
 public SearchOptionDestination(SearchBase sb, int idContinent, int idRegion, string idPays, int idVille)
     : base(sb)
 {
     _idContinent = idContinent;
     _idRegion    = idRegion;
     _idPays      = idPays;
     _idVille     = idVille;
 }
Ejemplo n.º 21
0
        public CommonRtnEntity GetOrderSituation([FromBody] SearchBase <BuyOrderSearch> searchInfo)
        {
            IBuyOrderInfoServices services = new BuyOrderInfoServices();

            DateTime start = DateTime.Parse(DateTime.Now.AddDays(-15).ToString("yyyy-MM-dd"));
            DateTime end   = DateTime.Now;

            List <BuyOrderInfo> list = null;

            list = services.Query(d =>
                                  d.CreateTime >= start &&
                                  d.CreateTime <= end
                                  );


            List <string> xList = new List <string>();
            Dictionary <string, List <double> > data = new Dictionary <string, List <double> >();

            data.Add("PO", new List <double>());
            data.Add("SO", new List <double>());

            IEnumerable <IGrouping <string, BuyOrderInfo> > query =
                list.GroupBy(pet => pet.CreateTime.Value.ToString("MM-dd"), pet => pet);



            for (int i = 0; i < (end - start).TotalDays; i++)
            {
                string dayStr = start.AddDays(i).ToString("MM-dd");
                xList.Add(dayStr);

                List <BuyOrderInfo> todayList = new List <BuyOrderInfo>();

                IGrouping <string, BuyOrderInfo> groupToday = query.Where(x => x.Key == dayStr).FirstOrDefault();
                if (groupToday != null)
                {
                    todayList = groupToday.ToList();
                }
                double poTotalMoney = todayList.Where(x => x.OrderType == "PO").Sum(x => x.TotalMoney);
                double soTotalMoney = todayList.Where(x => x.OrderType == "SO").Sum(x => x.TotalMoney);
                data["PO"].Add(poTotalMoney);
                data["SO"].Add(soTotalMoney);
            }


            CommonRtnEntity rtnInfo = new CommonRtnEntity()
            {
                Success = list.Count > 0,
                Data    = new
                {
                    XList = xList,
                    Data  = data
                },
                Message = "查询成功!"
            };

            return(rtnInfo);
        }
Ejemplo n.º 22
0
 public override IEnumerable <Produits> GetResult()
 {
     // TODO Mieux tester les données entrantes
     return(_dureeMin.HasValue && _dureeMax.HasValue
         ? SearchBase.GetResult()
            .Where(p => p.Sejours.Duree >= _dureeMin &&
                   p.Sejours.Duree <= _dureeMax)
         : SearchBase.GetResult());
 }
Ejemplo n.º 23
0
        /// <summary>
        /// Djkstra Algorithm
        /// </summary>
        /// <param name="args"></param>
        /// <param name="frontierPredicate"></param>
        /// <returns></returns>
        private static Dictionary <Node, Node> BuildDjkstraMap(SearchBase args, Predicate <Node> goalFunction, Predicate <Node> frontierPredicate)
        {
            Dictionary <Node, Node> map = new Dictionary <Node, Node>(nodeComparer);

            int  iterations   = 0;
            Node startingNode = new Node(null, args.startElement, 0f);

            PriorityQueue frontier = new PriorityQueue(0);

            frontier.Insert(startingNode);
            map.Add(startingNode, null);


            while (frontier.NotEmpty())
            {
                Node current = frontier.Pop();
                if (goalFunction != null && goalFunction(current))
                {
                    break;
                }

                Node[] neighbors = FindNeighbors(current, args);
                foreach (Node next in neighbors)
                {
                    if (frontierPredicate != null && !frontierPredicate(next))
                    {
                        continue;
                    }

                    bool add = false;
                    // If the node has not been visited
                    if (!map.ContainsKey(next))
                    {
                        add = true;
                    }
                    // If it has been visited and this new cost is cheaper than previous
                    else
                    {
                        Node existing = map[next];
                        if (next.givenCost < existing.givenCost)
                        {
                            map.Remove(existing);
                            add = true;
                        }
                    }

                    if (add)
                    {
                        frontier.Insert(next, next.givenCost);
                        map.Add(next, current);
                    }
                }
                iterations++;
            }

            return(map);
        }
Ejemplo n.º 24
0
 public override IEnumerable <Produits> GetResult()
 {
     //return _Ville != null ? new Form114Entities().Produits.Where(p => p.IdVille == _Ville).OrderBy(p => p.IdProduit) : new Form114Entities().Produits.OrderBy();
     if (_pays == "" || _pays == null)
     {
         return(SearchBase.GetResult());
     }
     return(SearchBase.GetResult().Where(p => p.Villes.Pays.CodeIso3 == _pays));
 }
Ejemplo n.º 25
0
        public override IEnumerable <Produits> GetResult()
        {
            var db = new Form115Entities();

            return(_nbPersonnes.HasValue
                ? SearchBase.GetResult()
                   .Where(p => ((p.NbPlaces - (p.Reservations.Count() != 0 ? p.Reservations.Sum(r => r.Quantity) : 0)) >= _nbPersonnes))
                : SearchBase.GetResult());
        }
Ejemplo n.º 26
0
 public override IEnumerable <Produits> GetResult()
 {
     //return _Ville != null ? new Form114Entities().Produits.Where(p => p.IdVille == _Ville).OrderBy(p => p.IdProduit) : new Form114Entities().Produits.OrderBy();
     // TODO : refaire après la mise a jour base de données sur la table Produits, prix ne pas être null
     if (_Ville == null || _Ville[0] == 0)
     {
         return(SearchBase.GetResult());
     }
     return(SearchBase.GetResult().Where(p => _Ville.Contains(p.IdVille)).OrderBy(p => p.IdProduit));
 }
Ejemplo n.º 27
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var        path   = @"D:\SkyDrive\文档\PanGu4Lucene_V2.3.1.0\PanGu4Lucene\WebDemo\Bin\NewsIndex";
            SearchBase search = new SearchBase(path);

            int count = 0;

            search.IndexFilePath = path;
            search.Search(path, TextBox1.Text, 1, 1, out count);
        }
Ejemplo n.º 28
0
        public async Task <List <MinimalContact> > SearchContacts(SearchBase request)
        {
            var json = JsonConvert.SerializeObject(request);

            _logger.LogInformation($"search.contacts ${json}");
            var data = (await _contactService.SearchMinimalAsync(request)).ToList();

            _logger.LogInformation($"found.contacts {data.Count}");
            return(data);
        }
Ejemplo n.º 29
0
 public SearchItem(SearchBase baseItem)
 {
     MediaType   = MediaType.Unknown;
     Id          = baseItem.Id;
     MediaType   = baseItem.MediaType;
     ResultName  = "UNKNOWN";
     ReleaseDate = null;
     Overview    = "UNKNOWN";
     Rating      = 0;
 }
        public void SetFieldToSearch(SearchBase search)
        {
            if (!search.IsSimple)
            {
                throw new InvalidOperationException(
                          "For a non-simple search one must supply more information!");
            }
            Search = search;

            UpdateCompletionSource();
        }
Ejemplo n.º 31
0
 protected SearchOption(SearchBase sb)
 {
     SearchBase = sb;
 }