protected void lnkGiris_Click(object sender, EventArgs e) { if (TextBox1.Text != null && TextBox2.Text != null) { string posta = TextBox1.Text; string pass = TextBox2.Text; Adm admin = new Adm(); admin.Email = posta; admin.Sifre = pass; if (admin.girisYap() != null ) { Session[Misc.GecerliKullanici] = admin; Response.Redirect("~/Admin/Default.aspx", false); } else { mesaj.Text = "E-posta veya sifre gecersiz."; mesaj.Visible = true; } } else { mesaj.Text = "E-posta veya sifre alani doldurulmadi!"; mesaj.Visible = true; } }
public static Adm loginKontrol(Adm kisi) { try { Adm k = null; foreach (Int32 pno in new DBConnection().ConnectDB.LoginAdmin(kisi.Email, kisi.Sifre)) { k = new Adm(); k.ID = pno; } return k; } catch (EntityCommandExecutionException) { throw new Exception("Giriş yapılırken hata oluştu."); } }