Advertisement
SecretWorker

Untitled

Jun 11th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. public partial class כניסה : System.Web.UI.Page
  2. {
  3.  
  4. public string email, pass;
  5. protected void Page_Load(object sender, EventArgs e)
  6. {
  7. if (Request["send"] != null)
  8. {
  9. email = Request["email"];
  10. pass = Request["pass"];
  11.  
  12. string sql;
  13. sql = "SELECT * from [users] WHERE email='" + email + " ' and pass='" + pass + "'";
  14. bool flag = MyAdoHelper.IsExist("Database1.accdb", sql);
  15.  
  16. if (flag)
  17. {
  18. DataTable table = MyAdoHelper.ExecuteDataTable("Database1.accdb", sql); //אחזור המידע
  19. string iname = (string)table.Rows[0]["fname"];
  20. bool isAdmin = (bool)table.Rows[0]["isAdmin"];
  21. string iEmail = (string)table.Rows[0]["email"];
  22.  
  23. // הכניסה בוצעה בהצלחה,שמירת פרטי הלקוח
  24.  
  25. Session["fname"] = iname;
  26.  
  27. Session["isAdmin"] = isAdmin;
  28.  
  29. Session["email"] = iEmail;
  30.  
  31. /* if (iEmail.IndexOf("@gmail.com") > 0)
  32. Session["email"] = "gmail"; */
  33. // הכניסה בוצעה בהצלחה,העברה לדף הבית
  34.  
  35. Response.Redirect("home.aspx");
  36. }
  37. else
  38. {
  39. Response.Redirect("loginFail.aspx");
  40. }
  41.  
  42.  
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement