LAPTOP SEARCH ENGINE ALLOWS CLIENT TO SEARCH LAPTOPS IN RANGE,BRANDS,CONFIGURATION AND MORE.
THIS COMPLETE PROJECT IS DONE IN ASP.NET C# AND MICROSOFT SQL SERVER
REQUIREMENTS TO RUN THIS PROJECT
*VISUAL STUDIO 2005
*MICROSOFT SQL SERVER
*IIS
*MICROSOFT WINDOWS XP /VISTA/WINDOWS 7
TO DOWNLOAD THIS PROJECT CLICK HERE
THIS PROJECT HAVE SEVERAL MODULES
ADDING NEW LAPTOPS DATAS TO SQL SERVER
"ADDNEW.ASPX"
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="addnew.aspx.cs" Inherits="addnew" %>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Welcome Admintitle>
head>
<body >
<form id="form1" runat="server">
<div>
<a href="Default.aspx">a>
<a href="Searching.aspx"><asp:Image ID="Image8" src="image/search.png" runat="server" style="z-index:120px; top:121px;left:178px;position:absolute" Height="50px" Width="125px"/>a>
<a href="Brands.aspx"><asp:Image ID="Image9" src="image/brand.png" runat="server" style="z-index:120px; top:117px;left:402px;position:absolute" Height="50px" Width="125px"/>a>
<asp:Image ID="Image10" src="image/aboutus.png" runat="server" style="z-index:120px; top:113px;left:639px;position:absolute" Height="50px" Width="199px"/>
`<asp:Label ID="Label1" runat="server" Height="23px" Text="Adding New Laptop Product" Width="400px" style="z-index:120px;top:41px;position:absolute;left:272px" Font-Size="XX-Large" ForeColor="MediumSpringGreen" >asp:Label>
<asp:Label ID="Label2" runat="server" Text="Welcome " style="z-index:120px;top:8px;position:absolute;left:842px" Width="1px">asp:Label>
<asp:Label ID="Label3" runat="server" Text="Admin" style="z-index:120px;top:7px;position:absolute;left:905px" Width="1px">asp:Label>
<a href="Default.aspx"><asp:Label ID="Label4" runat="server" Text=",LogOut" style="z-index:120px;top:7px;position:absolute;left:951px" Width="1px">asp:Label>a>
<asp:Label ID="Label5" runat="server" Text="Add New" style="z-index:120px;top:229px;position:absolute;left:30px" Height="26px" Width="99px"/>
<a href="update.aspx"><asp:Label ID="Label6" runat="server" Text="Update" style="z-index:120px;top:257px;position:absolute;left:31px" Height="25px" Width="98px"/>a>
<a href="delete.aspx"><asp:Label ID="Label7" runat="server" Text="Delete Product" style="z-index:120px;top:282px;position:absolute;left:29px" Height="25px" Width="98px"/>a>
<asp:Label ID="Label8" runat="server" Text="Brand Name " Style="z-index: 100; left: 287px; position: absolute;top: 186px" Width="211px">asp:Label>
<asp:Label ID="Label9" runat="server" Text="Price Range" Style="z-index: 100; left: 288px; position: absolute;top: 215px" Width="214px">asp:Label>
<asp:Label ID="Label10" runat="server" Text="Hard disk " Style="z-index: 100; left: 288px; position: absolute;top: 245px" Width="211px">asp:Label>
<asp:Label ID="Label11" runat="server" Text="RAM " Style="z-index: 100; left: 288px; position: absolute;top: 271px" Width="211px">asp:Label>
<asp:Label ID="Label12" runat="server" Text="Processor " Style="z-index: 100; left: 288px; position: absolute;top: 302px" Width="211px">asp:Label>
<asp:Label style="Z-INDEX: 100; LEFT: 288px; POSITION: absolute; TOP: 340px" id="Label21" runat="server" Width="211px" Text="Display">asp:Label>
<asp:Label style="Z-INDEX: 100; LEFT: 288px; POSITION: absolute; TOP: 372px" id="Label22" runat="server" Width="211px" Text="Graphics Card">asp:Label>
<asp:Label style="Z-INDEX: 100; LEFT: 288px; POSITION: absolute; TOP: 406px" id="Label23" runat="server" Width="211px" Text="DVD">asp:Label>
<asp:Label style="Z-INDEX: 100; LEFT: 288px; POSITION: absolute; TOP: 438px" id="Label24" runat="server" Width="211px" Text="Model No">asp:Label>
<asp:Label style="Z-INDEX: 100; LEFT: 288px; POSITION: absolute; TOP: 472px" id="Label25" runat="server" Width="211px" Text="Warranty">asp:Label>
<asp:Label ID="Label13" runat="server" Text="OS " Style="z-index: 100; left: 290px; position: absolute;top: 503px" Width="211px">asp:Label>
<asp:Label ID="Label14" runat="server" Text="Color" Style="z-index: 100; left: 288px; position: absolute;top: 534px" Width="211px">asp:Label>
<asp:Label ID="Label15" runat="server" Text="Wifi" Style="z-index: 100; left: 289px; position: absolute;top: 567px" Width="211px">asp:Label>
<asp:Label ID="Label16" runat="server" Text="Web Camera " Style="z-index: 100; left: 289px; position: absolute;top: 595px" Width="211px">asp:Label>
<asp:Label ID="Label17" runat="server" Text="Card Reader" Style="z-index: 100; left: 290px; position: absolute;top: 619px" Width="211px">asp:Label>
<asp:Label ID="Label18" runat="server" Style="z-index: 100; left: 290px; position: absolute; top: 645px" Text="Bag" Width="211px">asp:Label>
<asp:Label ID="Label19" runat="server" Style="z-index: 100; left: 290px; position: absolute; top: 673px" Text="Antivirus" Width="211px">asp:Label>
<asp:Label ID="Label26" runat="server" Style="z-index: 100; left: 290px; position: absolute; top: 701px" Text="BlueTooth" Width="211px">asp:Label>
<asp:Button ID="Button1" runat="server" Text="Submit Product" Style="z-index: 100; left: 416px; position: absolute;top: 774px" Height="32px" Width="132px" OnClick="Button1_Click" />
<asp:DropDownList ID="Drop1" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 186px" Height="20px" Width="119px" TabIndex=1>
<asp:ListItem Text="Dell" Value="Dell">asp:ListItem>
<asp:ListItem Text="Hp" Value="Hp">asp:ListItem>
<asp:ListItem Text="Lenovo" Value="Lenovo">asp:ListItem>
<asp:ListItem Text="Samsung" Value="Samsung">asp:ListItem>
<asp:ListItem Text="Sony" Value="Sony">asp:ListItem>
<asp:ListItem Text="Toshiba" Value="Toshiba">asp:ListItem>
asp:DropDownList>
<asp:TextBox ID="price" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 213px" Width="118px" Font-Italic="True">asp:TextBox>
<asp:TextBox ID="HDD" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 241px" Height="15px" Width="118px" >
asp:TextBox>
<asp:TextBox ID="RAM" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 271px" Height="15px" Width="118px" >
asp:TextBox>
<asp:TextBox ID="Processor" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 305px" Height="15px" Width="118px" >
asp:TextBox>
<asp:TextBox ID="display" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 339px" Height="15px" Width="118px" >
asp:TextBox>
<asp:TextBox ID="graphicscard" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 370px" Height="15px" Width="118px" >
asp:TextBox>
<asp:TextBox ID="dvd" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 405px" Height="15px" Width="118px" >
asp:TextBox>
<asp:TextBox ID="modelno" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 440px" Height="15px" Width="118px" >
asp:TextBox>
<asp:TextBox ID="warranty" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 474px" Height="15px" Width="118px" >
asp:TextBox>
<asp:TextBox ID="OS" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 505px" Height="15px" Width="118px" >
asp:TextBox>
<asp:TextBox ID="color" runat="server" Style="z-index: 100; left: 508px; position: absolute;top: 533px" Height="15px" Width="118px" >
asp:TextBox>
<asp:RadioButtonList runat="server" ID="wifi">
<asp:ListItem Style="z-index: 100; left: 505px; position: absolute;top: 569px" Height="15px" Width="65px" Text="Yes">asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 577px; position: absolute;top: 570px" Height="15px" Width="65px" Text="No">asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList runat="server" ID="camera">
<asp:ListItem Style="z-index: 100; left: 504px; position: absolute;top: 595px" Height="15px" Width="65px" Text="Yes">asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 577px; position: absolute;top: 594px" Height="15px" Width="65px" Text="No">asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList runat="server" ID="cardreader">
<asp:ListItem Style="z-index: 100; left: 503px; position: absolute;top: 619px" Height="15px" Width="65px" Text="Yes">asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 576px; position: absolute;top: 618px" Height="15px" Width="65px" Text="No">asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList runat="server" ID="bag">
<asp:ListItem Style="z-index: 100; left: 504px; position: absolute;top: 645px" Height="15px" Width="65px" Text="Yes" >asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 574px; position: absolute;top: 644px" Height="15px" Width="65px" Text="No" >asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList runat="server" ID="antivirus">
<asp:ListItem Style="z-index: 100; left: 500px; position: absolute;top: 673px" Height="15px" Width="65px" Text="Yes">asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 572px; position: absolute;top: 670px" Height="15px" Width="65px" Text="No" >asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList runat="server" ID="bluetooth">
<asp:ListItem Style="z-index: 100; left: 501px; position: absolute;top: 700px" Height="15px" Width="65px" Text="Yes" >asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 572px; position: absolute;top: 698px" Height="15px" Width="65px" Text="No" >asp:ListItem>
asp:RadioButtonList>
<asp:Label ID="Label20" runat="server" Text="INR" Style="z-index: 100; left: 635px; position: absolute;top: 214px" Height="15px" Width="65px">asp:Label>
<asp:Label ID="Label27" runat="server" Text="GB" Style="z-index: 100; left: 638px; position: absolute;top: 244px" Height="15px" Width="65px">asp:Label>
<asp:Label ID="Label28" runat="server" Text="GB" Style="z-index: 100; left: 638px; position: absolute;top: 278px" Height="15px" Width="65px">asp:Label>
<asp:Label ID="Label30" runat="server" Text="GHZ" Style="z-index: 100; left: 638px; position: absolute;top: 307px" Height="15px" Width="65px">asp:Label>
<asp:Label ID="Label29" runat="server" Text="MB" Style="z-index: 100; left: 638px; position: absolute;top: 370px" Height="15px" Width="65px">asp:Label>
<asp:RangeValidator Type="Integer" ControlToValidate="price" Text="Enter Price Range Between 10,000 to 80,000" runat="server" style="z-index:120px;top:216px;left:708px; position:absolute;" MinimumValue="10000" MaximumValue="80000" Display="Dynamic" ID="RangeValidator1" Width="280px">asp:RangeValidator>
<asp:RangeValidator runat="server" Type="Integer" ControlToValidate="HDD" Text="Enter HDD Range Between 80GB to 1000GB" style="z-index:120px;top:243px;left:708px; position:absolute;" MinimumValue="80" MaximumValue="1000" ID="RangeValidator2" Height="20px" Width="305px" >asp:RangeValidator>
<asp:RangeValidator runat="server" Type="Integer" ControlToValidate="RAM" Text="Enter RAM Range Between 1GB to 8GB" style="z-index:120px;top:276px;left:708px; position:absolute;" MinimumValue="1" MaximumValue="8" ID="RangeValidator3" Height="20px" Width="305px" >asp:RangeValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="price" runat="server" ID="RequireFieldValidatior1" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 709px; position: absolute;top: 217px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="HDD" runat="server" ID="RequiredFieldValidator1" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 712px; position: absolute;top: 242px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="RAM" runat="server" ID="RequiredFieldValidator2" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 710px; position: absolute;top: 277px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="processor" runat="server" ID="RequiredFieldValidator3" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 707px; position: absolute;top: 304px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="display" runat="server" ID="RequiredFieldValidator4" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 707px; position: absolute;top: 340px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="graphicscard" runat="server" ID="RequiredFieldValidator7" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 706px; position: absolute;top: 369px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="dvd" runat="server" ID="RequiredFieldValidator6" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 644px; position: absolute;top: 405px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="modelno" runat="server" ID="RequiredFieldValidator5" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 645px; position: absolute;top: 443px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="warranty" runat="server" ID="RequiredFieldValidator8" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 644px; position: absolute;top: 475px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="OS" runat="server" ID="RequiredFieldValidator9" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 643px; position: absolute;top: 506px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="color" runat="server" ID="RequiredFieldValidator10" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 644px; position: absolute;top: 537px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="wifi" runat="server" ID="RequiredFieldValidator11" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 642px; position: absolute;top: 597px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="camera" runat="server" ID="RequiredFieldValidator12" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 645px; position: absolute;top: 571px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="cardreader" runat="server" ID="RequiredFieldValidator13" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 643px; position: absolute;top: 623px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="bag" runat="server" ID="RequiredFieldValidator14" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 643px; position: absolute;top: 650px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="antivirus" runat="server" ID="RequiredFieldValidator15" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 642px; position: absolute;top: 670px" Height="1px" Width="184px">asp:RequiredFieldValidator>
<asp:RequiredFieldValidator Display="Dynamic" ControlToValidate="bluetooth" runat="server" ID="RequiredFieldValidator16" ErrorMessage="Mandatory Fields" Style="z-index: 100; left: 641px; position: absolute;top: 697px" Height="1px" Width="184px">asp:RequiredFieldValidator>
div>
form>
body>
html>
"ADDNEW.ASPX.CS"
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class addnew : System.Web.UI.Page
{
SqlConnection db = new SqlConnection("database=laptop;server=.;uid=sa;");
SqlCommand cmd = new SqlCommand();
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
db.Open();
cmd.Connection = db;
cmd.CommandText = "insert into product values('" + Drop1.Text.Trim() + "','" + price.Text.Trim() + "','" + HDD.Text.Trim() + "','" + RAM.Text.Trim() + "','" + Processor.Text.Trim() + "','" + display.Text.Trim() + "','" + graphicscard.Text.Trim() + "','" + dvd.Text.Trim() + "','" + modelno.Text.Trim() + "','" + warranty.Text.Trim() + "','" + OS.Text.Trim() + "','" + color.Text.Trim() + "','" + wifi.Text.Trim() + "','" + camera.Text.Trim() + "','" + cardreader.Text.Trim() + "','" + bag.Text.Trim() + "','" + antivirus.Text.Trim() + "','" + bluetooth.Text.Trim() +"')";
cmd.ExecuteNonQuery();
db.Close();
Response.Write("");
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Searchingproduct.aspx.cs" Inherits="Searchingproduct" %>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Sarching Product'stitle>
head>
<body style="font-size: x-large">
<form id="form1" runat="server">
<div>
<center style="font-size: 50px; color:#0099ff; font-style: normal; font-family: 'Times New Roman'">Searching Product'scenter>
<asp:Label ID="Label1" runat="server" Text="Brand Name " Style="z-index: 100; left: 287px; position: absolute;top: 159px" Width="215px" Font-Size="Medium">asp:Label>
<asp:Label ID="Label2" runat="server" Text="Price Range" Style="z-index: 100; left: 287px; position: absolute;top: 200px" Width="218px" Font-Size="Medium">asp:Label>
<asp:Label ID="Label3" runat="server" Text="Hard disk " Style="z-index: 100; left: 287px; position: absolute;top: 245px" Width="215px" Font-Size="Medium">asp:Label>
<asp:Label ID="Label4" runat="server" Text="RAM " Style="z-index: 100; left: 287px; position: absolute;top: 283px" Width="215px" Font-Size="Medium">asp:Label>
<asp:Label ID="Label7" runat="server" Text="Color" Style="z-index: 100; left: 289px; position: absolute;top: 337px" Width="215px" Font-Size="Medium">asp:Label>
<asp:Label ID="Label8" runat="server" Text="Wifi" Style="z-index: 100; left: 287px; position: absolute;top: 418px" Width="215px" Font-Size="Medium">asp:Label>
<asp:Label ID="Label9" runat="server" Text="Web Camera " Style="z-index: 100; left: 287px; position: absolute;top: 492px" Width="215px" Font-Size="Medium">asp:Label>
<asp:Label ID="Label10" runat="server" Text="Card Reader" Style="z-index: 100; left: 284px; position: absolute;top: 570px" Width="215px" Font-Size="Medium">asp:Label>
<asp:Button ID="Button1" runat="server" Text="Check Availability" Style="z-index: 100; left: 340px; position: absolute;top: 636px" Height="25px" Width="136px" OnClick="Button1_Click" />
<asp:DropDownList ID="Brand1" runat="server" Style="z-index: 100; left: 432px; position: absolute;top: 158px" Height="25px" Width="128px" >
<asp:ListItem Text="Dell">asp:ListItem>
<asp:ListItem Text="Hp">asp:ListItem>
<asp:ListItem Text="Lenovo">asp:ListItem>
<asp:ListItem Text="Samsung">asp:ListItem>
<asp:ListItem Text="Sony">asp:ListItem>
<asp:ListItem Text="Toshiba">asp:ListItem>
asp:DropDownList>
<asp:DropDownList runat="server" ID="Price1" Style="z-index: 100; left: 433px; position: absolute;top: 201px" Width="128px">
<asp:ListItem Text="20,000" >asp:ListItem>
<asp:ListItem Text="30,000" >asp:ListItem>
<asp:ListItem Text="40,000" >asp:ListItem>
<asp:ListItem Text="50,000" >asp:ListItem>
<asp:ListItem Text="60,000" >asp:ListItem>
asp:DropDownList>
<asp:DropDownList ID="Hdd1" runat="server" Style="z-index: 100; left: 433px; position: absolute;top: 246px" Height="25px" Width="128px" >
<asp:ListItem Text="80">asp:ListItem>
<asp:ListItem Text="160">asp:ListItem>
<asp:ListItem Text="320">asp:ListItem>
<asp:ListItem Text="400">asp:ListItem>
<asp:ListItem Text="500">asp:ListItem>
asp:DropDownList>
<asp:DropDownList ID="Ram1" runat="server" Style="z-index: 100; left: 433px; position: absolute;top: 284px" Height="25px" Width="128px" >
<asp:ListItem Text="1">asp:ListItem>
<asp:ListItem Text="2">asp:ListItem>
<asp:ListItem Text="3">asp:ListItem>
<asp:ListItem Text="4">asp:ListItem>
<asp:ListItem Text="6">asp:ListItem>
<asp:ListItem Text="8">asp:ListItem>
asp:DropDownList>
<asp:Panel ID="Panel1" runat="server" BackColor="#8080FF" Height="640px" Width="1000px">
asp:Panel>
<asp:DropDownList ID="Color1" runat="server" Style="z-index: 100; left: 435px; position: absolute;top: 336px" Height="25px" Width="128px" >
<asp:ListItem Text="Black">asp:ListItem>
<asp:ListItem Text="White">asp:ListItem>
<asp:ListItem Text="Green">asp:ListItem>
<asp:ListItem Text="Red">asp:ListItem>
<asp:ListItem Text="Blue">asp:ListItem>
<asp:ListItem Text="Silver">asp:ListItem>
<asp:ListItem Text="Gray">asp:ListItem>
asp:DropDownList>
<asp:RadioButtonList ID="wifi" runat="server" Style="z-index: 100; left: 434px; position: absolute;top: 404px" Height="25px" Width="69px" Font-Size="Medium">
<asp:ListItem Text="Yes">asp:ListItem>
<asp:ListItem Text="No">asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList ID="camera" runat="server" Style="z-index: 100; left: 432px; position: absolute;top: 476px" Height="25px" Width="69px" Font-Size="Medium">
<asp:ListItem Text="Yes">asp:ListItem>
<asp:ListItem Text="No">asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList ID="reader" runat="server" Style="z-index: 100; left: 431px; position: absolute;top: 554px" Height="25px" Width="69px" Font-Size="Medium">
<asp:ListItem Text="Yes">asp:ListItem>
<asp:ListItem Text="No">asp:ListItem>
asp:RadioButtonList>
div>
form>
body>
html>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Searchingproduct : System.Web.UI.Page
{
SqlConnection db = new SqlConnection("database=laptop;server=.;uid=sa;");
SqlCommand cmd=new SqlCommand();
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
db.Open();
cmd.Connection=db;
cmd.CommandText="select * from product ";
dr = cmd.ExecuteReader();
while (dr.Read())
{
if (Brand1.SelectedItem.Text == dr.GetValue(0).ToString().Trim() && Price1.SelectedItem.Text == dr.GetValue(1).ToString().Trim() && Hdd1.SelectedItem.Text == dr.GetValue(2).ToString().Trim() && Ram1.SelectedItem.Text == dr.GetValue(3).ToString().Trim() && Color1.SelectedItem.Text == dr.GetValue(11).ToString().Trim() && wifi.Text == dr.GetValue(12).ToString().Trim() && camera.Text == dr.GetValue(12).ToString().Trim() && reader.Text == dr.GetValue(13).ToString().Trim())
{
invisible();
searched();
}
else
{
Response.Redirect("Searched.aspx");
}
}
db.Close();
}
void invisible()
{
Label1.Visible = false;
Label10.Visible = false;
Label2.Visible = false;
Label3.Visible = false;
Label4.Visible = false;
Label7.Visible = false;
Label7.Visible = false;
Label8.Visible = false;
Label9.Visible = false;
Brand1.Visible = false;
Price1.Visible = false;
Hdd1.Visible = false;
Ram1.Visible = false;
Color1.Visible = false;
wifi.Visible = false;
camera.Visible = false;
reader.Visible = false;
Button1.Visible = false;
}
void searched()
{
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="update.aspx.cs" Inherits="update" %>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Welcome Admintitle>
head>
<body >
<form id="form1" runat="server">
<div>
<a href="Default.aspx">a>
<a href="Searching.aspx"><asp:Image ID="Image8" src="image/search.png" runat="server" style="z-index:120px; top:121px;left:178px;position:absolute" Height="50px" Width="125px"/>a>
<a href="Brands.aspx"><asp:Image ID="Image9" src="image/brand.png" runat="server" style="z-index:120px; top:117px;left:402px;position:absolute" Height="50px" Width="125px"/>a>
<asp:Image ID="Image10" src="image/aboutus.png" runat="server" style="z-index:120px; top:113px;left:639px;position:absolute" Height="50px" Width="199px"/>
<asp:Label ID="Label1" runat="server" Height="23px" Text="Update Laptop Product" Width="352px" style="z-index:120px;top:44px;position:absolute;left:326px" Font-Size="XX-Large" ForeColor="MediumSpringGreen" >asp:Label>
<asp:Label ID="Label2" runat="server" Text="Welcome " style="z-index:120px;top:8px;position:absolute;left:842px" Width="1px">asp:Label>
<asp:Label ID="Label3" runat="server" Text="Admin" style="z-index:120px;top:7px;position:absolute;left:905px" Width="1px">asp:Label>
<a href="Default.aspx"><asp:Label ID="Label4" runat="server" Text=",LogOut" style="z-index:120px;top:7px;position:absolute;left:951px" Width="1px">asp:Label>a>
<a href="addnew.aspx"><asp:Label ID="Label5" runat="server" Text="Add New" style="z-index:120px;top:229px;position:absolute;left:30px" Height="26px" Width="99px"/>a>
<asp:Label ID="Label6" runat="server" Text="Update" style="z-index:120px;top:257px;position:absolute;left:31px" Height="25px" Width="98px"/>
<a href="delete.aspx"><asp:Label ID="Label7" runat="server" Text="Delete Product" style="z-index:120px;top:282px;position:absolute;left:29px" Height="25px" Width="98px"/>a>
<asp:DropDownList ID="Brand1" AutoPostBack="true" runat="server" Style="z-index:120px; top:253px; position:absolute; left:500px;" Width="118px">
<asp:ListItem Text="Dell">asp:ListItem>
<asp:ListItem Text="HP">asp:ListItem>
<asp:ListItem Text="Lenovo">asp:ListItem>
<asp:ListItem Text="Samsung">asp:ListItem>
<asp:ListItem Text="Sony">asp:ListItem>
<asp:ListItem Text="Toshiba">asp:ListItem>
asp:DropDownList>
<asp:Label ID="Label8" runat="server" Text="Brand Name" Style="z-index:120px; top:256px; position:absolute; left:392px;">asp:Label>
<asp:Label ID="Label9" runat="server" Text="Model No" Style="z-index:120px; top:302px; position:absolute; left:393px;">asp:Label>
<asp:DropDownList ID="ModelNo1" runat="server" Style="z-index:120px; top:300px; position:absolute; left:500px;" Width="118px" >
asp:DropDownList>
<asp:Label ID="Label10" runat="server" Style="z-index: 100; left: 160px; position: absolute;
top: 391px" Text="Price Range" Width="214px">asp:Label>
<asp:Label ID="Label11" runat="server" Style="z-index: 100; left: 160px; position: absolute;
top: 421px" Text="Hard disk " Width="211px">asp:Label>
<asp:Label ID="Label12" runat="server" Style="z-index: 100; left: 160px; position: absolute;
top: 447px" Text="RAM " Width="211px">asp:Label>
<asp:Label ID="Label13" runat="server" Style="z-index: 100; left: 160px; position: absolute;
top: 478px" Text="Processor " Width="211px">asp:Label>
<asp:Label ID="Label21" runat="server" Style="z-index: 100; left: 160px; position: absolute;
top: 516px" Text="Display" Width="211px">asp:Label>
<asp:Label ID="Label22" runat="server" Style="z-index: 100; left: 160px; position: absolute;
top: 548px" Text="Graphics Card" Width="211px">asp:Label>
<asp:Label ID="Label23" runat="server" Style="z-index: 100; left: 160px; position: absolute;
top: 582px" Text="DVD" Width="211px">asp:Label>
<asp:Label ID="Label25" runat="server" Style="z-index: 100; left: 161px; position: absolute;
top: 613px" Text="Warranty" Width="211px">asp:Label>
<asp:Label ID="Label14" runat="server" Style="z-index: 100; left: 163px; position: absolute;
top: 644px" Text="OS " Width="211px">asp:Label>
<asp:Label ID="Label15" runat="server" Style="z-index: 100; left: 161px; position: absolute;
top: 675px" Text="Color" Width="211px">asp:Label>
<asp:Label ID="Label16" runat="server" Style="z-index: 100; left: 585px; position: absolute;
top: 393px" Text="Wifi" Width="211px">asp:Label>
<asp:Label ID="Label17" runat="server" Style="z-index: 100; left: 585px; position: absolute;
top: 461px" Text="Web Camera " Width="211px">asp:Label>
<asp:Label ID="Label18" runat="server" Style="z-index: 100; left: 586px; position: absolute;
top: 519px" Text="Card Reader" Width="211px">asp:Label>
<asp:Label ID="Label19" runat="server" Style="z-index: 100; left: 586px; position: absolute;
top: 580px" Text="Bag" Width="211px">asp:Label>
<asp:Label ID="Label20" runat="server" Style="z-index: 100; left: 586px; position: absolute;
top: 648px" Text="Antivirus" Width="211px">asp:Label>
<asp:TextBox ID="price" runat="server" Font-Italic="True" Style="z-index: 100; left: 380px;
position: absolute; top: 389px" Width="118px">asp:TextBox>
<asp:TextBox ID="HDD" runat="server" Height="15px" Style="z-index: 100; left: 380px;
position: absolute; top: 417px" Width="118px">
asp:TextBox>
<asp:TextBox ID="RAM" runat="server" Height="15px" Style="z-index: 100; left: 380px;
position: absolute; top: 447px" Width="118px">
asp:TextBox>
<asp:TextBox ID="Processor" runat="server" Height="15px" Style="z-index: 100; left: 380px;
position: absolute; top: 481px" Width="118px">
asp:TextBox>
<asp:TextBox ID="display" runat="server" Height="15px" Style="z-index: 100; left: 380px;
position: absolute; top: 515px" Width="118px">
asp:TextBox>
<asp:TextBox ID="graphicscard" runat="server" Height="15px" Style="z-index: 100;
left: 380px; position: absolute; top: 546px" Width="118px">
asp:TextBox>
<asp:TextBox ID="dvd" runat="server" Height="15px" Style="z-index: 100; left: 380px;
position: absolute; top: 583px" Width="118px">
asp:TextBox>
<asp:TextBox ID="warranty" runat="server" Height="15px" Style="z-index: 100; left: 381px;
position: absolute; top: 615px" Width="118px">
asp:TextBox>
<asp:TextBox ID="OS" runat="server" Height="15px" Style="z-index: 100; left: 381px;
position: absolute; top: 646px" Width="118px">
asp:TextBox>
<asp:TextBox ID="color" runat="server" Height="15px" Style="z-index: 100; left: 381px;
position: absolute; top: 674px" Width="118px">
asp:TextBox>
<asp:Label ID="Label39" runat="server" Height="15px" Style="z-index: 100; left: 512px;
position: absolute; top: 389px" Text="INR" Width="65px">asp:Label>
<asp:Label ID="Label27" runat="server" Height="15px" Style="z-index: 100; left: 510px;
position: absolute; top: 420px" Text="GB" Width="65px">asp:Label>
<asp:Label ID="Label28" runat="server" Height="15px" Style="z-index: 100; left: 509px;
position: absolute; top: 449px" Text="GB" Width="65px">asp:Label>
<asp:Label ID="Label30" runat="server" Height="15px" Style="z-index: 100; left: 510px;
position: absolute; top: 483px" Text="GHZ" Width="65px">asp:Label>
<asp:Label ID="Label29" runat="server" Height="15px" Style="z-index: 100; left: 510px;
position: absolute; top: 546px" Text="MB" Width="65px">asp:Label>
<asp:RadioButtonList runat="server" ID="camera" style="z-index:120px;top:-134px;left:200px; position:absolute;">
<asp:ListItem Style="z-index: 100; left: 504px; position: absolute;top: 595px" Height="15px" Width="65px" Text="Yes">asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 577px; position: absolute;top: 594px" Height="15px" Width="65px" Text="No">asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList runat="server" ID="cardreader" style="z-index:120px;top:-100px;left:202px; position:absolute;" Height="15px" Width="65px">
<asp:ListItem Style="z-index: 100; left: 503px; position: absolute;top: 619px" Height="15px" Width="65px" Text="Yes">asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 576px; position: absolute;top: 618px" Height="15px" Width="65px" Text="No">asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList runat="server" ID="bag" style="z-index:120px;top:-66px;left:204px; position:absolute;">
<asp:ListItem Style="z-index: 100; left: 504px; position: absolute;top: 645px" Height="15px" Width="65px" Text="Yes" >asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 574px; position: absolute;top: 644px" Height="15px" Width="65px" Text="No" >asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList runat="server" ID="antivirus" style="z-index:120px;top:-24px;left:205px; position:absolute;">
<asp:ListItem Style="z-index: 100; left: 500px; position: absolute;top: 673px" Height="15px" Width="65px" Text="Yes">asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 572px; position: absolute;top: 670px" Height="15px" Width="65px" Text="No" >asp:ListItem>
asp:RadioButtonList>
<asp:RadioButtonList runat="server" ID="wifi" style="z-index:120px;top:-178px;left:200px; position:absolute;">
<asp:ListItem Style="z-index: 100; left: 505px; position: absolute;top: 569px" Height="15px" Width="65px" Text="Yes">asp:ListItem>
<asp:ListItem Style="z-index: 100; left: 577px; position: absolute;top: 570px" Height="15px" Width="65px" Text="No">asp:ListItem>
asp:RadioButtonList>
<asp:Label ID="Label31" runat="server" Style="z-index: 100; left: 275px; position: absolute;top: 325px" Width="514px" >To Begin Update Enter Model No in Below TextBox and Click to Update Buttonasp:Label>
<asp:TextBox ID="ModelSearch" runat="server" Style="z-index: 100; left: 340px; position: absolute;top: 350px" Width="176px" >asp:TextBox>
<asp:Button ID="ButtonModel" runat="server" Text="Update Model" Style="z-index: 100; left: 547px; position: absolute;top: 348px" Width="130px" OnClick="ButtonModel_Click" />
<asp:Button ID="UpdateProduct" runat="server" Text="Update Product" Style="z-index: 100; left: 444px; position: absolute;top: 718px" OnClick="UpdateProduct_Click" />
div>
form>
body>
html>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class update : System.Web.UI.Page
{
SqlConnection db = new SqlConnection("database=laptop;server=.;uid=sa;");
SqlCommand cmd = new SqlCommand();
SqlDataReader dr;
protected void Page_Load(object sender, EventArgs e)
{
invisible();
brand();
}
void brand()
{
db.Open();
cmd.Connection = db;
cmd.CommandText = "select * from product where brand='" + Brand1.SelectedItem.Text + "'";
dr = cmd.ExecuteReader();
ModelNo1.DataSource = dr;
ModelNo1.DataValueField = "modelno";
ModelNo1.DataTextField = "modelno";
ModelNo1.DataBind();
db.Close();
}
void invisible()
{
Label10.Visible = false;
Label11.Visible = false;
Label12.Visible = false;
Label13.Visible = false;
Label14.Visible = false;
Label15.Visible = false;
Label16.Visible = false;
Label17.Visible = false;
Label18.Visible = false;
Label19.Visible = false;
Label20.Visible = false;
Label21.Visible = false;
Label22.Visible = false;
Label23.Visible = false;
Label25.Visible = false;
Label27.Visible = false;
Label28.Visible = false;
Label29.Visible = false;
Label30.Visible = false;
Label39.Visible = false;
price.Visible = false;
HDD.Visible = false;
RAM.Visible = false;
Processor.Visible = false;
display.Visible = false;
graphicscard.Visible = false;
dvd.Visible = false;
warranty.Visible = false;
OS.Visible = false;
color.Visible = false;
wifi.Visible = false;
cardreader.Visible = false;
bag.Visible = false;
antivirus.Visible = false;
camera.Visible = false;
UpdateProduct.Visible = false;
}
void visible()
{
UpdateProduct.Visible = true;
Label10.Visible = true;
Label11.Visible = true;
Label12.Visible = true;
Label13.Visible = true;
Label14.Visible = true;
Label15.Visible = true;
Label16.Visible = true;
Label17.Visible = true;
Label18.Visible = true;
Label19.Visible = true;
Label20.Visible = true;
Label21.Visible = true;
Label22.Visible = true;
Label23.Visible = true;
Label25.Visible = true;
Label27.Visible = true;
Label28.Visible = true;
Label29.Visible = true;
Label30.Visible = true;
Label39.Visible = true;
price.Visible = true;
HDD.Visible = true;
RAM.Visible = true;
Processor.Visible = true;
display.Visible = true;
graphicscard.Visible = true;
dvd.Visible = true;
warranty.Visible = true;
OS.Visible = true;
color.Visible = true;
wifi.Visible = true;
cardreader.Visible = true;
bag.Visible = true;
antivirus.Visible = true;
camera.Visible = true;
}
protected void ButtonModel_Click(object sender, EventArgs e)
{
db.Open();
cmd.Connection = db;
cmd.CommandText = "select * from product where brand='" + Brand1.SelectedItem.Text + "' and modelno='" + ModelSearch.Text + "'";
dr = cmd.ExecuteReader();
if (dr.Read())
{
visible();
price.Text = dr[1].ToString();
HDD.Text = dr[2].ToString();
RAM.Text = dr[3].ToString();
Processor.Text = dr[4].ToString();
display.Text = dr[5].ToString();
graphicscard.Text = dr[6].ToString();
dvd.Text = dr[7].ToString();
warranty.Text = dr[9].ToString();
OS.Text = dr[10].ToString();
color.Text = dr[11].ToString();
wifi.Text = dr[12].ToString();
camera.Text = dr[13].ToString();
cardreader.Text = dr[14].ToString();
bag.Text = dr[15].ToString();
antivirus.Text = dr[16].ToString();
}
else
{
Response.Write("");
}
}
protected void UpdateProduct_Click(object sender, EventArgs e)
{
db.Open();
cmd.Connection = db;
cmd.CommandText = "update product set price='" + price.Text + "',hdd='" + HDD.Text + "',ram='" + RAM.Text + "',processor='" + Processor.Text + "',display='" + display.Text + "',graphicscard='" + graphicscard.Text + "',dvd='" + dvd.Text + "',warranty='" + warranty.Text + "',os='" + OS.Text + "',color='" + color.Text + "',wifi='" + wifi.Text + "',webcam='" + camera.Text + "',cardread='" + cardreader.Text + "',bag='" + bag.Text + "',antivirus='" + antivirus.Text + "' where brand='" + Brand1.SelectedItem.Text + "' and modelno='" + ModelSearch.Text + "' ";
cmd.ExecuteNonQuery();
db.Close();
Response.Write("");
}
}
For Further Reading,
0 comments:
Post a Comment