Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Data.SqlClient;
  8.  
  9. public partial class Sign_Up_SignUpMain_1_ : System.Web.UI.Page
  10. {
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13.  
  14. }
  15.  
  16. protected void btnNext_Click(object sender, EventArgs e)
  17. {
  18. string str = "Data Source=(LocalDB)\MSSQLLocalDB;";
  19. str += "AttachDbFilename=|DataDirectory|Database.mdf;";
  20. str += "Integrated Security= True";
  21. string email, userName;
  22. //Page
  23. if (Page.IsValid == true)
  24. {
  25. email = txtEmail.Text;
  26. userName = txtUserName.Text;
  27. SqlConnection c = new SqlConnection(str);
  28. SqlCommand sqlCommand = new SqlCommand("INSERT INTO [Table] (Email, UserName) VALUES (@email, @userName);", c);
  29. sqlCommand.Connection = c;
  30. sqlCommand.Parameters.AddWithValue("@email", email);
  31. sqlCommand.Parameters.AddWithValue("@userName", userName);
  32. c.Open();
  33. sqlCommand.ExecuteNonQuery();
  34. c.Close();
  35. Response.Redirect("SignUp(2).aspx", true);
  36. }
  37. //Email
  38. if (rfvEmail.IsValid == false || revEmail.IsValid == false)
  39. { txtEmail.CssClass = "txtError"; }
  40. else
  41. { txtEmail.CssClass = "Text"; }
  42. //User Name
  43. if (rfvUserName.IsValid == false || revUserName.IsValid == false)
  44. { txtUserName.CssClass = "txtError"; }
  45. else
  46. { txtUserName.CssClass = "Text"; }
  47. }
  48. }
  49.  
  50. using System;
  51. using System.Collections.Generic;
  52. using System.Linq;
  53. using System.Web;
  54. using System.Web.UI;
  55. using System.Web.UI.WebControls;
  56. using System.Data.SqlClient;
  57.  
  58. public partial class Sign_Up_SignUp_2_ : System.Web.UI.Page
  59. {
  60. protected void Page_Load(object sender, EventArgs e)
  61. {
  62.  
  63. }
  64.  
  65. protected void btnNext_Click(object sender, EventArgs e)
  66. {
  67. string str = "Data Source=(LocalDB)\MSSQLLocalDB;";
  68. str += "AttachDbFilename=|DataDirectory|Database.mdf;";
  69. str += "Integrated Security= True";
  70. string password;
  71. //Page
  72. if (Page.IsValid == true)
  73. {
  74. password = txtPass.Text;
  75. SqlConnection c = new SqlConnection(str);
  76. SqlCommand sqlCommand = new SqlCommand("INSERT INTO [Table] (Email, UserName) VALUES (@email, @userName);", c);
  77. Response.Redirect("SignUp(3).aspx", true);
  78. }
  79. //Password
  80. if (revPass.IsValid == false || rfvPass.IsValid == false)
  81. { txtPass.CssClass = "txtError"; }
  82. else
  83. { txtPass.CssClass = "Text"; }
  84. //Confirm Password
  85. if (rfvConPass.IsValid == false)
  86. { txtConPass.CssClass = "txtError"; }
  87. else
  88. { txtConPass.CssClass = "Text"; }
  89. //Compare Passwords
  90. if (cvPasswords.IsValid == false)
  91. {
  92. txtPass.CssClass = "txtError";
  93. txtConPass.CssClass = "txtError";
  94. txtPass.Text = "";
  95. txtConPass.Text = "";
  96. }
  97. else
  98. {
  99. txtPass.CssClass = "Text";
  100. txtConPass.CssClass = "Text";
  101. }
  102.  
  103. }
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement