Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void getGovernment()
- {
- using (SqlConnection conn = new SqlConnection(Helper.GetConnection()))
- {
- conn.Open();
- string SQL = @"SELECT GovernmentID FROM Employees WHERE Email = @Email AND Password = @userPW AND Status = 'ACTIVATED'";
- using (SqlCommand cmd = new SqlCommand(SQL, conn))
- {
- cmd.Parameters.AddWithValue("@Email", UserID.Text);
- cmd.Parameters.AddWithValue("@userPW", Helper.CreateSHAHash(txtPW.Text));
- using (SqlDataReader dr = cmd.ExecuteReader())
- {
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- Session["GovernmentID"] = dr["GovernmentID"];
- }
- Response.Redirect("~/Government/Index.aspx");
- }
- else
- {
- error.Visible = true;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement