Exemplo n.º 1
0
        protected void btnGonder_Click(object sender, EventArgs e)
        {
            gundemler.gundemBaslik = txtGundem.Text;
            gundemler.gundemIcerik = txtYorum.InnerText;
            HttpCookie cerezOku = Request.Cookies["cerezdosyam"];

            kullaniciler.mail    = cerezOku["mail"];
            gundemler.yazarid    = kullaniciler.KullaniciidDonder();
            gundemler.kategoriid = gundemler.Kategoriidgetir(DrpDownGundemKategori.SelectedValue);
            if (txtGundem.Text == "" || txtYorum.InnerText == "")
            {
                lblSonuc.Text = "Tüm alanlar doldurulmalıdır";
            }
            else
            {
                int  rolid     = kullaniciler.RolidDonder();
                bool eklendimi = gundemler.GundemEkle();
                if (eklendimi)
                {
                    lblSonuc.Text = "Gündem eklendi, geri dön butonu ile eklenen gündem maddesini görebilirsiniz.";
                }
                else
                {
                    lblSonuc.Text = "Gündem eklenirken bir sorun meydana geldi.";
                }
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dtGundemler = new DataTable();

            if (Request.Cookies["cerezDosyam"] != null)
            {
                HttpCookie cerezOku = Request.Cookies["cerezdosyam"];
                kullanicilar.mail = cerezOku["mail"].ToString();
                gundemler.mail    = cerezOku["mail"].ToString();
                int k_paun = kullanicilar.KullaniciPuanDonder();
                if (k_paun > 249)
                {
                    imgYetkiDurum.ImageUrl = "img/YazarIcon.png";
                }
                else
                {
                    imgYetkiDurum.ImageUrl = "img/UyeIcon.png";
                }
                imgYetkiDurum.ToolTip       = "Yetki Durumunuz";
                lnkkullaniciadi.Text        = "Hoşgeldiniz " + kullanicilar.KullaniciAdGonder();
                lnkkullaniciadi.PostBackUrl = "KullaniciProfil.aspx";
                lnkGiris.Visible            = false;
                lnkKaydol.Visible           = false;
                int rolid = kullanicilar.RolidDonder();
                if (rolid == (int)Rolu.Yazar)
                {
                    lnkGundemEkle.Visible = true;
                }
                else if (rolid == (int)Rolu.Admin)
                {
                    HttpCookie cerezim = new HttpCookie("cerezdosyam");
                    cerezim.Expires = DateTime.Now.AddDays(-1);
                    Response.Cookies.Add(cerezim);
                    Response.Redirect("Default.aspx");
                }
                else
                {
                    lnkGundemEkle.Visible = false;
                }
            }
            else
            {
                imgYetkiDurum.Visible = false;
                lnkCikis.Visible      = false;
                lnkGundemEkle.Visible = false;
            }
        }
Exemplo n.º 3
0
 protected void btnGiris_Click(object sender, EventArgs e)
 {
     kullanicilar.mail   = txtMail.Text;
     kullanicilar.parola = txtParola.Text;
     if (txtMail.Text == "" || txtParola.Text == "")
     {
         lblSonuc.Text = "Lütfen tüm alanları doldurunuz";
     }
     else
     {
         if (!kullanicilar.UyeKontrol())
         {
             lblSonuc.Text = "Mail veya parolanız hatalı";
         }
         else
         {
             HttpCookie cerezim = new HttpCookie("cerezdosyam");
             cerezim["mail"]   = txtMail.Text;
             kullanicilar.mail = cerezim["mail"];
             int k_puan = kullanicilar.KullaniciPuanDonder();
             if (k_puan == 250)
             {
                 kullanicilar.KullaniciYetkiDegistir(0);
             }
             else if (k_puan < 250)
             {
                 kullanicilar.KullaniciYetkiDegistir(1);
             }
             int rolid = kullanicilar.RolidDonder();
             if (rolid == (int)Rolu.Yazar || rolid == (int)Rolu.Uye)
             {
                 lblSonuc.Text   = "Giriş başarılı";
                 cerezim.Expires = DateTime.Now.AddDays(1);
                 Response.Cookies.Add(cerezim);
                 Response.Redirect("Default.aspx");
             }
             else
             {
                 cerezim.Expires = DateTime.Now.AddDays(1);
                 Response.Cookies.Add(cerezim);
                 Response.Redirect("~/Admin/Yazarlar.aspx");
             }
         }
     }
 }
Exemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lblUyeSayisi.Text    = kullanicilar.UyeAdetDonder().ToString();
     lblYazarSayisi.Text  = kullanicilar.YazarAdetDonder().ToString();
     lblGundemSayisi.Text = gundemler.GundemSayisiDonder().ToString();
     lblYorumSayisi.Text  = yorumlar.YorumSayisiDonder().ToString();
     if (Request.Cookies["cerezDosyam"] != null)
     {
         HttpCookie cerezOku = Request.Cookies["cerezdosyam"];
         kullanicilar.mail = cerezOku["mail"].ToString();
         int rolid = kullanicilar.RolidDonder();
         if (rolid == (int)Rolu.Yazar || rolid == (int)Rolu.Uye)
         {
             Response.Redirect("~/App/Default.aspx");
         }
         else
         {
             Response.Redirect("~/Admin/Yazarlar.aspx");
         }
     }
 }