You are on page 1of 50

Name :-RAMANI ANSH K.

Roll No:- 280


Division:- TYBCA-D

 INTRODUCTION :-

 E-commerce is fast gaining ground as an accepted and used business paradigm.

More and more business houses are implementing web sites providing

functionality for performing commercial transactions over the web. It is

reasonable to say that the process of shopping on the web is becoming

commonplace.

 The objective of this project is to develop a general purpose e-commerce store

where any kind of product can be bought from the comfort of home through the

Internet. However, for implementation purposes, this paper will deal with an

online shopping for baby product

 An online store is a virtual store on the Internet where customers can browse the

catalog and select products of interest. The selected items may be collected in a

shopping cart. At checkout time, the items in the shopping cart will be presented

as an order. At that time, more information will be needed to complete the

transaction. Usually, the customer will be asked to fill select billing address, a

Page 1
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

shipping or a address, a shipping option, and payment information such as

bKash, or Cash on Delivery. An e-mail notification is sent to the customer as

soon as the order is placed.

Page 2
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

 PROJECT DESCRIPTION
 Any member can register and view available products. Only registered member can
purchase multiple products regardless of quantity.

 Contact Us page is available to contact Admin for queries.

 There are four roles available:

 Visitor

 User

 Operator

 Admin.

Visitor can view, search, compare available products.

 User can view and purchase products.

 Operator can excess add option and can view everything of admin panel.

 Operator can add product, edit product, update and remove product.Can access
users some information.

 Operator can ship order to user based on order placed by sending confirmation
mail.

 An Admin has some extra privilege including all privilege of visitor and user.

 Admin can add products, edit product information and add/remove product.
Admin can add user, edit user information and can remove user.

 Admin can ship order to user based on order placed by sending confirmation mail.

Page 3
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

 Scope of online selling:-


 Before we launch into the future and scope of eCommerce in India, let us first
understand what is e-commerce. To put it simply, electronic commerce refers to the
purchase and sale of goods online or via the internet.

 Sellers make websites where they display images of their products with price and
description. Shoppers who buy the products have multiple payment options like
COD, e-wallet, net banking, credit card, and so on.

 Online sellers have the responsibility of shipping the product to the buyer and
ensuring safe and timely delivery. 

 There are different models of E-Commerce:

 B2C – Business to consumer; this refers to the sale of goods to the end-user
directly

o B2B – a business that sells to another business; for example, office


equipment, wholesalers, construction equipment sellers.

o B2G – Businesses that sell or deal only with Government organizations.

o C2B – this is when a customer creates something that adds value to a


business, and the business consumes it. The best example is positive customer
reviews.

 Today with the high penetration of the internet and mobile devices – currently there
are about 776.45 million internet connections in India – it has also become very
easy to buy and sell online.

Page 4
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

 The Importance of e-Commerce :-


 E-Commerce has grown in importance because of all the advantages it offers to
sellers and buyers. It is especially relevant in the current scenario of the Covid-19
pandemic when there are nationwide lockdowns.
 Even traditional retailers hurriedly created online stores to maintain business
continuity during the pandemic. This augurs well for the scope of e-commerce all
over the world. Everything from groceries to sports equipment can now be bought
online.
 Globally, e-commerce sales increased by 77% over the previous year. In India
alone, eCommerce is growing at about 51% annually. 
 E-Commerce enables manufacturers and traders from remote, rural places to sell
their products online; their own local markets may be too small, and not have the
kind of consumers the seller needs.
 Thanks to online selling, these businesses can sell to customers in any corner of the
country; for example, a farmer in Maharashtra can sell his Jowar or Bajra to a
consumer in say Kerala. This would be near impossible without E-commerce.
 This means that people who live in areas where a particular thing is not available
locally, can easily get it online – that is the nature of E-commerce.

Page 5
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

 Database :-

 Table name: tbladmin.sql


 Description: This Table gives detail about admin
information

 Table name: tblbrand.sql


 Description: This Table gives detail about product
brand information

Page 6
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

 Table name: tblcat.sql


 Description: This Table gives detail about product
categories information

 Table name: tblpro.sql


 Description: This Table gives detail about product
information

Page 7
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

 Table name: tblsubcat.sql


 Description: This Table gives detail about sub
categories information

 Table name: tbluser.sql


 Description: This Table gives detail about user
information

Page 8
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

 ADMIN SIDE:-
Admin.Master.aspx

<%@ Master Language="VB" AutoEventWireup="true" CodeBehind="Admin.Master.cs" Inherits="WebApplication2.Site1" %>

<!DOCTYPE html>

<html>
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">

<!-- Favicon -->


<link href="../img/favicon.ico" rel="icon">

<!-- Google Web Fonts -->


<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

Page 9
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

<link href="https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&display=swap" rel="stylesheet">

<!-- Icon Font Stylesheet -->


<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet">

<!-- Libraries Stylesheet -->


<link href="../lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="../lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" />

<!-- Customized Bootstrap Stylesheet -->


<link href="../css/bootstrap.min.css" rel="stylesheet">

<!-- Template Stylesheet -->


<link href="../css/style.css" rel="stylesheet">
</head>
<body>
<form id="form1" runat="server">
<div class="container-xxl position-relative bg-white d-flex p-0">
<!-- Spinner Start -->
<div id="spinner" class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center
justify-content-center">
<div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<!-- Spinner End -->

<!-- Sidebar Start -->


<div class="sidebar pe-4 pb-3">
<nav class="navbar bg-light navbar-light">
<a class="navbar-brand mx-4 mb-3">
<h3 class="text-primary">AdminPage</h3>
</a>
<div class="navbar-nav w-100">
<a href="Dashboard.aspx" class="nav-item nav-link ">Dashboard</a>
<a href="catagories.aspx" class="nav-item nav-link" >Catagories</a>
<a href="subcategories.aspx" class="nav-item nav-link">Sub-Catagories</a>
<a href="managebrand.aspx" class="nav-item nav-link">Manage Brand</a>
<a href="manageproduct.aspx" class="nav-item nav-link">Manage Product</a>
<a href="viewuser.aspx" class="nav-item nav-link">View User</a>
</div>
</nav>
</div>
<!-- Sidebar End -->

Page 10
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

<!-- Content Start -->


<div class="content">
<!-- Navbar Start -->
<nav class="navbar navbar-expand bg-light navbar-light sticky-top px-4 py-0">
<a href="index.html" class="navbar-brand d-flex d-lg-none me-4">
<h2 class="text-primary mb-0"><i class="fa fa-hashtag"></i></h2>
</a>
<a href="#" class="sidebar-toggler flex-shrink-0">
<i class="fa fa-bars"></i>
</a>
<div class="navbar-nav align-items-center ms-auto">
<div class="nav-item dropdown">

<div class="dropdown-menu dropdown-menu-end bg-light border-0 rounded-0 rounded-bottom m-0">


<div class="d-flex align-items-center">
<img class="rounded-circle" src="../img/user.jpg" alt="" style="width: 40px; height: 40px;">
<div class="ms-2">

</div>
</div>
<div class="d-flex align-items-center">
<div class="ms-2">
</div>
</div>
<div class="d-flex align-items-center">
</div>
</div>
</div>
<div class="nav-item dropdown">
<div class="dropdown-menu dropdown-menu-end bg-light border-0 rounded-0 rounded-bottom m-0">
</div>
</div>
<div class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
<asp:Label runat="server" ID="adminlb" ></asp:Label>
</a>
<div class="dropdown-menu dropdown-menu-end bg-light border-0 rounded-0 rounded-bottom m-0">
<a href="#" class="dropdown-item">My Profile</a>
<a href="login.aspx" class="dropdown-item">Log Out</a>
</div>
</div>
</div>
</nav>
<!-- Navbar End ->
<!-- Admin Page -->
<div>
<asp:ContentPlaceHolder ID="mainBody" runat="server">

Page 11
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

</asp:ContentPlaceHolder>
</div>
<!-- Back to Top -->
<a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a>
</div>

<!-- JavaScript Libraries -->


<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="../lib/chart/chart.min.js"></script>
<script src="../lib/easing/easing.min.js"></script>
<script src="../lib/waypoints/waypoints.min.js"></script>
<script src="../lib/owlcarousel/owl.carousel.min.js"></script>
<script src="../lib/tempusdominus/js/moment.min.js"></script>
<script src="../lib/tempusdominus/js/moment-timezone.min.js"></script>
<script src="../lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js"></script>

<!-- Template Javascript -->


<script src="../js/main.js"></script>
</form>
</body>
</html>

Admin.aspx.vb
Imports System

Namespace WebApplication2
Public Partial Class Site1
Inherits System.Web.UI.MasterPage

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


Try
If Session("ADMIN") Is Nothing Then
Response.Redirect("login.aspx")
End If
revalidate

Page 12
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

");" If True Then


Response.AddHeader("Cache-Control", "no-cache, no-store, max-age=0, must-",
Response.AddHeader("Pragma", "no-cache"))
adminlb.Text = Session("ADMIN").ToString()
End If
Catch ex As Exception
Response.Write(ex)
End Try
End Sub
End Class
End Namespace
Login.aspx

<%@ Page Language="vb” AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="WebApplication2.ADMIN.login" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Login Page</title>

<meta charset="utf-8">
<title>DASHMIN - Bootstrap Admin Template</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">

Page 13
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

<meta content="" name="description">

<!-- Favicon -->


<link href="../img/favicon.ico" rel="icon">

<!-- Google Web Fonts -->


<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&display=swap" rel="stylesheet">

<!-- Icon Font Stylesheet -->


<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet">

<!-- Libraries Stylesheet -->


<link href="../lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="../lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" />

<!-- Customized Bootstrap Stylesheet -->


<link href="../css/bootstrap.min.css" rel="stylesheet" />

<!-- Template Stylesheet -->


<link href="../css/style.css" rel="stylesheet" />
</head>

<body><form runat="server" >


<div class="container-xxl position-relative bg-white d-flex p-0">
<!-- Spinner Start -->
<div id="spinner" class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center
justify-content-center">
<div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<!-- Spinner End -->

<!-- Sign In Start -->


<div class="container-fluid">
<div class="row h-100 align-items-center justify-content-center" style="min-height: 100vh;">
<div class="col-12 col-sm-8 col-md-6 col-lg-5 col-xl-4">
<div class="bg-light rounded p-4 p-sm-5 my-4 mx-3">
<div class="d-flex align-items-center justify-content-between mb-3">

<h3>Sign In</h3>
</div>
<div class="form-floating mb-3">
<input type="email" class="form-control" id="txtusname" runat="server" placeholder="place@example.com"/>
<label >Email address</label>
</div>
<div class="form-floating mb-4">
<input type="password" class="form-control" id="txtpass" runat="server" placeholder="Password"/>
<label >Password</label>
</div>
<div class="d-flex align-items-center justify-content-between mb-4">

<asp:button type="submit" runat="server" class="btn btn-primary py-3 w-100 mb-4" Text="SIGN IN" ID="btnSubmit"
OnClick="btnSubmit_Click1"></asp:button>

Page 14
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

</div>
</div>
</div>
</div>
<!-- Sign In End -->
</div>

<!-- JavaScript Libraries -->


<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="../lib/chart/chart.min.js"></script>
<script src="../lib/easing/easing.min.js"></script>
<script src="../lib/waypoints/waypoints.min.js"></script>
<script src="../lib/owlcarousel/owl.carousel.min.js"></script>
<script src="../lib/tempusdominus/js/moment.min.js"></script>
<script src="../lib/tempusdominus/js/moment-timezone.min.js"></script>
<script src="../lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js"></script>

<!-- Template Javascript -->


<script src="../js/main.js"></script></form>
</body>

</html>

Description:-
A login screen is a web page or an entry page to a web application that requires user
identification and authentication, regularly performed by entering a username and password
combination. The login process is the most essential feature for any system/application as it
provides access to an entire web-site or part of it. So, testing of the login screen needs complete
coverage.

Login.aspx.vb

Imports System
Imports System.Data.SqlClient
Imports System.Configuration

Namespace WebApplication2.ADMIN
Public Partial Class login
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


End Sub

Protected Sub btnSubmit_Click1(ByVal sender As Object, ByVal e As


EventArgs)
Try
conn.Open()
Dim qur As String = "select * from tbladmin where username ='" &

Page 15
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

txtusname.Value & "'"


Dim password As [and] = """"c
";"
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
Dim dr As SqlDataReader = cmd.ExecuteReader()

If dr.Read() Then
Session("ADMIN") = dr(2).ToString()
Else
incorrect
")"c
End If

Response.Redirect("../admin/Dashboard.aspx")
Response.Write("<script>alert('Username & password are")
Catch ex As Exception
Response.Write(ex.Message)
Finally
End Try
End Sub
End Class
End Namespaceconn.Close();}}}}

DashBoard.aspx

<%@ Page Title="" Language="vb" MasterPageFile="~/ADMIN/Admin.Master" AutoEventWireup="true"


CodeBehind="Dashboard.aspx.cs" Inherits="WebApplication2.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

Page 16
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

</asp:Content>
<asp:Content ID ="Content2" ContentPlaceHolderID="mainBody" runat="server">

</asp:Content>
Description:-
Successful online selling businesses need to optimize every stage of the customer journey, from first touch to
purchase. Ecommerce dashboards aggregate the most important performance metrics, so online sellers can track
their progress and quickly respond to any changes.

DashBoard.aspx.vb
Imports System.Data.SqlClient

Imports System.Configuration

Namespace WebApplication2

Public Partial Class WebForm1

Inherits System.Web.UI.Page

Private conn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

If Not IsPostBack Then

conn.Open()

Dim q As String = "select count(userid) from tbluser"

Dim cmd As SqlCommand = New SqlCommand(q, conn)

Dim dr As SqlDataReader = cmd.ExecuteReader()

If dr.Read() Then

lbltotaluser.Text = dr(0).ToString()

End If

End If

End Sub

End Class

End Namespace

Page 17
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Categories.aspx

<%@ Page Title="" Language="vb" MasterPageFile="~/ADMIN/Admin.Master" AutoEventWireup="true" CodeBehind="catagories.aspx.cs"


Inherits="WebApplication2.ADMIN.catogories" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainBody" runat="server">
<div class="form-floating mb-3">
</div>
<div class="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<h5 class="mb-4"> Categories</h5>
<asp:HiddenField runat="server" ID="hdnid" />
<div class="mb-3">
<label for="Name" class="form-label">Name</label>
<asp:TextBox runat="server" ID="catname" CssClass="form-control"></asp:TextBox>
</div>
<div class="mb-3">
<asp:Label runat="server" Text="Description:"></asp:Label><br/>
<asp:TextBox runat="server" TextMode="MultiLine" ID="des" CssClass="form-control" Rows="4"></asp:TextBox>
<div class="form-floating mb-3">
<asp:Label runat="server" Text="File Upload:"></asp:Label><br/>
<div class="mb-3">
<asp:FileUpload runat="server" ID="Fileupload" CssClass="form-control"/><br/>
<asp:Image runat="server" ID="catimg" Height="100px" Width="100px" Visible="false"/>
</div>

</div>
</div>
<asp:Button runat="server" class="btn btn-primary" Text="Submit" ID="txtsubmit" OnClick="txtsubmit_Click"/>
<asp:Button runat="server" CssClass=" btn btn-primary" Text="Update" ID="btnupdate" Visible="false"
OnClick="btnupdate_Click"/>

Page 18
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

</div>
</div>
</div>
</div>
<div class ="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<h5>CATEGORIES TABLE</h5>
<asp:GridView CssClass="table table-bordered" runat="server" ID="catgrid" AutoGenerateColumns="false"
AutoGenerateDeleteButton="True" OnRowDeleting="catgrid_RowDeleting" DataKeyNames="catid" OnRowEditing="catgrid_RowEditing"
AutoGenerateEditButton="true" Width="983px" >
<Columns>
<asp:BoundField DataField="catid" HeaderText="ID" />
<asp:BoundField DataField="name" HeaderText="Name" />
<asp:BoundField DataField="des" HeaderText="Description" />
<asp:ImageField DataImageUrlField="image" HeaderText="Image" ItemStyle-HorizontalAlign="Center" ControlStyle-
Height="100" ControlStyle-Width="100"></asp:ImageField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</asp:Content>
Description:-

An ecommerce product page is a page on a website that defines a product and its features in its entirety.
This includes features like price, sizes, specs, colour, manufacturer and more

Categories.aspx.vb
Imports System

Imports System.Collections.Generic

Imports System.Linq

Imports System.Web

Imports System.Web.UI

Imports System.Web.UI.WebControls

Imports System.Data.SqlClient

Imports System.Data

Imports System.Configuration

Namespace WebApplication2.ADMIN

Public Partial Class catogories

Page 19
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

If Not IsPostBack Then

filldata0()

End If

End Sub

Protected Sub txtsubmit_Click(ByVal sender As Object, ByVal e As EventArgs)

Try

If Fileupload.HasFile Then

Dim str As String = Fileupload.FileName

Fileupload.PostedFile.SaveAs(Server.MapPath("../photo/catphoto/" & str))

Dim image As String = "../photo/catphoto/" & str.ToString()

conn.Open()

Dim qur As String = "insert into tblcat values ('" & catname.Text & "','" + des.Text & "','" &
image & "') "

Dim cmd As SqlCommand = New SqlCommand(qur, conn)

cmd.ExecuteNonQuery()

conn.Close()

Else

Response.Write("<script>alert('Fill all the forms')</script>")

End If

filldata0()

Catch ex As Exception

Response.Write(ex)

End Try

End Sub

Private Sub filldata0()

If conn.State = ConnectionState.Closed Then

conn.Open()

Page 20
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

End If

Dim cmd As SqlCommand = New SqlCommand("select catid , name , des, image from tblcat",
conn)

Dim sda As SqlDataAdapter = New SqlDataAdapter(cmd)

Dim ds As DataSet = New DataSet()

sda.Fill(ds)

catgrid.DataSource = ds

catgrid.DataBind()

conn.Close()

End Sub

Protected Sub catgrid_RowDeleting(ByVal sender As Object, ByVal e As


GridViewDeleteEventArgs)

Try If conn.State = ConnectionState.Closed Then

conn.Open()

End If

Dim qur As String = "Delete from tblcat where catid= " & e.Keys(0)

Dim cmd As SqlCommand = New SqlCommand(qur, conn)

cmd.ExecuteNonQuery()

filldata0()

Catch ex As Exception

Response.Write("<script>alert('You can't delete the category without deleting all its


product')</script>")

Response.AppendToLog(ex.ToString())

Finally

conn.Close()

End Try

End Sub

Protected Sub catgrid_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs)

catgrid.EditIndex = -1

hdnid.Value = catgrid.DataKeys(e.NewEditIndex).Value.ToString()

Page 21
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

catname.Text = catgrid.Rows(e.NewEditIndex).Cells(2).Text

des.Text = catgrid.Rows(e.NewEditIndex).Cells(3).Text

btnupdate.Visible = True

txtsubmit.Visible = False

End Sub

Protected Sub btnupdate_Click(ByVal sender As Object, ByVal e As EventArgs)

If conn.State = ConnectionState.Closed Then

conn.Open()

End If

Try

Dim str As String = Fileupload.FileName

Fileupload.PostedFile.SaveAs(Server.MapPath("../photo/catphoto/" & str))

Dim image As String = "../photo/catphoto/" & str.ToString()

Dim qur As String = $"update tblcat set name='{catname.Text}', des ='{des.Text}',image


='{image}' where catid = {hdnid.Value}"

Dim cmd As SqlCommand = New SqlCommand(qur, conn)

cmd.ExecuteNonQuery()

filldata0()

txtsubmit.Visible = True

btnupdate.Visible = False

Catch ex As Exception

Response.Write(ex)

Finally

conn.Close()

End Try

End Sub

End Class

End Namespace

Page 22
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

 subcategories.aspx

<%@ Page Title="" Language="vb" MasterPageFile="~/ADMIN/Admin.Master" AutoEventWireup="true"


CodeBehind="subcategories.aspx.cs" Inherits="WebApplication2.ADMIN.subcategories" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainBody" runat="server">
<div class="form-floating mb-3">
</div>
<div class="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<h5 class="mb-4"> Sub-Categories</h5>
<div class="mb-3">
<label for="Name" class="form-label">Select Category</label>
<asp:DropDownList runat="server" ID="ddlcatname" CssClass="form-control"></asp:DropDownList>
</div>
<div class="mb-3">
<asp:Label runat="server" Text="Description:"></asp:Label><br/>
<asp:TextBox runat="server" TextMode="MultiLine" ID="des" CssClass="form-control" Rows="4"
></asp:TextBox>
<div class="form-floating mb-3">

Page 23
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

<asp:Label runat="server" Text="File Upload:"></asp:Label><br/>


<div class="mb-3">
<asp:FileUpload runat="server" ID="Fileupload" CssClass="form-control"/><br/>
</div></div>
</div>
<asp:Button runat="server" class="btn btn-primary" Text="Submit" ID="btnsubmit"
OnClick="btnsubmit_Click" />
</div>
</div>
</div>
</div>
<div class ="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<h5>CATEGORIES TABLE</h5>
<asp:GridView CssClass="table table-bordered" DataKeyNames="subcatid" runat="server" ID="subcatgrid"
AutoGenerateColumns="false" AutoGenerateDeleteButton="True" AutoGenerateEditButton="true"
OnRowDeleting="subcatgrid_RowDeleting" OnRowEditing="subcatgrid_RowEditing" Width="983px" >
<Columns>
<asp:BoundField DataField="subcatid" HeaderText="ID" />
<asp:BoundField DataField="name" HeaderText="Name" />
<asp:BoundField DataField="des" HeaderText="Description" />
<asp:BoundField DataField="catid" HeaderText="CategoryId" />
<asp:ImageField DataImageUrlField="image" HeaderText="Image" ItemStyle-
HorizontalAlign="Center" ControlStyle-Height="100" ControlStyle-Width="100"></asp:ImageField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</asp:Content>

Description:-
To guide shoppers even further, you could then create subcategories, such as “Jeans” and “Khakis”
under the “Pants” category. Or, if you’re selling various brands of the same product, you could create
subcategories to highlight these differences.

Subcategories.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Data.SqlClient
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Configuration

Page 24
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Namespace WebApplication2.ADMIN
Public Partial Class subcategories
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


If Not IsPostBack Then
ddlfilldata()
fillgrid0()
End If
End Sub

Private Sub ddlfilldata()


conn.Open()
Dim str As String = "select * from tblcat"
Dim cmd As SqlCommand = New SqlCommand(str, conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
ddlcatname.DataSource = ds
ddlcatname.DataValueField = ds.Tables(0).Columns("catid").ToString()
ddlcatname.DataTextField = ds.Tables(0).Columns("name").ToString()
ddlcatname.DataBind()
ddlcatname.Items.Insert(0, New ListItem("--Select--", "0"))
conn.Close()
End Sub

Private Sub fillgrid0()


If conn.State = ConnectionState.Closed Then
conn.Open()
End If

Try
Dim cmd As SqlCommand = New SqlCommand("select * from tblsucat", conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
subcatgrid.DataSource = ds
subcatgrid.DataBind()
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub

Page 25
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As EventArgs)


Try

If Fileupload.HasFile Then
Dim str As String = Fileupload.FileName
Fileupload.PostedFile.SaveAs(Server.MapPath("../photo/subcatphoto/" & str))
Dim image As String = "../photo/subcatphoto/" & str.ToString()
conn.Open()
Dim qur As String = "insert into tblsucat values ('" &
ddlcatname.SelectedItem.ToString() & "','" + des.Text & "','" & image & "','" +
ddlcatname.SelectedValue & "') "
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
Else
Response.Write("<script>alert('Fill all the forms')</script>")
End If

fillgrid0()
Catch xe As Exception
Response.Write(xe)
End Try
End Sub

Protected Sub subcatgrid_RowDeleting(ByVal sender As Object, ByVal e As


GridViewDeleteEventArgs)
Try
conn.Open()
Dim qur As String = "delete from tblsucat where subcatid=" & e.Keys(0)
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
fillgrid0()
Catch ex As Exception
Response.Write("<script>alert('You can't delete the category without deleting all its
product')</script>")
Response.AppendToLog(ex.ToString())
Finally
conn.Close()
End Try
End Sub

Protected Sub subcatgrid_RowEditing(ByVal sender As Object, ByVal e As


GridViewEditEventArgs)
subcatgrid.EditIndex = -1
End Sub
End Class

Page 26
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

End Namespace

Managebrand.aspx

<%@ Page Title="" Language="vb" MasterPageFile="~/ADMIN/Admin.Master" AutoEventWireup="true"


CodeBehind="managebrand.aspx.cs" Inherits="WebApplication2.ADMIN.managebrand" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainBody" runat="server">
<div class="form-floating mb-3">
</div>
<div class="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<h5 class="mb-4"> Manage Brand</h5>
<div class="mb-3">
<label for="Name" class="form-label">Brand Name</label>
<asp:TextBox runat="server" ID="brandname" CssClass="form-control"></asp:TextBox>

Page 27
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

</div>
<div class="mb-3">
<asp:Label runat="server" Text="Description:"></asp:Label><br/>
<asp:TextBox runat="server" TextMode="MultiLine" ID="des" CssClass="form-control"
Rows="4"></asp:TextBox>
<div class="form-floating mb-3">
<asp:Label runat="server" Text="File Upload:"></asp:Label><br/>
<div class="mb-3">
<asp:FileUpload runat="server" ID="Fileupload" CssClass="form-control"/>
</div>
</div>
</div>
<asp:Button runat="server" ID="btnsubmit" class="btn btn-primary" Text="Submit"
OnClick="btnsubmit_Click"/>
</div>
</div>
</div>
</div>
<div class ="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<asp:GridView CssClass="table table-bordered" DataKeyNames="brandid" runat="server"
ID="brandgrid" AutoGenerateColumns="false" AutoGenerateDeleteButton="True" AutoGenerateEditButton="true"
OnRowDeleting="subcatgrid_RowDeleting" OnRowEditing="subcatgrid_RowEditing" Width="983px" >
<Columns>
<asp:BoundField DataField="brandid" HeaderText="ID" />
<asp:BoundField DataField="name" HeaderText="Name" />
<asp:BoundField DataField="des" HeaderText="Description" />
<asp:ImageField DataImageUrlField="logo" HeaderText="Image" ItemStyle-
HorizontalAlign="Center" ControlStyle-Height="100" ControlStyle-Width="100"></asp:ImageField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</asp:Content>

Description:-
Page 28
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

This page manage diffrentes types of brand by admin side.

ManageBrand.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Data.SqlClient
Imports System.Data
Imports System.Web.UI.WebControls
Imports System.Configuration

Namespace WebApplication2.ADMIN
Public Partial Class managebrand
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


If Not IsPostBack Then
fillgrid0()
End If
End Sub

Private Sub fillgrid0()


If conn.State = ConnectionState.Closed Then
conn.Open()
End If

Try
Dim cmd As SqlCommand = New SqlCommand("select * from tblbrand", conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
brandgrid.DataSource = ds
brandgrid.DataBind()
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub

Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As EventArgs)


Try

If Fileupload.HasFile Then

Page 29
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Dim str As String = Fileupload.FileName


Fileupload.PostedFile.SaveAs(Server.MapPath("../photo/brandphoto/" & str))
Dim image As String = "../photo/brandphoto/" & str.ToString()
conn.Open()
Dim qur As String = "insert into tblbrand values('" & brandname.Text & "','" + des.Text & "','"
& image & "')"
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
Else
Response.Write("<script>alert('Fill all the forms')</script>")
End If

fillgrid0()
Catch xe As Exception
Response.Write(xe)
End Try
End Sub

Protected Sub subcatgrid_RowDeleting(ByVal sender As Object, ByVal e As


GridViewDeleteEventArgs)
conn.Open()
Dim qur As String = "Delete from tblbrand where brandid= " & e.Keys(0)
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
fillgrid0()
End Sub

Protected Sub subcatgrid_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs)


brandgrid.EditIndex = -1
End Sub
End Class
End Namespace

Page 30
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

ManageProducts.aspx

<%@ Page Title="" Language="vb" MasterPageFile="~/ADMIN/Admin.Master" AutoEventWireup="true"


CodeBehind="manageproduct.aspx.cs" Inherits="WebApplication2.ADMIN.manageproduct" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainBody" runat="server">
<div class="form-floating mb-3">
</div>
<div class="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<h5 class="mb-4"> Manage Product</h5>
<div class="mb-3">
<label for="Name" class="form-label">Product Name</label>
<asp:TextBox runat="server" ID="proname" CssClass="form-control"></asp:TextBox>
</div>
<div class="mb-3">
<asp:Label runat="server" Text="Description:"></asp:Label><br/>
<asp:TextBox runat="server" TextMode="MultiLine" ID="des" CssClass="form-control"
Rows="4"></asp:TextBox>
Page 31
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

<asp:Label runat="server" Text="Price:"></asp:Label><br/>


<asp:TextBox runat="server" ID="price" CssClass="form-control"></asp:TextBox>
<asp:Label runat="server" Text="Quantity:"></asp:Label><br/>
<asp:TextBox runat="server" ID="quantity" CssClass="form-control"></asp:TextBox>
<label for="Name" class="form-label">Category</label>
<asp:DropDownList runat="server" ID="category" AutoPostBack ="True" CssClass="form-control"
OnSelectedIndexChanged="category_SelectedIndexChanged1"></asp:DropDownList>
<label for="Name" class="form-label">Sub-Category</label>
<asp:DropDownList runat="server" ID="subcat" CssClass="form-control" DataTextField="name"
DataValueField="subcatid"></asp:DropDownList>
<label for="Name" class="form-label">Brand</label>
<asp:DropDownList runat="server" ID="brand" CssClass="form-control"></asp:DropDownList>
<div class="form-floating mb-3">
<asp:Label runat="server" Text="File Upload:"></asp:Label><br/>
<div class="mb-3">
<asp:FileUpload runat="server" ID="Fileupload" CssClass="form-control"/>

</div>
</div>
</div>
<asp:Button runat="server" class="btn btn-primary" Text="Submit" ID="btnsubmit"
OnClick="btnsubmit_Click1"/>
</div>
</div>
</div>
</div>

<div class ="container-fluid pt-4 px-4">


<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<asp:GridView runat="server" ID="productgrid" CssClass="table table-bordered"
AutoGenerateColumns="false" AutoGenerateDeleteButton="true" AutoGenerateEditButton="true"
DataKeyNames="productid" >
<Columns>
<asp:BoundField DataField="productid" HeaderText="ID"/>
<asp:BoundField DataField="name" HeaderText="Name"/>
<asp:BoundField DataField="cat" HeaderText="Category"/>
<asp:BoundField DataField="sub" HeaderText="Sub-Category"/>
<asp:BoundField DataField="brand" HeaderText="Brand"/>
<asp:BoundField DataField="dec" HeaderText="Description"/>
Page 32
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

<asp:BoundField DataField="price" HeaderText="Price"/>


<asp:BoundField DataField="qty" HeaderText="Qty"/>
<asp:ImageField DataImageUrlField="image" HeaderText="Image" ItemStyle-
HorizontalAlign="Center" ControlStyle-Height="100" ControlStyle-Width="100"></asp:ImageField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</asp:Content>

Description:-
Here we present a selection of product pages from retailers, with some examples of great design, use of
imagery, and some key features that make these pages more effective.

ManageProducts.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration

Namespace WebApplication2.ADMIN
Public Partial Class manageproduct
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


If Not IsPostBack Then
filldata0()
fillcat()
fillbrand()
End If
End Sub

Private Sub filldata0()


conn.Open()
Dim cmd As SqlCommand = New SqlCommand("select productid, name, dec, price, qty, image,

Page 33
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

(SELECT name FROM tblcat WHERE tblcat.catid=tblpro.catid) AS cat, (SELECT name FROM tblsucat
WHERE tblsucat.subcatid=tblpro.subcatid) AS sub, (SELECT name FROM tblbrand WHERE
tblbrand.brandid=tblpro.brandid) AS brand from tblpro", conn)
Dim sda As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
sda.Fill(ds)
productgrid.DataSource = ds
productgrid.DataBind()
conn.Close()
End Sub

Private Sub fillcat()


conn.Open()
Dim str As String = "select * from tblcat"
Dim cmd As SqlCommand = New SqlCommand(str, conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
category.DataSource = ds
category.DataValueField = ds.Tables(0).Columns("catid").ToString()
category.DataTextField = ds.Tables(0).Columns("name").ToString()
category.DataBind()
category.Items.Insert(0, New ListItem("--Select Category--", "0"))
conn.Close()
End Sub

Private Sub fillbrand()


conn.Open()
Dim str As String = "select * from tblbrand"
Dim cmd As SqlCommand = New SqlCommand(str, conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
brand.DataSource = ds
brand.DataValueField = ds.Tables(0).Columns("brandid").ToString()
brand.DataTextField = ds.Tables(0).Columns("name").ToString()
brand.DataBind()
brand.Items.Insert(0, New ListItem("--Select Brand--", "0"))
conn.Close()
End Sub

Protected Sub category_SelectedIndexChanged1(ByVal sender As Object, ByVal e As EventArgs)


subcat.Enabled = True
If conn.State = ConnectionState.Closed Then conn.Open()
Dim query As String = "SELECT subcatid , name FROM tblsucat WHERE catid=" &
category.SelectedValue
Dim cmd As SqlCommand = New SqlCommand(query, conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
subcat.DataSource = ds
subcat.DataBind()
Page 34
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

subcat.Items.Insert(0, New ListItem("Select Sub-Category", "0"))


conn.Close()
End Sub

Protected Sub btnsubmit_Click1(ByVal sender As Object, ByVal e As EventArgs)


Try

If Fileupload.HasFile Then
Dim str As String = Fileupload.FileName
Fileupload.PostedFile.SaveAs(Server.MapPath("../photo/productphoto/" & str))
Dim image As String = "../photo/productphoto/" & str.ToString()
conn.Open()
Dim qur As String = "insert into tblpro values ('" & proname.Text & "','" + des.Text & "'," +
price.Text & "," + quantity.Text & ",'" & image & "','" + subcat.SelectedValue & "','" +
brand.SelectedValue & "','" + category.SelectedValue & "')"
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
Response.Write(cmd.ExecuteNonQuery())
conn.Close()
Else
Response.Write("<script>alert('Fill all the forms')</script>")
End If

filldata0()
Catch ex As Exception
Response.Write(ex)
End Try
End Sub
End Class

End Namespace

Page 35
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

ViewUser.aspx

<%@ Page Title="" Language="vb" MasterPageFile="~/ADMIN/Admin.Master" AutoEventWireup="true"


CodeBehind="viewuser.aspx.cs" Inherits="WebApplication2.ADMIN.viewuser" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainBody" runat="server">
<div class ="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<h4>Users Details</h4>
<asp:GridView runat="server" cssClass="table table-bordered" ID="usergrid" DataKeyNames="userid"
AutoGenerateColumns="false" OnRowDeleting="catgrid_RowDeleting" AutoGenerateDeleteButton="true" Width="960px" >
<Columns>
<asp:BoundField DataField="userid" HeaderText="USERID" />
<asp:BoundField DataField="name" HeaderText="Name" />
<asp:BoundField DataField="usermail" HeaderText="Email" />
<asp:BoundField DataField="usergender" HeaderText="Gender" />
<asp:BoundField DataField="useradd" HeaderText="Address" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</asp:Content>

Page 36
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Description:-
The User Record page is organized into sections. The E-Commerce Information section contains a user 's
override amount and value added id number. The availability of this section is controlled by backend settings.

ViewUser.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration

Namespace WebApplication2.ADMIN
Public Partial Class viewuser
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


If Not IsPostBack Then
fillgrid()
End If
End Sub

Private Sub fillgrid()


If conn.State = ConnectionState.Closed Then
conn.Open()
End If

Try
Dim cmd As SqlCommand = New SqlCommand("select * from tbluser", conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
usergrid.DataSource = ds
usergrid.DataBind()
Catch ex As Exception

Page 37
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Response.Write(ex)
Finally
conn.Close()
End Try
End Sub

Protected Sub catgrid_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs)


conn.Open()
Dim qur As String = "Delete from tbluser where userid= " & e.Keys(0)
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
fillgrid()
End Sub
End Class
End Namespace

Page 38
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

 CLIENT SIDE
UserLogin.aspx

Description:-
We can define a login page as the web page or entry page to a site where the user requires authentication to access it. They
use identification credentials that include a username and password.

UserLogin.aspx.vb
Imports System
Imports System.Data.SqlClient
Imports System.Configuration

Namespace WebApplication2.User
Public Partial Class UserLogin
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


End Sub

Protected Sub Unnamed1_Click(ByVal sender As Object, ByVal e As EventArgs)

Page 39
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Try
conn.Open()
Dim qur As String = "select * from tbluser where usermail ='" & txtemail.Text & "' and"
userpass = """"c
";"
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
Dim dr As SqlDataReader = cmd.ExecuteReader()

If dr.Read() Then
Session("User") = dr(1).ToString()
Session("Userid") = dr(0).ToString()
Else
Response.Redirect("../User/Homepage.aspx")
Response.Write("<script>alert('Username & password are", incorrect, ")"c)
End If

Catch ex As Exception
Response.Write(ex.Message)
Finally
conn.Close()
End Try
End Sub
End Class
End Namespace

Page 40
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Register.aspx

Description:-
We can define a Registration page as the web page or entry page to a site where the user requires fill form those user visit
first time in website.

Page 41
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Register.aspx.vb
Imports System
Imports System.Configuration
Imports System.Data.SqlClient

Namespace WebApplication2.User
Public Partial Class register
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Protected Sub Unnamed1_Click(ByVal sender As Object, ByVal e As EventArgs)
If txtpass.Text = "" OrElse txtname.Text = "" OrElse txtemail.Text = "" Then
Response.Write(" < script > alert('Fill all the forms') </ script > ")
Else
conn.Open()
Dim qur As String = "insert into tbluser(name,usermail,userpass) values('" & txtname.Text &
"','" + txtemail.Text & "','" + txtpass.Text & "');"
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
Response.Redirect("UserLogin")
End If
End Sub
End Class
End Namspace

Page 42
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

HOMEPAGE

