Ejemplo n.º 1
0
 public override IEnumerable <Produits> GetResult()
 {
     return(_categorie != null?
            SearchBase.GetResult()
            .Where(p => _categorie.Contains(p.Sejours.Hotels.Categorie.Value))
                : SearchBase.GetResult());
 }
        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.º 3
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);
        }
Ejemplo n.º 4
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.º 5
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.º 6
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.º 7
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.º 8
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.º 9
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.º 10
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.º 11
0
        internal static List <SearchResutPartialViewItem> OrderingGroupResult(SearchBase s)
        {
            Form115Entities db = new Form115Entities();

            return(s.GetResult()
                   .GroupBy(p => p.Sejours.Hotels.IdHotel,
                            p => p,
                            (key, g) => new SearchResutPartialViewItem
            {
                Hotel = db.Hotels.Where(h => h.IdHotel == key).FirstOrDefault(),
                Produits = g.ToList()
            })
                   .ToList());
        }
Ejemplo n.º 12
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();

            List <Produits> listeDeProduitsPrixMini = new List <Produits>();

            var db    = new Form114Entities();
            var lPrix = db.Prix.Where(p => p.Montant >= _prixMini).ToList();

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

                if (list.Count() > 1)
                {
                    foreach (var item1 in list)
                    {
                        if (!(listeDeProduitsPrixMini.Contains(item1)))
                        {
                            listeDeProduitsPrixMini.Add(item1);
                        }
                    }
                }
                else
                {
                    var list1 = list.FirstOrDefault();
                    if (list1 != null && !(listeDeProduitsPrixMini.Contains(list1)))
                    {
                        listeDeProduitsPrixMini.Add(list1);
                    }
                }
            }
            // TODO : refaire après la mise a jour base de données sur la table Produits, prix ne pas être null

            return(_prixMini != null ? listeDeProduitsPrixMini : SearchBase.GetResult().OrderBy(p => p.IdProduit).ToList());
        }
Ejemplo n.º 13
0
 public override IEnumerable <Produits> GetResult()
 {
     return(_prixMax.HasValue
         ? SearchBase.GetResult().Where(p => (p.PrixSolde != null ? p.PrixSolde : p.Prix) <= _prixMax)
         : SearchBase.GetResult());
 }
Ejemplo n.º 14
0
 public override IEnumerable <Produits> GetResult()
 {
     return(SearchBase.GetResult()
            .Where(p => p.DateDepart >= _dateDebut && p.DateDepart <= _dateFin));
 }
Ejemplo n.º 15
0
 public override IEnumerable <Produits> GetResult()
 {
     return(SearchBase.GetResult()
            .Where(p => Math.Abs((p.DateDepart - _dateDepart).TotalDays) <= 10 &&
                   p.DateDepart.CompareTo(DateTime.Now) >= 0));
 }
Ejemplo n.º 16
0
 public override IEnumerable <Produits> GetResult()
 {
     return(SearchBase.GetResult()
            .Where(p => p.DateDepart >= DateTime.Now));
 }