Advertisement
Guest User

Untitled

a guest
Mar 28th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.56 KB | None | 0 0
  1. ----------------Create user page------------------------------------------------------------------
  2. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="create.aspx.cs" Inherits="create" %>
  3.  
  4. <!DOCTYPE html>
  5.  
  6. <script runat="server">
  7. protected void btnInsert_Click(object source, EventArgs e)
  8. {
  9. sdsMattUsers.Insert();
  10. Response.Redirect("forWork.aspx");
  11.  
  12. }
  13. </script>
  14.  
  15. <html xmlns="http://www.w3.org/1999/xhtml">
  16. <head runat="server">
  17. <title>Create</title>
  18.  
  19. <link rel="stylesheet" href="styles.css" />
  20. </head>
  21. <body>
  22. <header id="navigation" class="navigation headroom" />
  23.  
  24. <div class="header">
  25. <a href="#default" class="logo">
  26. <img src="images/google.PNG" /></a>
  27. <div class="header-right">
  28. <a href="signin.aspx">SIGN IN</a>
  29. </div>
  30. </div>
  31. <form id="form1" runat="server">
  32. <div class="split">
  33. <div class="split-left split-text ">
  34. <img id="createside" src="images/createside.PNG" />
  35. </div>
  36. <div class="split-right split-text ">
  37. <div id="createForm" style="background-color: #f1f1f1; width: 400px">
  38. <asp:Label ID="Name" runat="server"
  39. Text="Name" AssociatedControlID="Name" />
  40. <br />
  41. <asp:TextBox ID="first" runat="server" AssociatedControlID="first"
  42. placeholder="first" />
  43. <asp:TextBox ID="Last" runat="server" AssociatedControlID="last"
  44. placeholder="Last" />
  45. <br />
  46. <br />
  47. <asp:Label ID="Username" runat="server"
  48. Text="Choose your username" AssociatedControlID="userNameTxt" />
  49. <br />
  50. <asp:TextBox ID="userNameTxt" runat="server"
  51. placeholder="@gmail.com" />
  52. <br />
  53. <br />
  54. <asp:Label ID="Password" runat="server"
  55. Text="Create a password" AssociatedControlID="pwd" />
  56. <br />
  57. <asp:TextBox ID="pwd" runat="server" type="password" />
  58. <br />
  59. <br />
  60. <asp:Label ID="cPassword" runat="server"
  61. Text="Confirm your password" AssociatedControlID="cpwdTxt" />
  62. <br />
  63. <asp:TextBox ID="cpwdTxt" runat="server" type="password" />
  64. <br />
  65. <br />
  66. <asp:Label ID="Birthday" runat="server" Text="Birthday" AssociatedControlID="bDayTxt" />
  67. <br />
  68. <asp:TextBox ID="bDayTxt" runat="server" placeholder="MM/DD/YYYY" />
  69. <br />
  70. <br />
  71. <asp:Label ID="Gender" Text="Gender" runat="server" AssociatedControlID="genderDRP" />
  72. <br />
  73. <asp:DropDownList ID="genderDRP" runat="server">
  74. <asp:ListItem Value="0" Text="Select"></asp:ListItem>
  75. <asp:ListItem Value="Male" Text="Male"></asp:ListItem>
  76. <asp:ListItem Value="Female" Text="Female"></asp:ListItem>
  77. </asp:DropDownList>
  78. <br />
  79. <br />
  80.  
  81. <asp:Label ID="PhoneNumber" runat="server" Text="Mobile Number" AssociatedControlID="pnbr" />
  82. <asp:TextBox ID="pnbr" runat="server" />
  83. <br />
  84. <br />
  85.  
  86. <asp:SqlDataSource
  87. ID="sdsMattUsers"
  88. runat="server"
  89. ConnectionString="<%$ ConnectionStrings:team06 %>"
  90. SelectCommand="SELECT * FROM MattUsers"
  91. InsertCommand="INSERT INTO
  92. MattUsers (UserName, FirstName,LastName, Password, Birthday,Gender, PhoneNumber)
  93. VALUES (@UserName, @FirstName,@LastName,@Password,@Birthday, @Gender, @PhoneNumber)">
  94. <InsertParameters>
  95. <asp:FormParameter Name="UserName" FormField="userNameTxt" />
  96. <asp:FormParameter Name="FirstName" FormField="first" />
  97. <asp:FormParameter Name="LastName" FormField="last" />
  98. <asp:FormParameter Name="Password" FormField="pwd" />
  99. <asp:FormParameter Name="Birthday" FormField="bDayTxt" />
  100. <asp:FormParameter Name="Gender" FormField="genderDRP" />
  101. <asp:FormParameter Name="PhoneNumber" FormField="pnbr" />
  102.  
  103. </InsertParameters>
  104. </asp:SqlDataSource>
  105.  
  106. <asp:Button ID="NxtStep" runat="server" Text="NextStep" Style="background-color: #3079ed; color: white;" OnClick="btnInsert_Click" />
  107. </div>
  108. </div>
  109. </div>
  110. <%--SqlDataSource for other data operations--%>
  111. </form>
  112. </body>
  113. </html>
  114.  
  115.  
  116. -------------------------------------------------- Signin Page----------------------------------------------------
  117.  
  118.  
  119. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="signin.aspx.cs" Inherits="signin" %>
  120.  
  121. <%@ Import Namespace="System.Data" %>
  122. <!DOCTYPE html>
  123.  
  124. <script runat="server">
  125.  
  126. void btnLogin_Clicked(object sender, EventArgs e)
  127. {
  128. if (Page.IsValid)
  129. {
  130.  
  131. DataView dataview = (DataView)sdsCredential.Select(DataSourceSelectArguments.Empty);
  132.  
  133. DataTable datatable = dataview.ToTable();
  134.  
  135. if (datatable.Rows.Count < 1)
  136. {
  137. lblLoginResult.ForeColor = System.Drawing.Color.Red;
  138. lblLoginResult.Text = "Login failed.";
  139. }
  140. else
  141. {
  142.  
  143. lblLoginResult.ForeColor = System.Drawing.Color.Blue;
  144. lblLoginResult.Text = "You have logged in successfully.";
  145. }
  146. }
  147. }
  148.  
  149. </script>
  150.  
  151. <html xmlns="http://www.w3.org/1999/xhtml">
  152. <head runat="server">
  153. <title>Sign In</title>
  154. <style>
  155. .signInPage {
  156. align-content: center;
  157. left: 40%;
  158. height: 25px;
  159. text-align: center;
  160. width: 310px;
  161. border-radius: 10px;
  162. width: 200px;
  163. top: 300px;
  164. position: relative;
  165. }
  166.  
  167. </style>
  168. </head>
  169. <body>
  170. <form id="signinpage" runat="server">
  171.  
  172. <div id="signInPage">
  173. <asp:Label ID="Username" runat="server"
  174. Text="Username" AssociatedControlID="userName" />
  175. <br />
  176. <asp:TextBox ID="userNameTxt" runat="server"
  177. placeholder="@gmail.com" />
  178. <br />
  179. <br />
  180. <asp:Label ID="Password" runat="server"
  181. Text="Password" AssociatedControlID="pwd" />
  182. <br />
  183. <asp:TextBox ID="pwd" runat="server" type="password" />
  184. <br />
  185. <br />
  186. <asp:SqlDataSource
  187. ID="sdsCredential"
  188. ConnectionString="<%$ ConnectionStrings:team06 %>"
  189. SelectCommand="SELECT UserName, Password FROM MattUsers where (UserName=@UserName AND Password=@pwd)"
  190. runat="server">
  191. <SelectParameters>
  192. <asp:ControlParameter ControlID="userNameTxt"
  193. PropertyName="Text" Name="UserName" />
  194. <asp:ControlParameter ControlID="pwd"
  195. PropertyName="Text" Name="pwd" />
  196. </SelectParameters>
  197. </asp:SqlDataSource>
  198. <asp:Button ID="Signin" runat="server" Text="Sign In" OnClick="btnLogin_Clicked"
  199. Style="background-color: #3079ed; color: white; border-radius: 10px; border-color: #3079ed" />
  200. <br />
  201. <asp:Label ID="lblLoginResult" runat="server" /><br />
  202. </div>
  203.  
  204. </form>
  205. </body>
  206. </html>
  207.  
  208.  
  209.  
  210. -----------------------------------For Work Page-------------------------------------
  211.  
  212.  
  213. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="forWork.aspx.cs" Inherits="forWork" %>
  214.  
  215. <!DOCTYPE html>
  216. <script runat="server">
  217.  
  218. void Page_Load(object sender, EventArgs e)
  219. {
  220. if (Session != null)
  221. {
  222. Response.Redirect("signin.aspx");
  223. }
  224. else
  225. {
  226. Response.Redirect("forWork.aspx");
  227. }
  228.  
  229. }
  230.  
  231. </script>
  232.  
  233. <html xmlns="http://www.w3.org/1999/xhtml">
  234. <head runat="server">
  235. <title>For Work</title>
  236.  
  237. <link rel="stylesheet" href="styles.css"/>
  238. </head>
  239. <body>
  240. <header id="navigation" class="navigation headroom" runat="server">
  241.  
  242. <div class="header">
  243. <a href="#default" class="logo"> <img src="images/logo.PNG" /></a>
  244. <div class="header-right">
  245. <a class="active" href="forWork.aspx">FOR WORK</a>
  246. <a href="signin.aspx">SIGN IN</a>
  247. <a href="create.aspx">CREATE ACCOUNT</a>
  248. </div>
  249. </div>
  250.  
  251.  
  252. </header>
  253. <form id="form1" runat="server">
  254. <div>
  255. <img src="images/topBan.PNG" style="width:1089.6px auto" />
  256. </div>
  257. <div class="workOrange" style=" background-color: #dd5347; padding:20px" >
  258. <div class="split">
  259. <div class="split-left split-text ">
  260. <asp:Button ID="getStarted" runat="server" Text="Get Started" style="background-color:#dd5347;
  261. color:white; border-color:white; height:60px; width:100px; border-radius: 12px; float:right;" />
  262. </div>
  263. <div class="split-right split-text ">
  264. <asp:Label ID="custom" Text="Get custom email & more with Gmail for work" runat="server" style="color:white; font-size:20pt" />
  265. </div>
  266. </div>
  267. </div>
  268.  
  269. <img src="images/2Top.PNG" style="width:1504px; right:75%" />
  270.  
  271. <footer class="footer">
  272. <div class="container">
  273. <ul class="social">
  274. <li class="nav-link"><a href="http://www.google.com" title="Contact" >Contact</a></li>
  275. <li><a href="https://www.facebook.com" target="_blank"><img src="images/fb.PNG" /></a></li>
  276. <li><a href="https://www.twitter.com" target="_blank"><img src="images/twitter.PNG" /></a></li>
  277. </ul>
  278. </div>
  279. </footer>
  280. </form>
  281. </body>
  282. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement