protected void Button2_Click(object sender, EventArgs e) { if (HiddenField2.Value != "") { YoneticilerBLL yc = new YoneticilerBLL(); Yoneticiler y = yc.Get(Convert.ToInt32(HiddenField2.Value)); yb.Sil(y.YoneticiID); yukle(); } else { Response.Redirect("..\\Login.aspx"); } }
void yukle() { if (Session["admin"] != null) { YoneticilerBLL yc = new YoneticilerBLL(); Yoneticiler y = Session["admin"] as Yoneticiler; List <Yoneticiler> kullaniciler = yc.GetAll().Where(p => p.YoneticiID != y.YoneticiID).ToList(); Repeater1.DataSource = kullaniciler; Repeater1.DataBind(); } else { Response.Redirect("..\\Login.aspx"); } }
protected void btngiris_Click(object sender, EventArgs e) { if (txtad.Text != "" || txtsifre.Text != "") { YoneticilerBLL yb = new YoneticilerBLL(); var y = yb.GetAll().Where(p => p.AdSoyad == txtad.Text && p.Sifre == txtsifre.Text).FirstOrDefault(); if (y != null) { Session["admin"] = y; if (y.YetkiID == 1 || y.YetkiID == 2) { Response.Redirect("Yonetim/YayinAkisi.aspx"); } else if (y.YetkiID == 3) { Response.Redirect("Yonetim/Yemekciler.aspx"); } else if (y.YetkiID == 4) { Response.Redirect("Yonetim/Nobetciler.aspx"); } else if (y.YetkiID == 6) { Response.Redirect("Yonetim/Kantin.aspx"); } else { lbluyari.Text = "Sistemde hata oldu lütfen yetkili birisine başvurunuz!!!!"; } } else { lbluyari.Text = "Hata bilgi girdiniz lütfen kontrol ediniz."; } } else { lbluyari.Text = "Boş Bırakmayınız!!!!"; } }
protected void btnguncelle_Click(object sender, EventArgs e) { if (Session["admin"] != null) { Yoneticiler yeni = Session["admin"] as Yoneticiler; if (yeni.Sifre == txtsifre.Text) { yeni.AdSoyad = txtad.Text; yeni.Sifre = txtyenisifretekrar.Text; YoneticilerBLL bll = new YoneticilerBLL(); bll.Guncelle(yeni); } else { txtsifre.Text = ""; lblhata.Text = "Sifreniz yanlış girdiniz!!!"; } } else { Response.Redirect("~/Login.aspx"); } }