Beispiel #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            ArrayList dizi  = new ArrayList();
            ArrayList dizi2 = new ArrayList();
            filtreBll fbll  = new filtreBll();

            string  yolla = "";
            JObject obj   = new JObject();

            foreach (Control item in yurt.Controls)
            {
                if (item is PlaceHolder)
                {
                    foreach (Control item2 in item.Controls)
                    {
                        foreach (Control item3 in item2.Controls)
                        {
                            if (item3 is DropDownList)
                            {
                                if (((DropDownList)item3).SelectedValue != "")
                                {
                                    dizi.Add(((DropDownList)item3).SelectedValue);
                                }
                            }
                            if (item3 is TextBox)
                            {
                                if (item3.ID != "txtMetreFiyat" && item3.ID != "txtPaftaNo")
                                {
                                    string[] gecici = ((TextBox)item3).Attributes["name"].Split('_');
                                    if (gecici[1] == "1")
                                    {
                                        if (((TextBox)item3).Text != "")
                                        {
                                            yolla = "{'ozellikId':'" + gecici[0] + "','minDeger':'" + ((TextBox)item3).Text + "'}";
                                        }
                                        else
                                        {
                                            yolla = "{'ozellikId':'" + gecici[0] + "','minDeger':'-1'}";
                                        }

                                        obj = JObject.Parse(yolla);
                                    }
                                    else
                                    {
                                        if (((TextBox)item3).Text != "")
                                        {
                                            obj.Add("maxDeger", ((TextBox)item3).Text);
                                        }
                                        else
                                        {
                                            obj.Add("maxDeger", "-1");
                                        }
                                        dizi2.Add(obj);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            //var sorgu = fbll.haritaFiltre(dizi);
            //string[] sonuc = fbll.haritaFiltre(dizi);

            ArrayList fiyat = new ArrayList();

            fiyat.Add(txtMinFiyat.Text);
            fiyat.Add(txtMaxFiyat.Text);
            //string kelime = "";

            ArrayList sonuc = fbll.haritaFiltre(
                drpIl.SelectedValue,
                drpIlce.SelectedValue,
                drpMahalle.SelectedValue,
                Request.QueryString["cat"],
                Request.QueryString["tur"],
                drpKimden.SelectedValue,
                fiyat,
                RadioButtonList1.SelectedValue,
                dizi,
                dizi2,
                txtAra.Text,
                1
                );
            JArray objDizi = new JArray();

            for (int i = 0; i < sonuc.Count; i++)
            {
                JObject objSonuc = JObject.FromObject((JObject)sonuc[i]);
                objDizi.Add(objSonuc);
            }

            //ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>alert('" + sonuc + "');</script>", false);

            var ilanTablo = objDizi.ToList();

            ilanRepeater.DataSource = ilanTablo;
            ilanRepeater.DataBind();
        }
Beispiel #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (drpIl.SelectedItem.Text == "Seçiniz")
            {
                mesaj = "Önce il seçimi yapmalısınız !";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='javascript'>uyariVer();</script>", false);
            }
            else
            {
                ArrayList dizi  = new ArrayList();
                ArrayList dizi2 = new ArrayList();
                filtreBll fbll  = new filtreBll();

                string  yolla   = "";
                JObject obj     = new JObject();
                int     kontrol = 0;
                foreach (Control item in yurt.Controls)
                {
                    if (item is PlaceHolder)
                    {
                        foreach (Control item2 in item.Controls)
                        {
                            foreach (Control item3 in item2.Controls)
                            {
                                if (item3 is DropDownList)
                                {
                                    if (((DropDownList)item3).SelectedValue != "")
                                    {
                                        dizi.Add(((DropDownList)item3).SelectedValue);
                                    }
                                }
                                if (item3 is TextBox)
                                {
                                    if (item3.ID != "txtMetreFiyat" && item3.ID != "txtPaftaNo")
                                    {
                                        string[] gecici = ((TextBox)item3).Attributes["name"].Split('_');
                                        if (gecici[1] == "1")
                                        {
                                            if (((TextBox)item3).Text != "")
                                            {
                                                yolla = "{'ozellikId':'" + gecici[0] + "','minDeger':'" + ((TextBox)item3).Text + "'}";
                                            }
                                            else
                                            {
                                                yolla = "{'ozellikId':'" + gecici[0] + "','minDeger':'-1'}";
                                                kontrol++;
                                            }

                                            obj = JObject.Parse(yolla);
                                        }
                                        else
                                        {
                                            if (((TextBox)item3).Text != "")
                                            {
                                                obj.Add("maxDeger", ((TextBox)item3).Text);
                                            }
                                            else
                                            {
                                                obj.Add("maxDeger", "-1");
                                                kontrol++;
                                            }
                                            if (kontrol != 2)
                                            {
                                                dizi2.Add(obj);
                                            }
                                            kontrol = 0;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                //var sorgu = fbll.haritaFiltre(dizi);
                //string[] sonuc = fbll.haritaFiltre(dizi);

                ArrayList fiyat = new ArrayList();

                fiyat.Add(txtMinFiyat.Text);
                fiyat.Add(txtMaxFiyat.Text);
                //string kelime = "";

                ArrayList sonuc = fbll.haritaFiltre(
                    drpIl.SelectedValue,
                    drpIlce.SelectedValue,
                    drpMahalle.SelectedValue,
                    Request.QueryString["cat"],
                    Request.QueryString["tur"],
                    drpKimden.SelectedValue,
                    fiyat,
                    RadioButtonList1.SelectedValue,
                    dizi,
                    dizi2,
                    txtAra.Text
                    );

                JArray objDizi = new JArray();
                if (sonuc.Count == 0)
                {
                    mesaj = "Sonuç Bulunamadı";
                }
                else
                {
                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "initMap", "alert(" + sonuc.Count + ");", true);
                    for (int i = 0; i < sonuc.Count; i++)
                    {
                        JObject objSonuc = JObject.FromObject((JObject)sonuc[i]);
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "initMap", "alert(" + objSonuc["koordinat"].ToString() + ");", true);
                        objDizi.Add(objSonuc);
                    }
                    string  ilKoordinat = "{lat:" + ilb.search(Convert.ToInt32(drpIl.SelectedValue)).enlem + ",lng:" + ilb.search(Convert.ToInt32(drpIl.SelectedValue)).boylam + "}";
                    JObject objil       = JObject.Parse(ilKoordinat);
                    objDizi.Add(objil);
                }

                ScriptManager.RegisterStartupScript(this, this.GetType(), "initMap", "initMap(" + objDizi + ");", true);

                verilenReklamBll vrb = new verilenReklamBll();
                reklamRepeater.DataSource = vrb.listHarita(2, 31);
                reklamRepeater.DataBind();

                acilRepeater.DataSource = haritab.ilanGetir(drpIl.SelectedValue);
                acilRepeater.DataBind();
            }
        }