Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class כניסה : System.Web.UI.Page
- {
- public string email, pass;
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Request["send"] != null)
- {
- email = Request["email"];
- pass = Request["pass"];
- string sql;
- sql = "SELECT * from [users] WHERE email='" + email + " ' and pass='" + pass + "'";
- bool flag = MyAdoHelper.IsExist("Database1.accdb", sql);
- if (flag)
- {
- DataTable table = MyAdoHelper.ExecuteDataTable("Database1.accdb", sql); //אחזור המידע
- string iname = (string)table.Rows[0]["fname"];
- bool isAdmin = (bool)table.Rows[0]["isAdmin"];
- string iEmail = (string)table.Rows[0]["email"];
- // הכניסה בוצעה בהצלחה,שמירת פרטי הלקוח
- Session["fname"] = iname;
- Session["isAdmin"] = isAdmin;
- Session["email"] = iEmail;
- /* if (iEmail.IndexOf("@gmail.com") > 0)
- Session["email"] = "gmail"; */
- // הכניסה בוצעה בהצלחה,העברה לדף הבית
- Response.Redirect("home.aspx");
- }
- else
- {
- Response.Redirect("loginFail.aspx");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement