asp.net, move data to and from a sql server database

28

Upload: christopher-singleton

Post on 06-Jan-2017

101 views

Category:

Data & Analytics


2 download

TRANSCRIPT

Christopher
Typewritten Text
Programmed By: Christopher Singleton ASP.Net, HTML, C# Date: 06/14/2016
Christopher
Typewritten Text
User (Logged-In)
Christopher
Typewritten Text
User (Not Logged-In)
Christopher
Typewritten Text
Purpose: Create an ASP.Net application web page ***User can Log-In (Update Log-In) ***User can create products. ***User can send purchase emails. Note: Display of information during process.
Christopher
Typewritten Text
Page 1
Christopher
Typewritten Text
Create Log-In Show Newly Created Log-In
Christopher
Typewritten Text
Update Log-In Show Updated Log-In
Christopher
Typewritten Text
Log-In in the SQL Database (Shown Below)
Christopher
Typewritten Text
Page 2
Christopher
Typewritten Text
Create the Products in the SQL Database.
Christopher
Typewritten Text
Show the Products created.
Christopher
Line
Christopher
Callout
Product Clicked On (Link to Product)
Christopher
Typewritten Text
Page 3
Christopher
Callout
Allow the User to Email a Receipt.
Christopher
Line
Christopher
Typewritten Text
Page 4

<?xml version="1.0" encoding="utf-8"?> <!--For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=169433--> <configuration> <system.web> <compilation debug="true" targetFramework="4.5.2"/> <httpRuntime targetFramework="4.5.2"/> </system.web> <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/> </compilers> </system.codedom> <appSettings> <add key="connectionstring" value="Server=ServerName\SQLServerInstance; Database=PROG117DB; User Id=PROG117_web_user; Password=abc123; Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;"/> <add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/> </appSettings> </configuration> <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="PCPartsSuperStore.Master" %> <!DOCTYPE html> <meta charset="UTF-8"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>PC Super Store</title> <asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder> <link href="CSS/MasterStyle.css" rel="stylesheet" /> </head> <body> <%--Header--%> <div id="header" runat="server"> <div class="HeaderText" style="text-align: center" runat="server" > <asp:Label ID="lbl_HeaderText" Cssclass="LabelHeaderText" runat="server" >Advanced Computer Systems Company</asp:Label><br /> <asp:Label ID="lbl_SubHeaderText" CssClass="SubHeaderTxt" runat="server" > "Where the future of innovations are yours!"</asp:Label> </div> </div> <%--Navigation--%> <div id="Navigation" runat="server"> <asp:HyperLink ID="newProducts" Cssclass="MasterLinks" runat="server" NavigateUrl ="~/productManagement/newProduct.aspx" ToolTip="New Products" Text="New Products" ></asp:HyperLink><br /><br />

Christopher
Typewritten Text
Master Page ASPX
Christopher
Typewritten Text
Web Config File (SQL Database Connection)
Christopher
Typewritten Text
Page 5

<asp:HyperLink ID="Products" Cssclass="MasterLinks" runat="server" NavigateUrl ="~/shopping/showAllProducts.aspx" ToolTip="Products">Products</asp:HyperLink><br /><br /> <asp:HyperLink ID="Sale" Cssclass="MasterLinks" runat="server" ToolTip="Sale">Sale</asp:HyperLink><br /><br /> <asp:HyperLink ID="Featured" Cssclass="MasterLinks" runat="server" ToolTip="Featured">Featured</asp:HyperLink><br /> </div> <%--Main Content--%> <div id="Main" runat="server"> <asp:ContentPlaceHolder ID="cpd_Main" runat="server"> </asp:ContentPlaceHolder> </div> <%--footer--%> <div id="footer" runat="server"> <div class="footerText"> <h3 class="footer"><strong>Advanced Computer Systems Company &nbsp; <a href="mailto:[email protected]">Contact: Send an Email</a> <span class="rights">&copy;All Rights Reserved 2016</span></strong></h3> </div> </div> </body> </html> <%@ Page Title="PC Super Store" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="PCPartsSuperStore.index" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpd_Main" runat="server"> <asp:Label ID="lbl_WelcomeUser" CssClass="WelcomeUser" runat="server" ></asp:Label> <form id="formLogIn" runat="server" defaultfocus="txb_SignInUName"> <div class="SignInPos" runat="server"> <asp:TextBox ID="txb_SignInUName" Cssclass="BoxStyleLogIn" placeholder="User Name" runat ="server" required ="required" ></asp:TextBox><br /> <asp:TextBox ID="txb_SignInPWord" Cssclass="BoxStyleLogIn" placeholder="Password" runat ="server" required ="required" ></asp:TextBox><br /> <asp:Button ID="submitButton" Cssclass="submitButtonLogIn" runat="server" Text ="Submit" OnClick="submitButton_Click" /> </div> </form> <asp:HyperLink ID="SignUp" Cssclass="SignUp" runat="server" Target="_blank" NavigateUrl="~/userManagement/MakeUserLogIn.aspx" > Sign up</asp:HyperLink> <asp:HyperLink ID="UpdateUserInfo" Cssclass="UpdateUserInfo" runat="server" Target="_blank" NavigateUrl="~/userManagement/UpdateUserLogIn.aspx" >Update Log-In</asp:HyperLink> </asp:Content> using System; using System.Configuration; using System.Data.SqlClient; namespace PCPartsSuperStore { public partial class index : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e)

Christopher
Typewritten Text
Master Page ASPX (Continued)
Christopher
Typewritten Text
Index Page (C#)
Christopher
Typewritten Text
Index page ASPX (HTML)
Christopher
Typewritten Text
Page 6

{ //Don't allow the user to update any info until log-in. UpdateUserInfo.Visible = false; } protected void submitButton_Click(object sender, System.EventArgs e) { //Pass the user's textbox inputs into variables. string uName = Request.Form["ctl00$cpd_Main$txb_SignInUName"]; string pass = Request.Form["ctl00$cpd_Main$txb_SignInPWord"]; /*1. Open a connection using the connection string in the Web.config file under AppSettings.*/ string connStr = ConfigurationManager.AppSettings["connectionString"]; SqlConnection conn = new SqlConnection(connStr); conn.Open(); /* 2. Create a command that gets the firstName from the database using a where clause from the user input using the SQL Server Database. Then define the query with the connection.*/ string query = "SELECT [firstName], [id] FROM [dbo].[person]" + "WHERE userName = '" + uName + "' AND password = '" + pass + "'"; SqlCommand cmd = new SqlCommand(query); cmd.CommandType = System.Data.CommandType.Text; cmd.Connection = conn; /* 3. Create a reader, read the firstName and id into the variables as a string, then pass the variables into session variables. Finally, display output to the label or textbox and hide the Log-In form.*/ SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { string strfName = reader["firstName"].ToString(); string strID = reader["id"].ToString(); Session["firstName"] = strfName; Session["userID"] = strID; lbl_WelcomeUser.Text = "<spanIndex>Welcome</spanIndex> " + strfName + "<spanIndex>!</spanIndex>"; Form.Visible = false; SignUp.Visible = false; UpdateUserInfo.Visible = true; } else { txb_SignInUName.Text = "Log-In Failed!"; SignUp.Visible = true; UpdateUserInfo.Visible = false; } //4. Close the connection. conn.Close(); } } }

Christopher
Typewritten Text
Index Page (C# Continued)
Christopher
Typewritten Text
Page 7

<%@ Page Title="Create Log-In" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="MakeUserLogIn.aspx.cs" Inherits="PCPartsSuperStore.userManagement.MakeUserLogIn" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpd_Main" runat="server"> <form id="formMULI" class="form" method="post" action="SecondPage.aspx" runat="server" defaultfocus="txb_FName" > <!-- Display objects for input/output --> <fieldset class="fieldsetMULI"> <legend class="LegendMULI">Create Log-In</legend> <!-- flexbox both the textbox and labels together side by side --> <div class="flexTBoxesWrapper"> <div class="flexText"> <asp:Label ID="lbl1_FName" Cssclass="LabelStyleMULI" runat="server" >First Name:</asp:Label><br /> <asp:Label ID="lbl1_LName" Cssclass="LabelStyleMULI" runat="server" >Last Name:</asp:Label><br /> <asp:Label ID="lbl1_UserName" Cssclass="LabelStyleMULI" runat="server" >User Name:</asp:Label><br /> <asp:Label ID="lbl1_Password" Cssclass="LabelStyleMULI" runat="server" >Password:</asp:Label><br /> <asp:Label ID="lbl1_Address" Cssclass="LabelStyleMULI" runat="server" >Address:</asp:Label><br /> <asp:Label ID="lbl1_Email" Cssclass="LabelStyleMULI" runat="server" >Email:</asp:Label><br /> <asp:Label ID="lbl1_PhoneNumber" Cssclass="LabelStyleMULI" runat="server" >Phone Number:</asp:Label> </div> <!-- Allow user input into the textboxes --> <div class="flexTextBoxes"> <div id="FName"><asp:TextBox ID="txb_FName" Cssclass="BoxStyleMULI" placeholder="First Name" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="LName"><asp:TextBox ID="txb_LName" Cssclass="BoxStyleMULI" placeholder="Last Name" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="UName"><asp:TextBox ID="txb_UserName" Cssclass="BoxStyleMULI" placeholder="User Name" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="Pword"><asp:TextBox ID="txb_Password" Cssclass="BoxStyleMULI" placeholder="Password" runat ="server" required ="true" ></asp:TextBox><br /></div> <div id="Address"><asp:TextBox ID="txb_Address" Cssclass="BoxStyleMULI" placeholder="Address" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="Email"><asp:TextBox ID="txb_Email" Csstype="email" Cssclass="BoxStyleMULI" placeholder="Email" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="PNumber"><asp:TextBox ID="txb_PhoneNumber" Cssclass="BoxStyleMULI" placeholder="Phone Number" runat ="server" required ="required" ></asp:TextBox></div> </div> </div> <!-- User submits the input to the next page --> <asp:Button ID="submitButton" Cssclass="submitButton" runat="server" Text ="Submit" OnClientClick="form.target ='_blank';" PostBackUrl="~/userManagement/ShowUserLogInInfo.aspx" /> </fieldset> </form> </asp:Content>

Christopher
Typewritten Text
Create User Log-In ASPX (HTML)
Christopher
Typewritten Text
Page 8

<%@ Page Title="Show Log-In" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="ShowUserLogInInfo.aspx.cs" Inherits="PCPartsSuperStore.userManagement.ShowUserLogInInfo" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpd_Main" runat="server"> <form id="formSULII" runat="server"> <fieldset class="fieldset1SULII"> <legend class="legendSULII">Newly Created Log-In Data</legend> <!-- Labels to display the hard coded text using flexbox side by side again --> <div class="flexLabelsWrapper"> <div class="flexTextLabels"> <asp:Label ID="lbl_FName" CSSclass="TextLabelsSULII" runat="server" >First Name:</asp:Label><br /> <asp:Label ID="lbl_LName" CSSclass="TextLabelsSULII" runat="server" >Last Name:</asp:Label><br /> <asp:Label ID="lbl_UserName" CSSclass="TextLabelsSULII" runat="server" >User Name:</asp:Label><br /> <asp:Label ID="lbl_Password" CSSclass="TextLabelsSULII" runat="server" >Password:</asp:Label><br /> <asp:Label ID="lbl_Address" CSSclass="TextLabelsSULII" runat="server" >Address:</asp:Label><br /> <asp:Label ID="lbl_Email" CSSclass="TextLabelsSULII" runat="server" >Email:</asp:Label><br /> <asp:Label ID="lbl_PhoneNumber" CSSclass="TextLabelsSULII" runat="server" >Phone Number:</asp:Label> </div> <!-- Use label ID to display the information being passed, Display in the label --> <div class="flexPassedText"> <asp:Label ID="lbl2_fName" Cssclass="ResultTextStyleSULII" runat="server" ></asp:Label><br /> <asp:Label ID="lbl2_LName" Cssclass="ResultTextStyleSULII" runat="server" ></asp:Label><br /> <asp:Label ID="lbl2_UserName" Cssclass="ResultTextStyleSULII" runat="server" ></asp:Label><br /> <asp:Label ID="lbl2_Password" Cssclass="ResultTextStyleSULII" runat="server" ></asp:Label><br /> <asp:Label ID="lbl2_Address" Cssclass="ResultTextStyleSULII" runat="server" ></asp:Label><br /> <asp:Label ID="lbl2_Email" Cssclass="ResultTextStyleSULII" runat="server" ></asp:Label><br /> <asp:Label ID="lbl2_PhoneNumber" Cssclass="ResultTextStyleSULII" runat="server" ></asp:Label><br /> </div> </div> </fieldset> <fieldset class="fieldset2SULII"> <legend class="legendSULII">Capture Row ID</legend> <asp:Label ID="lbl_Identity" Cssclass="ResultTextStyleSULII" runat="server" ></asp:Label><br /> <asp:HyperLink ID="UpdateLogIn" runat="server" Target="_blank" NavigateUrl="~/userManagement/UpdateUserLogIn.aspx"> Update User Info</asp:HyperLink> </fieldset> </form> </asp:Content>

Christopher
Typewritten Text
Show User Log-In ASPX (HTML)
Christopher
Typewritten Text
Page 9

using System; using System.Configuration; using System.Data.SqlClient; namespace PCPartsSuperStore.userManagement { public partial class ShowUserLogInInfo : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Pass the information from the text box to the variable. string fName = Request.Form["ctl00$cpd_Main$txb_FName"]; string lName = Request.Form["ctl00$cpd_Main$txb_LName"]; string uName = Request.Form["ctl00$cpd_Main$txb_UserName"]; string pWord = Request.Form["ctl00$cpd_Main$txb_Password"]; string address = Request.Form["ctl00$cpd_Main$txb_Address"]; string email = Request.Form["ctl00$cpd_Main$txb_Email"]; string phone = Request.Form["ctl00$cpd_Main$txb_PhoneNumber"]; //Note: Request.Form["ctl00$cpd_main$txtBox"] instead of Request.Form["txtBox"] because of Master Page. //Define the label object to display what is in the variable. lbl2_fName.Text = fName; lbl2_LName.Text = lName; lbl2_UserName.Text = uName; lbl2_Password.Text = pWord; lbl2_Address.Text = address; lbl2_Email.Text = email; lbl2_PhoneNumber.Text = phone; /*1. Open a connection using the connection string in the Web.config file under AppSettings.*/ string connStr = ConfigurationManager.AppSettings["connectionString"]; SqlConnection conn = new SqlConnection(connStr); conn.Open(); /* 2. Create a command that inserts the data into the SQL Database using variables with values that shows as text in the labels.*/ string query = ("INSERT INTO [dbo].[person]([firstName],[lastName],[userName]" + ",[password],[address],[email],[phone]) VALUES (" + " '" + fName + "'," + " '" + lName + "'," + " '" + uName + "'," + " '" + pWord + "'," + " '" + address + "'," + " '" + email + "'," + " '" + phone + "') SELECT SCOPE_IDENTITY(); "); SqlCommand cmd = new SqlCommand(query); cmd.CommandType = System.Data.CommandType.Text; cmd.Connection = conn; /* 3. Create a reader to read back the identity information, then close the connection after reading the column id into a variable.*/ SqlDataReader reader = cmd.ExecuteReader(); reader.Read(); string id = reader[0].ToString(); conn.Close(); //Take the id value and place it into text inside the label. lbl_Identity.Text = "Dataset Created, Line ID: " + "<span>" + id + "</span>"; //Pass the Session Variable to the UpdateLogIn Page (Third Page). Session["userID"] = id; } } }

Christopher
Typewritten Text
Show User Log-In (C#)
Christopher
Typewritten Text
Page 10

<%@ Page Title="Update Log-In" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="UpdateUserLogIn.aspx.cs" Inherits="PCPartsSuperStore.userManagement.UpdateUserLogIn" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpd_Main" runat="server"> <form id="formUULI" class="form" method="post" action="SecondPage.aspx" runat="server" defaultfocus="txbUpD_FName"> <!-- Display objects for input/output --> <asp:Label ID="lbl_Directions" Cssclass="LabelStyleUULI" runat="server" >Please put in a new "User Name" and "Email":</asp:Label><br /> <fieldset ID="fieldsetUULI"> <legend id="legendUULI" class="legendUULI">Update Log-In Information</legend> <!-- flexbox both the textbox and labels together side by side --> <div class="flexTBoxesWrapper"> <div class="flexText"> <asp:Label ID="lbl1_FName" Cssclass="LabelStyleUULI" runat="server" >First Name:</asp:Label><br /> <asp:Label ID="lbl1_LName" Cssclass="LabelStyleUULI" runat="server" >Last Name:</asp:Label><br /> <asp:Label ID="lbl1_UserName" Cssclass="LabelStyleUULI" runat="server" >User Name:</asp:Label><br /> <asp:Label ID="lbl1_Password" Cssclass="LabelStyleUULI" runat="server" >Password:</asp:Label><br /> <asp:Label ID="lbl1_Address" Cssclass="LabelStyleUULI" runat="server" >Address:</asp:Label><br /> <asp:Label ID="lbl1_Email" Cssclass="LabelStyleUULI" runat="server" >Email:</asp:Label><br /> <asp:Label ID="lbl1_PhoneNumber" Cssclass="LabelStyleUULI" runat="server" >Phone Number:</asp:Label> </div> <!-- Allow user input into the textboxes --> <div class="flexTextBoxes"> <div id="FName"><asp:TextBox ID="txbUpD_FName" Cssclass="BoxStyleUULI" placeholder="First Name" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="LName"><asp:TextBox ID="txbUpD_LName" Cssclass="BoxStyleUULI" placeholder="Last Name" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="UName"><asp:TextBox ID="txbUpD_UserName" Cssclass="BoxStyleUULI" placeholder="User Name" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="Pword"><asp:TextBox ID="txbUpD_Password" Cssclass="BoxStyleUULI" placeholder="Password" runat ="server" required ="true" ></asp:TextBox><br /></div> <div id="Address"><asp:TextBox ID="txbUpD_Address" Cssclass="BoxStyleUULI" placeholder="Address" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="Email"><asp:TextBox ID="txbUpD_Email" Csstype="email" Cssclass="BoxStyleUULI" placeholder="Email" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="PNumber"><asp:TextBox ID="txbUpD_PhoneNumber" Cssclass="BoxStyleUULI" placeholder="Phone Number" runat ="server" required ="required" ></asp:TextBox></div> </div> </div> <!-- User submits the input to the next page --> <asp:Button ID="submitButton" Cssclass="submitButton" runat="server" Text ="Submit" OnClientClick="form.target ='_blank';" PostBackUrl="~/userManagement/UserUpdatedShowInfo.aspx" /> </fieldset> </form> </asp:Content>

Christopher
Typewritten Text
Update Log-In ASPX (HTML)
Christopher
Typewritten Text
Page 11

using System; using System.Configuration; using System.Data.SqlClient; namespace PCPartsSuperStore.userManagement { public partial class UpdateUserLogIn : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { /*1. Get the Session User ID.*/ string id = Session["userID"].ToString(); /*2. Open a connection using the connection string in the Web.config file under AppSettings.*/ string connStr = ConfigurationManager.AppSettings["connectionString"]; SqlConnection conn = new SqlConnection(connStr); conn.Open(); /* 3. Create a command that Selects all the data from the id row SQL Database using the where clause in showing what row to select by using what is stored in the id variable.*/ string query = "SELECT * FROM [dbo].[person] WHERE id = " + id; SqlCommand cmd = new SqlCommand(query); cmd.CommandType = System.Data.CommandType.Text; cmd.Connection = conn; /* 4 Create a reader to read the line in the SQL database into the text boxes*/ SqlDataReader reader = cmd.ExecuteReader(); reader.Read(); /* 5. Show the info in the textboxes that need updating.*/ string fName = reader["firstName"].ToString(); string lName = reader["lastName"].ToString(); string uName = reader["userName"].ToString(); string pWord = reader["password"].ToString(); string address = reader["address"].ToString(); string email = reader["email"].ToString(); string phone = reader["phone"].ToString(); // 6. Close the connection. conn.Close(); // 7. Show the variable information inside the text boxes. txbUpD_FName.Text = fName; txbUpD_LName.Text = lName; txbUpD_UserName.Text = uName; txbUpD_Password.Text = pWord; txbUpD_Address.Text = address; txbUpD_Email.Text = email; txbUpD_PhoneNumber.Text = phone; } } } }

Christopher
Typewritten Text
Update Log-In (C#)
Christopher
Typewritten Text
Page 12

<%@ Page Title="Updated Log-In Info" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="UserUpdatedShowInfo.aspx.cs" Inherits="PCPartsSuperStore.userManagement.UserUpdatedShowInfo" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpd_Main" runat="server"> <form id="formUUSI" class="form" runat="server"> <fieldset id="fieldset1UUSI" class="fieldset1UUSI"> <legend id="legend1UUSI" class="legendUUSI">Show Updated Log-In Information</legend> <!-- Labels to display the hard coded text using flexbox side by side again --> <div class="flexLabelsWrapper"> <div class="flexTextLabels"> <asp:Label ID="lbl2_FName" CSSclass="TextLabelsUUSI" runat="server" >First Name:</asp:Label><br /> <asp:Label ID="lbl2_LName" CSSclass="TextLabelsUUSI" runat="server" >Last Name:</asp:Label><br /> <asp:Label ID="lbl2_UserName" CSSclass="TextLabelsUUSI" runat="server" >User Name:</asp:Label><br /> <asp:Label ID="lbl2_Password" CSSclass="TextLabelsUUSI" runat="server" >Password:</asp:Label><br /> <asp:Label ID="lbl2_Address" CSSclass="TextLabelsUUSI" runat="server" >Address:</asp:Label><br /> <asp:Label ID="lbl2_Email" CSSclass="TextLabelsUUSI" runat="server" >Email:</asp:Label><br /> <asp:Label ID="lbl2_PhoneNumber" CSSclass="TextLabelsUUSI" runat="server" >Phone Number:</asp:Label> </div> <!-- Use label ID to display the information being passed, Display in the label --> <div class="flexPassedText"> <asp:Label ID="lbl_fName" Cssclass="ResultTextStyleUUSI" runat="server" ></asp:Label><br /> <asp:Label ID="lbl_LName" Cssclass="ResultTextStyleUUSI" runat="server" ></asp:Label><br /> <asp:Label ID="lbl_UserName" Cssclass="ResultTextStyleUUSI" runat="server" ></asp:Label><br /> <asp:Label ID="lbl_Password" Cssclass="ResultTextStyleUUSI" runat="server" ></asp:Label><br /> <asp:Label ID="lbl_Address" Cssclass="ResultTextStyleUUSI" runat="server" ></asp:Label><br /> <asp:Label ID="lbl_Email" Cssclass="ResultTextStyleUUSI" runat="server" ></asp:Label><br /> <asp:Label ID="lbl_PhoneNumber" Cssclass="ResultTextStyleUUSI" runat="server" ></asp:Label><br /> </div> </div> </fieldset> <fieldset id="fieldset2UUSI" class="fieldset2UUSI"> <legend id="legend2UUSI" class="legendUUSI">Capture Row ID</legend> <asp:Label ID="lbl_Identity" Cssclass="ResultTextStyleUUSI" runat="server" ></asp:Label><br /> </fieldset> </form> </asp:Content>

Christopher
Typewritten Text
Updated Log-In Info ASPX (HTML)
Christopher
Typewritten Text
Page 13

using System; using System.Configuration; using System.Data.SqlClient; namespace PCPartsSuperStore.userManagement { public partial class UserUpdatedShowInfo : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Create the Variable for the Session. string id = Session["userID"].ToString(); //Pass the information from the text box to the variable. string strfName = Request.Form["ctl00$cpd_Main$txbUpD_FName"]; string strlName = Request.Form["ctl00$cpd_Main$txbUpD_LName"]; string struName = Request.Form["ctl00$cpd_Main$txbUpD_UserName"]; string strpWord = Request.Form["ctl00$cpd_Main$txbUpD_Password"]; string strAddress = Request.Form["ctl00$cpd_Main$txbUpD_Address"]; string strEmail = Request.Form["ctl00$cpd_Main$txbUpD_Email"]; string strPhone = Request.Form["ctl00$cpd_Main$txbUpD_PhoneNumber"]; //Define the label object to display what is in the variable. lbl_fName.Text = strfName; lbl_LName.Text = strlName; lbl_UserName.Text = struName; lbl_Password.Text = strpWord; lbl_Address.Text = strAddress; lbl_Email.Text = strEmail; lbl_PhoneNumber.Text = strPhone; /*1. Open a connection using the connection string in the Web.config file under AppSettings.*/ string connStr = ConfigurationManager.AppSettings["connectionString"]; SqlConnection conn = new SqlConnection(connStr); conn.Open(); /* 2. Create a command that updates the data into the SQL Database using variables with values that shows as text in the labels.*/ string query = "UPDATE [dbo].[person] SET" + "[firstName]= '" + strfName + "'," + "[lastName]= '" + strlName + "'," + "[userName]= '" + struName + "'," + "[password]= '" + strpWord + "'," + "[address]= '" + strAddress + "'," + "[email]= '" + strEmail + "'," + "[phone]= '" + strPhone + "' WHERE id =" + id; SqlCommand cmd = new SqlCommand(query); cmd.CommandType = System.Data.CommandType.Text; cmd.Connection = conn; /* 3. Create a reader to read back the identity information, then close the connection after reading the column id into a variable.*/ SqlDataReader reader = cmd.ExecuteReader(); reader.Read(); conn.Close(); //Take the id value and place it into text inside the label. lbl_Identity.Text = "Dataset Updated, Line ID: " + "<spanUUSI>" + id + "</spanUUSI>"; } } }

Christopher
Typewritten Text
Updated Log-In Info (C#)
Christopher
Typewritten Text
Page 14

<%@ Page Title="Create Products" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="newProduct.aspx.cs" Inherits="PCPartsSuperStore.productManagement.newProduct" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpd_Main" runat="server"> <asp:HyperLink ID="UpdateUserInfo" Cssclass="UpdateUserInfoNP" runat="server" Target="_blank" NavigateUrl="~/userManagement/UpdateUserLogIn.aspx" >Update Log-In</asp:HyperLink> <form id="formNP" class="form" method="post" runat="server" defaultfocus="txb_prodName" > <!-- Display objects for input/output --> <fieldset id="fieldset1NP" class="fieldset1NP"> <legend id="legendNP" class="legendNP">Create New Product</legend> <!-- flexbox both the textbox and labels together side by side --> <div class="flexTBoxesWrapper"> <div class="flexText"> <asp:Label ID="lbl1_prodName" Cssclass="LabelStyleNP" runat="server" >Product Name:</asp:Label><br /> <asp:Label ID="lbl1_prodDesc" Cssclass="LabelStyleNP" runat="server" >Product Description:</asp:Label><br /> <asp:Label ID="lbl1_prodPrice" Cssclass="LabelStyleNP" runat="server" >Product Price:</asp:Label><br /> <asp:Label ID="lbl1_prodAmount" Cssclass="LabelStyleNP" runat="server" >Product Amount:</asp:Label> </div> <!-- Allow user input into the textboxes and validate as needed. --> <div class="flexTextBoxes"> <div id="pName"><asp:TextBox ID="txb_prodName" Cssclass="BoxStyleNP" placeholder="Product Name" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="pDesc"><asp:TextBox ID="txb_prodDesc" Cssclass="BoxStyleNP" placeholder="Product Description" runat ="server" required ="required" ></asp:TextBox><br /></div> <div id="pPrice"><asp:TextBox ID="txb_prodPrice" Cssclass="BoxStyleNP" placeholder="Product Price" runat ="server" required ="required" ></asp:TextBox> <asp:RegularExpressionValidator runat="server" ControlToValidate="txb_prodPrice" ErrorMessage="*Not a valid price!" ValidationExpression="[+]?([.]\d+|\d+([.]\d+)?)$" ></asp:RegularExpressionValidator> <br /> </div> <div id="pAmount"> <asp:TextBox ID="txb_prodAmount" Cssclass="BoxStyleNP" placeholder="Product Amount" runat ="server" required ="true" ></asp:TextBox> <asp:RegularExpressionValidator runat="server" ControlToValidate="txb_prodAmount" ErrorMessage="*Only positive numbers!" ValidationExpression="^[1-9]\d*$" ></asp:RegularExpressionValidator> </div> </div> </div><br /> <asp:Label ID="lbl_Identity" Cssclass="ResultTextStyleNP" runat="server" ></asp:Label><br /> <!-- User submits the input to the next page --> <asp:Button ID="submitButton" Cssclass="submitButton" runat="server" Text ="Submit" OnClick="submitButton_Click" PostBackUrl="~/productManagement/newProduct.aspx"/> </fieldset> </form> </asp:Content>

Christopher
Typewritten Text
Create Products ASPX (HTML)
Christopher
Typewritten Text
Page 15

using System; using System.Configuration; using System.Data.SqlClient; namespace PCPartsSuperStore.productManagement { public partial class newProduct : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Check if the user is logged in. if (Session["userID"] == null) { Response.Redirect("~/index.aspx"); } } protected void submitButton_Click(object sender, System.EventArgs e) { //Get the values from the user's product input boxes. string prodName = txb_prodName.Text; string prodDesc = txb_prodDesc.Text; string prodPrice = txb_prodPrice.Text; string prodAmount = txb_prodAmount.Text; /*1. Open a connection using the connection string in the Web.config file under AppSettings.*/ string connStr = ConfigurationManager.AppSettings["connectionString"]; SqlConnection conn = new SqlConnection(connStr); conn.Open(); //Create a query. /* 2. Create a command that inserts the data into the SQL Database using variables with values that shows as text in the labels.*/ string query = ("INSERT INTO [dbo].[products]([productName],[description],[price]" + ",[currentAmount]) VALUES (" + " '" + prodName + "'," + " '" + prodDesc + "'," + " '" + prodPrice + "'," + " '" + prodAmount + "') SELECT SCOPE_IDENTITY(); "); SqlCommand cmd = new SqlCommand(query); cmd.CommandType = System.Data.CommandType.Text; cmd.Connection = conn; /* 3. Create a reader to read back the identity information, then close the connection after reading the column id into a variable.*/ SqlDataReader reader = cmd.ExecuteReader(); reader.Read(); string pid = reader[0].ToString(); conn.Close(); //Take the id value and place it into text inside the label. lbl_Identity.Text = "Product: " + prodName + " created, Line ID: " + "<span>" + pid + "</span>"; //Clear the text boxes for the next input. txb_prodName.Text = ""; txb_prodDesc.Text = ""; txb_prodPrice.Text = ""; txb_prodAmount.Text = ""; } } }

Christopher
Typewritten Text
Create Products (C#)
Christopher
Typewritten Text
Page 16

<%@ Page Title="Available Products" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="showAllProducts.aspx.cs" Inherits="PCPartsSuperStore.shopping.showAllProducts" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpd_Main" runat="server"> <asp:HyperLink ID="UpdateUserInfo" Cssclass="UpdateUserInfoAP" runat="server" Target="_blank" NavigateUrl="~/userManagement/UpdateUserLogIn.aspx" >Update Log-In</asp:HyperLink> <form id="formSAP" class="formSAP" method="post" runat="server" defaultfocus="prodName" > <!-- Display objects for input/output --> <fieldset id="fieldsetSAP" class="fieldsetSAP"> <legend id="legendSAP" class="legendSAP">Add Products to Shopping Cart</legend> <!-- Show the table content --> <div class="div_products" runat="server"> <asp:Label ID="div_products" Cssclass="ResultTextStyleSAP" runat="server" ></asp:Label><br /> </div> <asp:Table runat="server" ID="tbl_Products"> <asp:TableRow> <asp:TableCell CssClass="headCells">Product</asp:TableCell> <asp:TableCell CssClass="headCellDesc">Description</asp:TableCell> <asp:TableCell CssClass="headCells">Price</asp:TableCell> <asp:TableCell CssClass="headCellBuyIt">Buy it</asp:TableCell> </asp:TableRow> </asp:Table> </fieldset> </form> </asp:Content> using System; using System.Configuration; using System.Data.SqlClient; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; namespace PCPartsSuperStore.shopping { public partial class showAllProducts : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Check if the user is logged in. if (Session["userID"] == null) { Response.Redirect("~/index.aspx"); } UpdateUserInfo.Visible = true; /*1. Open a connection using the connection string in the Web.config file under AppSettings.*/ string connStr = ConfigurationManager.AppSettings["connectionString"]; SqlConnection conn = new SqlConnection(connStr); conn.Open();

Christopher
Typewritten Text
Show All Products ASPX (HTML)
Christopher
Typewritten Text
Page 17

/* 2. Create a query that selects all the data from the SQL Database.*/ string query = ("SELECT * FROM [dbo].[products] WHERE currentAmount > 0"); SqlCommand cmd = new SqlCommand(query); cmd.CommandType = System.Data.CommandType.Text; cmd.Connection = conn; //Read from the Database all the data. SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { string prodID = reader["pid"].ToString(); string prodName = reader["productName"].ToString(); string prodDesc = reader["description"].ToString(); string prodPrice = reader["price"].ToString(); //Create a table row. TableRow tRow = new TableRow(); //Create a cell for the product name. TableCell tcProdName = new TableCell(); tcProdName.Attributes.Add("class", "cells"); tcProdName.Text = prodName; tRow.Cells.Add(tcProdName); //Create a cell for Description. TableCell tcProdDesc = new TableCell(); tcProdDesc.Attributes.Add("class", "cells"); tcProdDesc.Text = prodDesc; tRow.Cells.Add(tcProdDesc); //Create a cell for Price. TableCell tcProdPrice = new TableCell(); tcProdPrice.Attributes.Add("class", "cells"); tcProdPrice.Text = "$" + prodPrice; tRow.Cells.Add(tcProdPrice); //Create a link. HtmlAnchor link = new HtmlAnchor(); link.Attributes.Add("class", "cells"); link.HRef = "~/shopping/oneClickBuy.aspx?id=" + prodID; link.InnerText = "OneClick Buy"; //Create a cell for Links. TableCell tcBuy = new TableCell(); tcBuy.Attributes.Add("class", "cells"); tcBuy.Controls.Add(link); tRow.Cells.Add(tcBuy); //Add the Row to the Table. tbl_Products.Rows.Add(tRow); } //Close the connection. conn.Close(); } } }

Christopher
Typewritten Text
Show All Products (C#)
Christopher
Typewritten Text
Page 18

<%@ Page Title="One Click Buy" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="oneClickBuy.aspx.cs" Inherits="PCPartsSuperStore.shopping.oneClickBuy" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpd_Main" runat="server"> <asp:HyperLink ID="UpdateUserInfoOCB" Cssclass="UpdateUserInfoOCB" runat="server" Target="_blank" NavigateUrl="~/userManagement/UpdateUserLogIn.aspx" >Update Log-In</asp:HyperLink> <form id="formOCB" class="form" method="post" runat="server" defaultfocus="prodName" > <!-- Display objects for input/output --> <fieldset class="fieldsetOCB"> <legend id="legendOCB">Thank You for Purchasing</legend> <!-- Show the Thank You Message in the div. --> <div id="div_purchase" runat="server"> </div> </fieldset> <asp:Button ID="submitButton" Cssclass="submitButton" runat="server" Text ="Email Receipt" OnClientClick="form.target ='_blank';" PostBackUrl="~/WebEmail/WebMail.aspx" /> </form> </asp:Content> using System; using System.Configuration; using System.Data.SqlClient; namespace PCPartsSuperStore.shopping { public partial class oneClickBuy : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Check if the user is logged in. if (Session["userID"] == null) { Response.Redirect("~/index.aspx"); } //Pass the Session userID to id when querying for the user. string id = Session["userID"].ToString(); //Allow the user to update their info. UpdateUserInfoOCB.Visible = true; //Get the product from the query string. string productID = Request.QueryString["id"].ToString(); /*1. Open a connection using the connection string in the Web.config file under AppSettings.*/ string connStr = ConfigurationManager.AppSettings["connectionString"]; SqlConnection conn = new SqlConnection(connStr); conn.Open();

Christopher
Typewritten Text
One Click Buy ASPX (HTML)
Christopher
Typewritten Text
One Click Buy (C#)
Christopher
Typewritten Text
Page 19

/*2. Get the product information using a query string.*/ string query = ("SELECT * FROM [dbo].[products] WHERE pid =" + productID); SqlCommand cmd = new SqlCommand(query); cmd.CommandType = System.Data.CommandType.Text; cmd.Connection = conn; /*3. Read from the Database the Product Name and Product Price data that you selected in the query with the pid that was filtered after opening the new defined reader. Then close the reader to re-use it again.*/ SqlDataReader reader = cmd.ExecuteReader(); reader.Read(); string prodName = reader["productName"].ToString(); string prodPrice = reader["price"].ToString(); reader.Close(); /*4. Create a query with the user's First Name and Address based on the user already logged on. Then execute and read the reader once again from the database. After that close the reader. Note: Do Not Close the Connection (Connection still open).*/ cmd.CommandText = "SELECT * FROM person WHERE id =" +id; reader = cmd.ExecuteReader(); reader.Read(); string custName = reader["firstName"].ToString(); string custAddress = reader["address"].ToString(); string custEmail = reader["email"].ToString(); reader.Close(); /*5. Decrease the product from the selected pid (Product ID). Then Close the Connection and display the thank you message.*/ cmd.CommandText = "UPDATE products SET currentAmount = (currentAmount-1)" + " where pid =" + productID; cmd.ExecuteNonQuery(); conn.Close(); //create a sesssion with info for emailing the customer. Session["custName"] = custName; Session["prodName"] = prodName; Session["prodPrice"] = prodPrice; Session["custAddress"] = custAddress; //Send the customer's email info to the WebMail page. Session["email"] = custEmail; //Say thank you message and let the customer know about your interest in their purchase. div_purchase.InnerHtml = "Hi <spanOCB><b>" + custName + "</b></spanOCB>," + "<br/>Thank's for buying a <spanOCB><b>" + prodName + "</b></spanOCB>. Your " + "credit card will be charged <spanOCB><b>$" + prodPrice + "</b></spanOCB> and your" + " purchase will be shipped to <spanOCB><b>" + custAddress + "</b></spanOCB>." + " Thanks for shopping with us. Come back soon. We like your money."; } } }

Christopher
Typewritten Text
One Click Buy (C# Continued)
Christopher
Typewritten Text
Page 20

<%@ Page Title="Email Customer" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="WebMail.aspx.cs" Inherits="PCPartsSuperStore.WebEmail.WebMail1" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpd_Main" runat="server"> <form id="formWebMail" class="formWebMail" method="post" runat="server" defaultfocus="prodName" > <fieldset class="WebMailHeader"> <legend class="legendWM">Please check your email:</legend> <!-- Wrap the labels together --> <div class="flexLabelsWrapper"> <div id="lbl_Email"> <asp:Label ID="lbl_WMText" CSSclass="lbl_WMText" runat="server" >Email Address:</asp:Label> </div> <div id="EmailAddress" class="EmailAddress" runat="server"> <asp:Label ID="lbl_WMAddress" CSSclass="WMAddress" runat="server" ></asp:Label> </div> </div> </fieldset> <!-- Display objects for input/output --> <fieldset class="fieldsetWebMail"> <legend id="legendWM" class="legendWM">Your reciept has been sent.</legend> <!-- Show the Thank You Message in the div. --> <div id="div_purchase" runat="server"> </div> </fieldset> </form> </asp:Content> using System; using System.Net; using System.Net.Mail; namespace PCPartsSuperStore.WebEmail { public partial class WebMail1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Check if the user is logged in. if (Session["userID"] == null) { Response.Redirect("~/index.aspx"); } /*1. Get the Session variables to display what is in the email.*/ string custName = (string)Session["custName"]; string prodName = (string)Session["prodName"]; string prodPrice = (string)Session["prodPrice"]; string custAddress = (string)Session["custAddress"];

Christopher
Typewritten Text
Email Customer ASPX (HTML)
Christopher
Typewritten Text
Email Customer (C#)
Christopher
Typewritten Text
Page 21

/***************************************************************/ /***** Automatically gets the "to" email from the database *****/ /***************************************************************/ //Note: Database email must be a true email address in sending. /*2. Get the Session variable for the customer email and display it in the label. Then use the text in the label to send to the customer.*/ string custEmail = (string)Session["email"]; lbl_WMAddress.Text = custEmail.ToString(); /*3. Define the header of the email being sent.*/ string subject = "Thank you for shopping! (Test Email)"; /*4. Use what is in the label as an email address of the user's email as a string and then define the body (message). */ string to = lbl_WMAddress.Text; /***************************************************************/ /***************************************************************/ //Display what will be in the body of the email. string body = "Hi <b>" + custName + "</ b >, <br/>Thank's for "+ "buying a <spanOCB><b>" + prodName + "</b></spanOCB>. Your credit card will be "+ "charged <spanOCB><b>$" + prodPrice + "</b></spanOCB> and your purchase will be shipped"+ " to <spanOCB><b>" + custAddress + "</b></spanOCB>."+ " Thanks for shopping with us. Come back soon. We like your money."; /*5. Create a MailMessage object.*/ MailMessage mail = new MailMessage(); /***************************************************************/ /************************* Sender's Email **********************/ /***************************************************************/ /*6. Define what email address with password your sending from. (Your own gmail credentials).*/ string senderEmail = "[email protected]"; string senderPasswd = "sendersgmailpassword"; // a valid password for the email above*/ /***************************************************************/ /***************************************************************/ /*7. Define the objects of the email and link them to the variables as objects.*/ mail.From = new MailAddress(senderEmail); mail.To.Add(to.ToString()); mail.Subject = subject; mail.Body = body; /*8. Allows HTML in the body.*/ mail.IsBodyHtml = true; //Note: Code to add attachements, but not needed in this case(reference). //mail.Attachments.Add(new Attachment("C:\\someFile.jpg")); /*9. SMTP Client for gmail only. Other emails will have different SMTP Client port numbers.*/ SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); //Port 587

Christopher
Typewritten Text
Email Customer (C# Continued)
Christopher
Typewritten Text
Page 22

/*10. Set the credentials and secure socket link.*/ smtp.Credentials = new NetworkCredential(senderEmail, senderPasswd); smtp.EnableSsl = true; /*11. Sends the email.*/ smtp.Send(mail); /*12. Display another message with the variables.*/ div_purchase.InnerHtml = "Hi <spanOCB><b>" + custName + "</b></spanOCB>," + "<br/>Thank's for buying a <spanOCB><b>" + prodName + "</b></spanOCB>. Your " + "credit card will be charged <spanOCB><b>$" + prodPrice + "</b></spanOCB> and your" + " purchase will be shipped to <spanOCB><b>" + custAddress + "</b></spanOCB>." + " Please check your email:<spanOCB><b> " + custEmail + " </spanOCB></b>for the receipt!"; } } } /****************************WebEMail**************************/ .WMAddress { margin-left: 5px; } .fieldsetWebMail { border-radius: 5px; width: 585px; height: auto; color: black; font-size: 21px; } .legendWM { font-size: 24px; color: darkgreen; font-weight: bold; } .formWebMail { background-color: #FAF0E6; font-family: Calibri, San-Serif, Helvetica; width: 625px; height: auto; border: 3px solid rgba(255,255,255,.8); border-style: outset; border-radius: 25px; margin: 25px auto; padding: 25px; } /****************************newProduct*************************/ #lbl1_prodDesc { position: relative; margin-right: 5px; } .UpdateUserInfoNP { position: absolute; font-size: 24px; margin-left: -155px; margin-top: 380px; color: darkblue; } .UpdateUserInfoNP:visited { color:mediumorchid; } .BoxStyleNP { height: 21px; width: 225px; margin-top: 4px; margin-left: 5px; color: red; border-color: rgba(0,0,139,.9); } .BoxStyleNP:hover { box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.05) inset, 0px 0px 8px rgba(82, 168, 236, 0.6); } #fieldset1NP { border-radius: 5px; width: 715px; height: 230px; font-weight: bold; color: #4682B4; font-size: 21px; } .flexTBoxesWrapper { position: relative; display: inline-flex; } .LabelStyleNP { position: relative; font-size: 25px; color: #4682B4; } #formNP { background-color: #FAF0E6; font-family: Calibri, San-Serif, Helvetica; width: 755px; height: 258px; border: 3px solid rgba(255,255,255,.8); border-style: outset; border-radius: 25px; margin: 25px auto; padding: 25px; }

Christopher
Typewritten Text
MasterStyle (CSS Style Sheet)
Christopher
Typewritten Text
Page 23

.legendNP { color: red; font-size: 25px; } span { color: darkblue; font-size: 25px; } .submitButton { position: relative; height: 28px; width: 125px; margin-top: 18px; margin-bottom: 8px; background: rgba(0,125,0,.9); margin-right: 20px; color: rgba(255,255,255,1); border-color: rgba(158,202,237,1); border-radius: 8px; box-shadow: 0 0 10px rgba(158,202,237,1); outline: none; cursor: pointer; } /**************************OneClickBuy*************************/ .UpdateUserInfoOCB { position: absolute; font-size: 24px; margin-left: -155px; margin-top: 380px; color: darkblue; } .UpdateUserInfoOCB:visited { color:mediumorchid; } .fieldsetOCB { border-radius: 5px; width: 585px; height: auto; color: black; font-size: 21px; } #legendOCB { font-size: 24px; color: darkgreen; font-weight: bold; } #formOCB { background-color: #FAF0E6; font-family: Calibri, San-Serif, Helvetica; width: 625px; height: auto; border: 3px solid rgba(255,255,255,.8); border-style: outset; border-radius: 25px; margin: 25px auto; padding: 25px; } spanOCB { font-size: 24px; color: cornflowerblue; font-weight: bold; } /*****************************showAllProducts*******************/ .UpdateUserInfoAP { position: absolute; font-size: 24px; margin-left: -155px; margin-top: 380px; color: darkblue; } .UpdateUserInfoAP:visited { color: mediumorchid; } #fieldsetSAP { border-radius: 5px; width: 785px; height: auto; font-weight: bold; color: #4682B4; font-size: 21px; } #formSAP { background-color: #FAF0E6; font-family: Calibri, San-Serif, Helvetica; width: 825px; height: auto; border: 3px solid rgba(255,255,255,.8); border-style: outset; border-radius: 25px; margin: 25px auto; padding: 25px; } .headCells { border: 1px solid white; background-color: darkolivegreen; color: darkseagreen; text-align: center; width: 150px; } .headCellDesc { border: 1px solid white; background-color: darkolivegreen; color: darkseagreen; text-align: center; width: 295px; } .headCellBuyIt { border: 1px solid white; background-color: darkolivegreen; color: darkseagreen; text-align: center; width: 165px; } .cells { border: 1px solid black; background-color: darkseagreen; padding: 10px; } .legendSAP { color: darkgreen; font-size: 25px; }

Christopher
Typewritten Text
Page 24

/********************************ShowUserLogInInfo*************************/ .fieldset2SULII { border-radius: 5px; color: #4682B4; font-weight: bold; font-size: 21px; margin-left: 8px; width: 495px; } spanSULII { color: red; font-weight: bold; font-size: 21px; } .ResultTextStyleSULII { position: relative; color: red; } #lbl_Identity { color: #4682B4; } .fieldset1SULII { border-radius: 5px; width: 595px; height: 225px; font-weight: bold; color: #4682B4; font-size: 21px; margin-left: 8px; } #formSULII { background-color: #FAF0E6; font-family: Calibri, San-Serif, Helvetica; width: 645px; height: 365px; border: 3px solid rgba(255,255,255,.8); border-style: outset; border-radius: 25px; margin: 25px auto; padding: 50px;} .flexLabelsWrapper { position: relative; display: inline-flex; } .TextLabelsSULII { color: #4682B4; font-weight: bold; margin-right: 5px; } #lbl_PhoneNumber { margin-right: 5px;} .legendSULII { color: red; font-size: 25px; } .body { background-color: white; background-image: url('../img/X10DAX.png'); background-repeat: repeat; font-family: Calibri, San-Serif, Helvetica, Arial; } /******************************UserUpdatedShowInfo************************/ #fieldset2UUSI { border-radius: 5px; color: #4682B4; font-weight: bold; font-size: 21px; margin-left: 8px; width: 495px; } spanUUSI { color: red; font-weight: bold; font-size: 25px; } .ResultTextStyleUUSI { position: relative; color: red; font-size: 25px; margin-left: 25px; } #lbl_Identity { color: #4682B4; } #fieldset1UUSI { border-radius: 5px; width: 595px; height: 225px; font-weight: bold; color: #4682B4; font-size: 21px; margin-left: 8px; } #formUUSI { background-color: #FAF0E6; font-family: Calibri, San-Serif, Helvetica; width: 645px; height: 345px; border: 3px solid rgba(255,255,255,.8); border-style: outset; border-radius: 25px; margin: 25px auto; padding: 50px; } .flexLabelsWrapper { position: relative; display: inline-flex; } .TextLabelsUUSI { color: #4682B4; font-weight: bold; margin-right: 5px; } .legendUUSI { color: red; font-size: 25px; }

Christopher
Typewritten Text
Page 25

body { background-color: white; background-repeat: repeat; font-family: Calibri, San-Serif, Helvetica, Arial; } /***************************UpdateUserLogIn**********************/ #lbl1_PhoneNumber { position: relative; margin-right: 5px; } .BoxStyleUULI { height: 21px; width: 265px; margin-top: 4px; color: red; border-color: rgba(0,0,139,.9); } .BoxStyleUULI:hover { box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.05) inset, 0px 0px 8px rgba(82, 168, 236, 0.6); } #fieldsetUULI { border-radius: 5px; width: 450px; height: 285px; font-weight: bold; color: #4682B4; font-size: 21px; margin-left: 8px; } .flexTBoxesWrapper { position: relative; display: inline-flex; } .LabelStyleUULI { position: relative; font-size: 25px; color: #4682B4; } #formUULI { background-color: #FAF0E6; font-family: Calibri, San-Serif, Helvetica; width: 500px; height: 345px; border: 3px solid rgba(255,255,255,.8); border-style: outset; border-radius: 25px; margin: 25px auto; padding: 50px;} #legendUULI { color: red; font-size: 25px; } /**************************MakeUserLogIn************************/ #lbl1_PhoneNumber { position: relative; margin-right: 5px; } .BoxStyleMULI { height: 21px; width: 265px; margin-top: 4px; color: red; border-color: rgba(0,0,139,.9); margin-left: 5px; } .BoxStyleMULI:hover { box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.05) inset, 0px 0px 8px rgba(82, 168, 236, 0.6); } .fieldsetMULI { border-radius: 5px; width: 450px; height: 285px; font-weight: bold; color: #4682B4; font-size: 21px; margin-left: 8px; } .flexTBoxesWrapper { position: relative; display: inline-flex; } .LabelStyleMULI { position: relative; font-size: 25px; color: #4682B4; } #formMULI { background-color: #FAF0E6; font-family: Calibri, San-Serif, Helvetica; width: 500px; height: 320px; border: 3px solid rgba(255,255,255,.8); border-style: outset; border-radius: 25px; margin: 25px auto; padding: 50px;} .LegendMULI { color: red; font-size: 25px; } /*************************Index*************************/ .BoxStyleLogIn { height: 21px; width: 125px; margin-top: 4px; color: red; border-color: rgba(0,0,139,.9); } #formLogIn { position: absolute; margin-top: 270px; }

Christopher
Typewritten Text
Page 26

.BoxStyleLogIn:hover { box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.05) inset, 0px 0px 8px rgba(82, 168, 236, 0.6); } .SignInPos { position: relative; background-color: white; font-family: Calibri, San-Serif, Helvetica; padding-top: 8px; width: 135px; height: 115px; border-radius: 25px; padding-left: 5px; margin-left: 13px; border: solid; } .WelcomeUser { position: absolute; margin-left: 25px; font-size: 24px; color: darkblue; } spanIndex { color: cornflowerblue; } #formLogIn { position: absolute; } #txb_SignInUName { margin-bottom: 3px;} #txb_SignInPWord { margin-bottom: 5px; } .submitButtonLogIn { position: relative; height: 28px; width: 125px; margin-top: 18px; margin-bottom: 8px; background: rgba(0,125,0,.9); margin-right: 20px; color: rgba(255,255,255,1); border-color: rgba(158,202,237,1); border-radius: 8px; box-shadow: 0 0 10px rgba(158,202,237,1); outline: none; cursor: pointer; } /**********************BaseStyle**********************/ #header { border: solid; color: black; border-radius: 25px; height: 225px; background-image: url('../img/Header.png'); background-clip: border-box; } .LabelHeaderText { position: relative; color: white; font-size: 50px; font-weight: bold; } .SubHeaderTxt { position: relative; color: white; font-size: 36px; font-weight: bold; } .HeaderText { margin-top: 45px; text-shadow: 2px 2px #ff0000; } #newProducts { position: absolute; font-size: 24px; margin-left: 25px; margin-top: 45px; color: darkblue; font-size: 24px; cursor: pointer; } #newProducts:visited { color: mediumorchid; } #Products { position: absolute; font-size: 24px; margin-left: 25px; margin-top: 55px; color: darkblue; font-size: 24px; cursor: pointer; } #Products:visited { color: mediumorchid; } #Sale { position: absolute; font-size: 24px; margin-left: 25px; margin-top: 65px; color: darkblue; font-size: 24px; cursor: pointer;} #Featured { position: absolute; font-size: 24px; margin-left: 25px; margin-top: 75px; color: darkblue; font-size: 24px; cursor: pointer; } #Navigation { position: relative; float: left; border: solid; border-color: black; width: 175px; min-height: 605px; border-radius: 25px; background-color: darkgreen; }

Christopher
Typewritten Text
Page 27

.SignUp { position: absolute; font-size: 24px; margin-left: -155px; margin-top: 405px; color: darkblue; } .SignUp:visited { color:mediumorchid; } .UpdateUserInfo { position: absolute; font-size: 24px; margin-left: -155px; margin-top: 405px; color: darkblue; } #footer { text-align: left; clear: both; padding-left: 65px; padding-bottom: 10px; height: 45px; color: white; border: solid; border-color: black; background-color: darkgreen; border-color: black; border-radius: 25px; background-clip: border-box; } .rights { float: right; padding-right: 65px; color: white; } a { color: darkblue; } .footerText { position: relative; }

Christopher
Typewritten Text
Page 28