Ejemplo n.º 1
0
        public void sehirUlkeUniBolum()
        {
            FillDDL();

            dtIl = sql.crud.Sorgu("select * from Sehirler order by SehirAdi");
            DropDownListAdresIl.DataSource    = dtIl;
            DropDownListAdresIl.DataTextField = "SehirAdi";
            DropDownListAdresIl.DataBind();

            dtDil = sql.crud.Sorgu("select * from Languages order by Language");
            DropDownListdil.DataSource    = dtDil;
            DropDownListdil.DataTextField = "Language";
            DropDownListdil.DataBind();

            dtDil = sql.crud.Sorgu("select * from Languages order by Language");
            DropDownListDil2.DataSource    = dtDil;
            DropDownListDil2.DataTextField = "Language";
            DropDownListDil2.DataBind();

            dtUlke = sql.crud.Sorgu("select * from Ulkeler order by UlkeAdi");
            DropDownListulke1.DataSource    = dtUlke;
            DropDownListulke1.DataTextField = "UlkeAdi";
            DropDownListulke1.DataBind();

            dtSehir1 = sql.crud.Sorgu("select * from Sehirler order by SehirAdi");
            DropDownList1.DataSource    = dtSehir1;
            DropDownList1.DataTextField = "SehirAdi";
            DropDownList1.DataBind();

            dtSehir1 = sql.crud.Sorgu("select * from Sehirler order by SehirAdi");
            DropDownList2.DataSource    = dtSehir1;
            DropDownList2.DataTextField = "SehirAdi";
            DropDownList2.DataBind();

            dtSehir1 = sql.crud.Sorgu("select * from Sehirler order by SehirAdi");
            DropDownListlisesehir.DataSource    = dtSehir1;
            DropDownListlisesehir.DataTextField = "SehirAdi";
            DropDownListlisesehir.DataBind();


            dtSehir1 = sql.crud.Sorgu("select * from Sehirler order by SehirAdi");
            DropDownList3.DataSource    = dtSehir1;
            DropDownList3.DataTextField = "SehirAdi";
            DropDownList3.DataBind();

            dtuni = sql.crud.Sorgu("select * from Universiteler order by Universiteler");
            DropDownListuniadi.DataSource    = dtuni;
            DropDownListuniadi.DataTextField = "Universiteler";
            DropDownListuniadi.DataBind();

            dtbolum = sql.crud.Sorgu("select * from Bolumler order by Bolumadi");
            DropDownListbolumadi.DataSource    = dtbolum;
            DropDownListbolumadi.DataTextField = "Bolumadi";
            DropDownListbolumadi.DataBind();
        }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int     adminid     = Convert.ToInt32(Session["kod"]);
        DataRow drAdmin2    = veritabani.GetDataRow("select * from giris_bilgileri where kod=" + adminid);
        DataRow drtoptanci2 = veritabani.GetDataRow("select * from toptanci where kod=" + adminid);

        if (adminid == 0 || drtoptanci2 == null)
        {
            Session.Clear();
            Session.Abandon();
            Response.Redirect("~/login.aspx");
        }
        else
        {
            DataRow drAdmin    = veritabani.GetDataRow("select * from giris_bilgileri where kod=" + adminid);
            DataRow drtoptanci = veritabani.GetDataRow("select * from toptanci where kod=" + adminid);
            if (!IsPostBack)
            {
                SqlConnection  Conn = new SqlConnection(s);
                SqlCommand     Cmd  = new SqlCommand("Select * From adres_il", Conn);
                SqlDataAdapter DA   = new SqlDataAdapter(Cmd);
                DA.Fill(DS, "ad");
                DropDownListAdresIl.DataSource     = DS.Tables["ad"];
                DropDownListAdresIl.DataTextField  = "ad";
                DropDownListAdresIl.DataValueField = "kod";
                DropDownListAdresIl.DataBind();
                DropDownListAdresIl.Items.Insert(0, "Seçiniz");
                DropDownListIlce.Items.Insert(0, "Seçiniz");

                String  kod2       = (String)Session["kod"];
                DataRow toptanciDB = veritabani.GetDataRow("select * from toptanci where kod = '" + kod2 + "'");
                DataRow adresilDB  = veritabani.GetDataRow("select * from adres_il where kod = '" + toptanciDB["adres_il"].ToString() + "'");

                DataRow adresilceDB = veritabani.GetDataRow("select * from adres_ilce where kod = '" + toptanciDB["adres_ilce"].ToString() + "'");
                System.Diagnostics.Debug.WriteLine(adresilDB["ad"]);
                LabelAd.Text        = toptanciDB["ad"].ToString();
                LabelSoyad.Text     = toptanciDB["soyad"].ToString();
                TextBox1.Text       = toptanciDB["adres"].ToString();
                LabelCepTel.Text    = toptanciDB["cep_tel"].ToString();
                LabelEvTel.Text     = toptanciDB["is_tel"].ToString();
                LabelAdresIl.Text   = adresilDB["ad"].ToString();
                LabelAdresIlce.Text = adresilceDB["ad"].ToString();
                DataRow loginDB = veritabani.GetDataRow("select * from giris_bilgileri where kod = '" + kod2 + "'");
                LabelMail.Text = loginDB["email"].ToString();
                //        LabelSifre.Text = loginDB["sifre"].ToString();
            }
        }
    }