I need someone to help me do this visual studio 2013 c# question

profilekells534
project3.zip

Project3/Project3/About.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class About : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } }

Project3/Project3/App_Data/PublishProfiles/Project3.pubxml

FTP Debug Any CPU True False ftp.smarterasp.net False True shabed False

Project3/Project3/Buy.aspx

  New Used Fiction Scientific History Romance

Project3/Project3/Buy.aspx.cs

using System; using System.Collections.Generic; using System.Configuration; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Buy : System.Web.UI.Page { // double totalall = 0; protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { Response.Write("<script language=javascript>\n var agree; agree=confirm('you have to log in first'); \n if (agree) window.location=\"Login.aspx\"; </script>"); } } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { } protected void detailButton_Click(object sender, EventArgs e) { try{ if (quantityTextBox.Text != "") { Session["detail"] = GridView1.SelectedRow.Cells[1].Text; Response.Redirect("Details.aspx"); } else Label3.Visible = true; } catch (Exception exp) { Label1.Visible = true; } } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } protected void GridView2_SelectedIndexChanged(object sender, EventArgs e) { } protected void addToCartButton_Click(object sender, EventArgs e) { try { string booknme, price, quantity; booknme = GridView1.SelectedRow.Cells[1].Text; price = GridView1.SelectedRow.Cells[8].Text; quantity = quantityTextBox.Text; double total, price1; price1 = Double.Parse(price); total = Double.Parse(quantity); double t = price1 * total; SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Project3"].ConnectionString); conn.Open(); string checker = "insert into p3Order values (@username,@bookName,@price,@Quantity) "; SqlCommand comd = new SqlCommand(checker, conn); comd.Parameters.AddWithValue("@username", Session["user"]); comd.Parameters.AddWithValue("@bookName", booknme); comd.Parameters.AddWithValue("@price", t.ToString()); comd.Parameters.AddWithValue("@Quantity", quantity); comd.ExecuteNonQuery(); conn.Close(); } catch(Exception exp) { Label1.Visible = true; } } }

Project3/Project3/Contact.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Contact : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } }

Project3/Project3/Details.aspx.cs

using System; using System.Collections.Generic; using System.Configuration; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Details : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { Response.Write("<script language=javascript>\n var agree; agree=confirm('you have to log in first'); \n if (agree) window.location=\"Login.aspx\"; </script>"); } int x = 0; x= GridView1.Rows.Count; string price; double total = 0; for (int i = 0; i < x; i++) { price = GridView1.Rows[i].Cells[2].Text; total += Double.Parse(price); } Label1.Text = "The total amount is: " + total.ToString(); } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { if (GridView2.SelectedIndex > -1) { if (GridView1.Rows.Count > 0) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Project3"].ConnectionString); conn.Open(); string checker = "delete from p3Order"; SqlCommand comd = new SqlCommand(checker, conn); comd.ExecuteNonQuery(); conn.Close(); Response.Redirect("Thanks.aspx"); } else Label2.Visible = true; } else addressLabel.Visible = true; } protected void Button2_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Project3"].ConnectionString); conn.Open(); string insertQuery = "delete from [p3Order] where UserName=@uname"; SqlCommand comd = new SqlCommand(insertQuery, conn); comd.Parameters.AddWithValue("@uname", Session["user"]); comd.ExecuteNonQuery(); Response.Redirect("Buy.aspx"); } }

Project3/Project3/ForgetPassword.aspx.cs

using System; using System.Collections.Generic; using System.Configuration; using System.Data.SqlClient; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class ForgetPassword : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void resetButton1_Click(object sender, EventArgs e) { if (usernameTextBox1.Text != "" && emailTextBox1.Text != "") { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Project3"].ConnectionString); conn.Open(); string qry = "select [password] from p3Login where UserName=@uname"; SqlCommand cmd = new SqlCommand(qry, conn); cmd.Parameters.AddWithValue("@uname", usernameTextBox1.Text); SqlDataReader dr = cmd.ExecuteReader(); dr.Read(); if (dr.HasRows) { Label5.Text = ""; Label3.Visible = true; Label4.Visible = true; newpassTextBox1.Visible = true; confirmTextBox1.Visible = true; Button1.Visible = true; } else Label5.Text = " username is not exist."; } else { Label5.Text = "complete required fields."; } } protected void Button1_Click(object sender, EventArgs e) { if (newpassTextBox1.Text == confirmTextBox1.Text && newpassTextBox1.Text != "" && confirmTextBox1.Text != "") { Label5.Text = ""; MD5 password = new MD5CryptoServiceProvider(); password.ComputeHash(ASCIIEncoding.ASCII.GetBytes(newpassTextBox1.Text)); Byte[] result = password.Hash; StringBuilder strBuilder = new StringBuilder(); for (int i = 0; i < result.Length; i++) { strBuilder.Append(result[i].ToString("x2")); } SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Project3"].ConnectionString); conn.Open(); string qry = "update p3Login set Password=@newpass where UserName=@uname"; SqlCommand cmd = new SqlCommand(qry, conn); cmd.Parameters.AddWithValue("@uname", usernameTextBox1.Text); cmd.Parameters.AddWithValue("@newpass", strBuilder.ToString()); SqlDataReader dr = cmd.ExecuteReader(); dr.Read(); Response.Write("<meta http-equiv='refresh' content='2; url=Login.aspx'>"); } else { Label5.Text = "Confirming password did not mach."; } } }

Project3/Project3/HomePage.aspx

We hope you find the books you want

Project3/Project3/HomePage.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class HomePage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("Registeration.aspx"); } protected void signInButton_Click(object sender, EventArgs e) { Response.Redirect("Login.aspx"); } protected void Button1_Click1(object sender, EventArgs e) { Response.Redirect("Buy.aspx"); } }

Project3/Project3/images/book_shine.png

Project3/Project3/images/Books.png

Project3/Project3/images/books-pool.png

Project3/Project3/images/registeration.png

Project3/Project3/images/sign .png

Project3/Project3/Login.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Configuration; using System.Security.Cryptography; using System.Text; public partial class Login : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void loginButton_Click(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Project3"].ConnectionString); conn.Open(); string qry = "select [Password] from p3Login where UserName=@uname"; SqlCommand cmd = new SqlCommand(qry, conn); cmd.Parameters.AddWithValue("@uname", userNameTextBox.Text); SqlDataReader dr = cmd.ExecuteReader(); dr.Read(); if (dr.HasRows) { MD5 password = new MD5CryptoServiceProvider(); password.ComputeHash(ASCIIEncoding.ASCII.GetBytes(passwordTextBox.Text)); byte[] result = password.Hash; StringBuilder strBuilder = new StringBuilder(); for (int i = 0; i < result.Length; i++) { strBuilder.Append(result[i].ToString("x2")); } if (dr["Password"].ToString().Equals(strBuilder.ToString())) { messageLabel.Text = "Successful Login! :)"; Session["user"] = userNameTextBox.Text; Response.Write("<meta http-equiv= 'refresh' content='2; url=HomePage.aspx'>"); } else { messageLabel.Text = "User name and Password don't match!"; } } else { messageLabel.Text = "User doeesn't exist, please create an account "; } dr.Close(); conn.Close(); } protected void registerationButton_Click(object sender, EventArgs e) { Response.Redirect("Registeration.aspx"); } }

Project3/Project3/menu.css

.menu ul li { display:inline-table; margin-left:100px; } .menu ul{ padding:0 } .menu ul li .subMenu{ display:none; width:150px; } .menu ul li:hover > .subMenu{ display:block; } .menu ul li .subMenu li{ margin:0; padding-top:5px; } .menu ul li a{ font-size:15px; text-decoration:none; color:blue; } body { }

Project3/Project3/Registeration.aspx

First Name
Last Name
User Name
E-mail
Country Select Country China USA Tiland India KSA Iraq
Password
Confirm Password
Gender  
Age
   
     