Description:-
This is home page from user side.and it’s show main product with different type of categories.
HomePage.aspx.vb
Imports System
Imports System.Web.UI.WebControls
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Data

Namespace WebApplication2.User
Public Partial Class Homepage
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())
Private cat_id As String

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


cat_id = If(Request.QueryString("cat_id") IsNot Nothing, Request.QueryString("cat_id"), "1")

If Not IsPostBack Then


loadData("tblsucat", dlSubCategories)
loadData("tblpro", dlProduct)
End If

Page 43
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

End Sub

Protected Sub loadData(ByVal table As String, ByVal dl As DataList)


If conn.State = ConnectionState.Closed Then conn.Open()
Dim query As String = "SELECT * FROM " & table
Dim cmd As SqlCommand = New SqlCommand(query, conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
dl.DataSource = ds
dl.DataBind()
conn.Close()
End Sub
End Class
End Namespace

Products.aspx

Page 44
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Description:-
This page show diferent type of product with different categories.

Products.aspx.vb

Imports System
Imports System.Web.UI.WebControls
Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration

Namespace WebApplication2.User
Public Partial Class products
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())
Private productid As String = ""
Private subcatid As String = ""

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


If Not IsPostBack Then
lblheading.Visible = True
productid = If(Request.QueryString("productid") IsNot Nothing,
Request.QueryString("productid"), "")
subcatid = If(Request.QueryString("subcatid") IsNot Nothing, Request.QueryString("subcatid"),
"")

If productid <> "" Then


Else
End If
End If

showProduct(productid)
loadData("tblpro", dlProducts)
productid = If(Request.QueryString("productid") IsNot Nothing, Request.QueryString("productid"),
"")
subcatid = If(Request.QueryString("subcatid") IsNot Nothing, Request.QueryString("subcatid"), "")
End Sub

Private Sub loadData(ByVal table As String, ByVal dl As DataList)


If conn.State = ConnectionState.Closed Then conn.Open()
Dim query As String = $"SELECT * FROM {table}"

If productid <> "" Then

Page 45
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

query += $" WHERE productid={Convert.ToInt32(productid)}"


ElseIf subcatid <> "" Then
query += $" WHERE subcatid={Convert.ToInt32(subcatid)}"
End If

Dim cmd As SqlCommand = New SqlCommand(query, conn)


Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
dl.DataSource = ds
dl.DataBind()
conn.Close()
End Sub

Private Sub showProduct(ByVal product_id As String)


lblheading.Visible = False
loadData("tblpro", dlProduct)
End Sub

Protected Sub Unnamed_Click(ByVal sender As Object, ByVal e As EventArgs)


If conn.State = ConnectionState.Closed Then conn.Open()

Try
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Dim pid As Integer = Convert.ToInt32(productid.ToString())
Dim qty As Integer = Convert.ToInt32((TryCast(dlProduct.Items(0).FindControl("ddlQty"),
DropDownList)).SelectedValue)
Dim total As Integer = 0
Dim price As Integer = 0
Dim name As String = ""
Dim image As String = ""

If True Then
Dim q As String = "SELECT * FROM tblpro WHERE productid=" & pid
Dim c As SqlCommand = New SqlCommand(q, conn)
Dim dr As SqlDataReader = c.ExecuteReader()

If dr.Read() Then
price = Convert.ToInt32(dr(3).ToString())
image = dr(5).ToString()
name = dr(1).ToString()
End If

total = qty * price


dr.Close()
End If

Dim query As String = $"INSERT INTO cart VALUES({userid},{pid},{price},{qty},


{total},'{image}','{name}')"

Page 46
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Dim cmd As SqlCommand = New SqlCommand(query, conn)


cmd.ExecuteNonQuery()
(TryCast(sender, Button)).Text = "Added ✔"
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub

Protected Sub btnorder_Click(ByVal sender As Object, ByVal e As EventArgs)


If conn.State = ConnectionState.Closed Then conn.Open()

Try
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Dim pid As Integer = Convert.ToInt32(productid.ToString())
Dim qty As Integer = Convert.ToInt32((TryCast(dlProduct.Items(0).FindControl("ddlQty"),
DropDownList)).SelectedValue)
Dim total As Integer = 0
Dim price As Integer = 0
Dim name As String = ""
Dim image As String = ""

If True Then
Dim q As String = "SELECT * FROM tblpro WHERE productid=" & pid
Dim c As SqlCommand = New SqlCommand(q, conn)
Dim dr As SqlDataReader = c.ExecuteReader()

