Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. using System;
  2. using ClassLibrary1.Repositories;
  3. using System.Configuration;
  4.  
  5.  
  6. namespace ClockWize
  7. {
  8. public partial class Login : System.Web.UI.Page
  9. {
  10. protected void Page_Load(object sender, EventArgs e)
  11. {
  12. if (IsPostBack)
  13. {
  14. string username = TextBoxUserName.Text;
  15. string password = TextBoxPassword.Text;
  16. string conn = ConfigurationManager.ConnectionStrings["connectionDatabas"].ToString();
  17.  
  18. UserSQL repos = new UserSQL();
  19. int userId = repos.UserFound(username, password);
  20. if (userId != -1)
  21. {
  22. Session["authenticated"] = true;
  23. Session["userid"] = userId;
  24. Session["cart"] = new Cart();
  25. Response.Redirect("Default.aspx");
  26. }
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement