protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "uy3", "AjaxFileUpload_change_text();", true);
            if (Session["StudentID"] != null)
            {
                Response.Redirect("Shares");
            }



            if (Session["UserId"] != null || Session["SuperUserId"] != null)
            {
                if (Session["SuperUserId"] != null)
                {
                    id = Convert.ToInt32(Session["SuperUserId"]);
                }
                else
                {
                    id = Convert.ToInt32(Session["UserId"]);
                }

                Trainer gelen = kislem.TekGetir(id);
                if (DropDownListKonu.SelectedIndex >= 1 && (DropDownSinif.SelectedIndex >= 1 || DropDownTumSinif.SelectedIndex >= 1))
                {
                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "fyt4", "PanelUploadShow();", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "fyt1", "Panel0Show();", true);
                }
                if (gelen != null)
                {
                    if (!IsPostBack)
                    {
                        DropDownListKonu.DataSource     = konu.HepsiniGetir().Where(p => p.SectionID == gelen.SectionID);
                        DropDownListKonu.DataValueField = "Id";
                        DropDownListKonu.DataTextField  = "Name";
                        DropDownListKonu.DataBind();
                        DropDownListKonu.Items.Insert(0, new ListItem("Konu Seçiniz..", "0"));
                        DropDownSinif.DataSource     = sinifislem.HepsiniGetir().Where(p => p.IsActive == true && p.TrainerID == gelen.Id);
                        DropDownSinif.DataValueField = "Id";
                        DropDownSinif.DataTextField  = "Name";
                        DropDownSinif.DataBind();
                        DropDownSinif.Items.Insert(0, new ListItem("Sınıf Seçiniz..", "0"));
                    }
                }
                else if (Session["StudentID"] != null)
                {
                    Response.Redirect("LogIn");
                }
                else
                {
                    Response.Redirect("LogIn");
                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "js", "Bilgilendirme('Eğitmene ait sınıf yoktur.','success');", true);
                }
            }
        }
        private void konu()
        {
            string sorgu = "select * from sikayetKonusu";

            sql = new sqlBaglantisi();
            SqlDataAdapter sqlData = new SqlDataAdapter(sorgu, sql.baglan());
            DataTable      dt      = new DataTable();

            sqlData.Fill(dt);
            DropDownListKonu.DataSource     = dt;
            DropDownListKonu.DataTextField  = "ad";
            DropDownListKonu.DataValueField = "id";
            DropDownListKonu.DataBind();
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ForumKonuID = Request.QueryString["ForumKonuID"];
            if (Page.IsPostBack == false)
            {
                if (Session["KoleksiyonerEmail"] != null)
                {
                    //kategori çek
                    SqlCommand    cmd = new SqlCommand("Select * from Kategori ", baglan.baglan());
                    SqlDataReader dr  = cmd.ExecuteReader();
                    DropDownListKonu.DataTextField  = "KategoriAdi";
                    DropDownListKonu.DataValueField = "KategoriID";
                    DropDownListKonu.DataSource     = dr;
                    DropDownListKonu.DataBind();

                    SqlCommand    cmdKonuGetir   = new SqlCommand("Select * from ForumKonu where ForumKonuID='" + ForumKonuID + "'", baglan.baglan());
                    SqlDataReader drKonuGuncelle = cmdKonuGetir.ExecuteReader();
                    DataTable     dtKonuGuncelle = new DataTable("tablo");
                    dtKonuGuncelle.Load(drKonuGuncelle);
                    DataRow row = dtKonuGuncelle.Rows[0];

                    txtKonuAdi.Text = row["ForumKonuBaslik"].ToString();
                    txtIcerik.Text  = row["ForumKonuIcerik"].ToString();
                    SqlCommand    cmd2 = new SqlCommand("Select * from Kategori where KategoriAdi='" + row["KategoriAdi"].ToString() + "'", baglan.baglan());
                    SqlDataReader dr2  = cmd2.ExecuteReader();
                    DataTable     dt2  = new DataTable("tablo");
                    dt2.Load(dr2);
                    DataRow row2 = dt2.Rows[0];

                    DropDownListKonu.SelectedIndex = (Convert.ToInt32(row2["KategoriID"]) - 1);


                    string        kEmail     = Session["KoleksiyonerEmail"].ToString();
                    SqlCommand    cmdSession = new SqlCommand("Select * from Koleksiyoner where KoleksiyonerEmail='" + kEmail + "'", baglan.baglan());
                    SqlDataReader drSession  = cmdSession.ExecuteReader();
                    DatalistProfilBilgi.DataSource = drSession;
                    DatalistProfilBilgi.DataBind();
                }
                else
                {
                    Response.Redirect("KullaniciGiris.aspx");
                }
            }
        }