If dr.Read() Then
price = Convert.ToInt32(dr(3).ToString())
image = dr(5).ToString()
name = dr(1).ToString()
End If

total = qty * price


dr.Close()
End If

Dim query As String = $"INSERT INTO cart VALUES({userid},{pid},{price},{qty},


{total},'{image}','{name}')"
Dim cmd As SqlCommand = New SqlCommand(query, conn)
cmd.ExecuteNonQuery()
Response.Redirect("cart.aspx")
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub

Page 47
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

End Class
End Namespace
Cart.aspx

Description:-
When user are buy some product so that product are show in cart section other wise cart section is empty.
Cart.aspx.vb

Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration

Namespace WebApplication2.User
Public Partial Class cart
Inherits System.Web.UI.Page

Private conn As SqlConnection = New


SqlConnection(ConfigurationManager.ConnectionStrings("conn").ToString())

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)


If Not IsPostBack Then
fillgrid()
total()

Page 48
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

End If
End Sub

Private Sub total()


If conn.State = ConnectionState.Closed Then
End If

Try
conn.Open()
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Dim total As Integer = 0
Dim q As String = "select SUM(totalcost) from cart where userid =" & userid
Dim cmd As SqlCommand = New SqlCommand(q, conn)
Dim dr As SqlDataReader = cmd.ExecuteReader()

If dr.Read() Then
total = Convert.ToInt32(dr(0).ToString())
End If

lbltotal.Text = total.ToString()
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub

Private Sub fillgrid()


If conn.State = ConnectionState.Closed Then
End If

Try
conn.Open()
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Dim q As String = "select * from cart where userid =" & userid
Dim cmd As SqlCommand = New SqlCommand(q, conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
cartgrid.DataSource = ds
cartgrid.DataBind()
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub

Protected Sub cartgrid_RowDeleting(ByVal sender As Object, ByVal e As


GridViewDeleteEventArgs)

Page 49
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D

Try
Finally
End Try
conn.Open()
Dim qur As String = "delete from cart where cardproid=" & e.Keys(0)
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
fillgrid()
total()

Try
Catch ex As Exception
Response.Write("<script>alert('You can't delete the product')</script>")
Response.AppendToLog(ex.ToString())
Finally
conn.Close()
End Try
End Sub
Protected Sub btncheck_Click(ByVal sender As Object, ByVal e As EventArgs)
Try
conn.Open()
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Response.Write(userid)
Dim qur As String = "delete from cart where userid=" & userid
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
successmsg.Text = "Order Successful ✔ Thank You For Shoping"
fillgrid()
total()
Catch ex As Exception
Response.Write("<script>alert('You can't delete the product')</script>")
Response.AppendToLog(ex.ToString())
Finally
conn.Close()
End Try
End Sub
End Class
End Namespace

Reference of website :-
 https://www.github.com/
 https://www.javatpoint.com/asp-net-tutorial
 https://www.w3schools.com/asp/webpages_database.asp

Page 50

You might also like