Project3/Project3/Registeration.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Configuration; using System.Drawing; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; public partial class Registeration : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Project3"].ConnectionString); conn.Open(); string checker = "select * from p3Login where UserName=@uname"; SqlCommand comd = new SqlCommand(checker, conn); comd.Parameters.AddWithValue("@uname", userNameTextBox.Text); SqlDataReader dr = comd.ExecuteReader(); dr.Read(); if (dr.HasRows) { welcomeLabel.Text = "User already Exsits!!"; welcomeLabel.ForeColor = Color.Red; } dr.Close(); conn.Close(); } } protected void submitButton_Click(object sender, EventArgs e) { if (fNameTextBox.Text == "") fNameLabel.Visible = true; else fNameLabel.Visible = false; if (lNameTextBox.Text == "") LNameLabel.Visible = true; else LNameLabel.Visible = false; if (userNameTextBox.Text == "") UNameLabel.Visible = true; else UNameLabel.Visible = false; if (emailTextBox.Text == "") emialLabel.Visible = true; else { emialLabel.Visible = false; string email = emailTextBox.Text; Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$"); Match match = regex.Match(email); if (match.Success) vaildationLabel.Visible = false; else vaildationLabel.Visible = true; } if (countryDropDownList.Text != "Select Country") countryLabel.Visible = false; else countryLabel.Visible = true; if (passwordTextBox.Text == "") passwordLabel.Visible = true; else { passwordLabel.Visible = false; Regex format = new Regex(@"^[a-zA-Z]\w{5,17}"); if (format.IsMatch(passwordTextBox.Text)) passwordStandardLabel.Visible = false; else passwordStandardLabel.Visible = true; } if (confirmTextBox.Text == "") confirmLabel.Visible = true; else { confirmLabel.Visible = false; if (passwordTextBox.Text == confirmTextBox.Text) matchLabel.Visible = false; else matchLabel.Visible = true; } if (ageTextBox.Text == "") ageLabel.Visible = true; else { ageLabel.Visible = false; int f; int conv = 0; try { conv = Convert.ToInt32(ageTextBox.Text); f = 1; } catch (Exception exp) { f = 0; } if (f == 0) minmumLabel.Visible = true; else if (18 < conv && conv < 80) minmumLabel.Visible = false; else minmumLabel.Visible = true; } if (fNameLabel.Visible == false && LNameLabel.Visible == false && UNameLabel.Visible == false && emialLabel.Visible == false && vaildationLabel.Visible == false && countryLabel.Visible == false && passwordLabel.Visible == false && passwordStandardLabel.Visible == false && confirmLabel.Visible == false && matchLabel.Visible == false && ageLabel.Visible == false && minmumLabel.Visible == false) { try { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Project3"].ConnectionString); conn.Open(); string insertQuery = "insert into p3Login values (@uname, @email, @password) "; string insertQuery2 = "insert into p3UserInformation values (@uname, @FirstName, @LastName, @Country, @Age, @Gender) "; SqlCommand comd = new SqlCommand(insertQuery, conn); SqlCommand comd2 = new SqlCommand(insertQuery2, conn); comd.Parameters.AddWithValue("@uname", userNameTextBox.Text); comd.Parameters.AddWithValue("@email", emailTextBox.Text); MD5 password = new MD5CryptoServiceProvider(); password.ComputeHash(ASCIIEncoding.ASCII.GetBytes(passwordTextBox.Text)); Byte[] result = password.Hash; StringBuilder strBuilder = new StringBuilder(); for (int i = 0; i < result.Length; i++) { strBuilder.Append(result[i].ToString("x2")); } comd.Parameters.AddWithValue("@password", strBuilder.ToString()); string sex; if (femaleRadioButton.Checked) sex = "female"; else sex = "male"; comd2.Parameters.AddWithValue("@uname", userNameTextBox.Text); comd2.Parameters.AddWithValue("@FirstName", fNameTextBox.Text); comd2.Parameters.AddWithValue("@LastName", lNameTextBox.Text); comd2.Parameters.AddWithValue("@Country", countryDropDownList.SelectedValue); comd2.Parameters.AddWithValue("@Age", ageTextBox.Text); comd2.Parameters.AddWithValue("@Gender", sex); comd.ExecuteNonQuery(); comd2.ExecuteNonQuery(); conn.Close(); //Response.Redirect("Manager.aspx"); //Response.Write("Manager.aspx"); Response.Write("<meta http-equiv='refresh' content='2; url=Login.aspx'>"); welcomeLabel.Text = "Registeration Successful!!"; welcomeLabel.ForeColor = Color.Red; } catch (Exception ex) { Response.Write("Error" + ex.ToString()); } } } protected void fNameTextBox_TextChanged(object sender, EventArgs e) { } }

Project3/Project3/Thanks.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Thanks : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } }

Project3/Project3/Web.config

Project3/Project3/Web.Debug.config

Project3/Project3/website.publishproj

Debug AnyCPU 10.0.30319 2.0 {40549a1d-8581-4fe3-bed5-4b0f2113c00a} $(MSBuildThisFileDirectory) /Project3 v4.5 http://localhost:25478 /IISExpress/7.5/LM/W3SVC/4/ROOT 10.0 10.5 $(VisualStudioVersion) $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(WebPublishTargetsVersion) $(VSToolsPath) 1.0.0.0 1.0.0.0 $(AssemblyFileVersion) $(AssemblyVersion)

Project3/Project3/Welcome.aspx.cs

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Welcome : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("Registeration.aspx"); } protected void signInButton_Click(object sender, EventArgs e) { Response.Redirect("Login.aspx"); } }