Ejemplo n.º 1
0
        public List <EvDTO> GetFilteredHouseData(EvFilterDTO evFilterObject)
        {
            var filteredEntity = evData.GetFilteredHouseData(evFilterObject);
            var filteredDTO    = mapper.Map <List <Ev>, List <EvDTO> >(filteredEntity);

            return(filteredDTO);
        }
Ejemplo n.º 2
0
        public List <Ev> GetFilteredHouseData(EvFilterDTO evFilterObject)
        {
            var query = db.TBLEv
                        .Include(q => q.Musteri)
                        .Include(q => q.EvTur);

            if (evFilterObject.Esyali.HasValue)
            {
                query = query.Where(q => q.Esyali == evFilterObject.Esyali);
            }
            if (evFilterObject.Musait.HasValue)
            {
                query = query.Where(q => q.Musait == evFilterObject.Musait);
            }
            if (evFilterObject.MaxFiyat.HasValue)
            {
                query = query.Where(q => q.Fiyat <= evFilterObject.MaxFiyat);
            }
            if (evFilterObject.MetreKare.HasValue)
            {
                query = query.Where(q => q.Metrekare >= evFilterObject.MetreKare);
            }
            if (evFilterObject.MinFiyat.HasValue)
            {
                query = query.Where(q => q.Fiyat >= evFilterObject.MinFiyat);
            }
            if (evFilterObject.Kat.HasValue)
            {
                query = query.Where(q => q.Kat >= evFilterObject.Kat);
            }
            if (evFilterObject.OdaSayisi.HasValue)
            {
                query = query.Where(q => q.OdaSayi >= evFilterObject.OdaSayisi);
            }
            if (!string.IsNullOrEmpty(evFilterObject.MusteriAd))
            {
                query = query.Where(q => q.Musteri.Ad.Equals(evFilterObject.MusteriAd));
            }
            if (!string.IsNullOrEmpty(evFilterObject.MusteriSoyad))
            {
                query = query.Where(q => q.Musteri.Soyad.Equals(evFilterObject.MusteriSoyad));
            }
            if (!string.IsNullOrEmpty(evFilterObject.SatilikKiralik))
            {
                query = query.Where(q => q.KiralikSatilik.Equals(evFilterObject.SatilikKiralik));
            }

            var filteredList = query.ToList();

            return(filteredList);
        }
        private EvFilterDTO InitializeEvFilterObject()
        {
            var evFilterObj = new EvFilterDTO();

            evFilterObj.MusteriAd      = string.IsNullOrWhiteSpace(txtMusteriAd.Text) ? null : txtMusteriAd.Text;
            evFilterObj.MusteriSoyad   = string.IsNullOrWhiteSpace(txtMusteriSoyad.Text) ? null: txtMusteriSoyad.Text;
            evFilterObj.Esyali         = chcboxEsyali.Checked ? true : default(bool?);
            evFilterObj.Musait         = chcMusait.Checked ? true : default(bool?);
            evFilterObj.OdaSayisi      = string.IsNullOrWhiteSpace(masktxtOdaSayi.Text) ? default(int?) : int.Parse(masktxtOdaSayi.Text);
            evFilterObj.SatilikKiralik = comboBox1.SelectedItem == null ? null : comboBox1.SelectedItem.ToString();
            evFilterObj.MaxFiyat       = string.IsNullOrWhiteSpace(maskdTxtMaxFiyat.Text) ? default(int?) : int.Parse(maskdTxtMaxFiyat.Text);
            evFilterObj.MinFiyat       = string.IsNullOrWhiteSpace(masktxtMinFiyat.Text) ? default(int?) : int.Parse(masktxtMinFiyat.Text);
            evFilterObj.MetreKare      = string.IsNullOrWhiteSpace(maskedm2.Text) ? default(int?) : int.Parse(maskedm2.Text);
            evFilterObj.Kat            = string.IsNullOrWhiteSpace(masktxtKat.Text) ? default(int?) : int.Parse(masktxtKat.Text);
            return(evFilterObj);
        }