Академический Документы
Профессиональный Документы
Культура Документы
2015
ACKNOWLEDGEMENT
I am greatly pleased to take this opportunity to acknowledge the co-operation and
assistance of few people without whom this endeavor would not have been a success.
Firstly, I am indebted to my guide for having shown confidence in me, and giving me an
opportunity to debut in the world of Software Engineering under his aegis. Also, he has been
extremely patient in the initial phase of the work and has given me ample opportunity to learn
and imbibe the rudiments of the subject.
Further, I would like to express my gratitude towards all staff of Company for their cooperation in all required matters. I am greatly thankful to my project partner who has helped me
in completion of this project directly or indirectly.
Date: 25/04/2015
Place: VADODARA
Index
Sr. No.
1
Topic
Introduction & Objectives of the Project.
Introduction &
Objectives.
Definition
Feasibility Study
Technical Feasibility
Economical Feasibility
Operational Feasibility
Legal Feasibility
Financial Feasibility
Introduction to Software
Spiral Model
Analysis
Design
Testing
Implementation
Page No.
Specifications
Software
Requirement
Hardware
Requirement
Analysis
Data Flow Diagrams
E-R
Diagrams
System Flow Diagram
Process Logic
Data
Dictionary (Tables)
Screen
Shots
Testcases
Coding
7
8
Coding Efficiency
Coding Optimization
10
Validation Checks
11
Testing
System
Testing
Integratio
n Testing
Unit
Testing
White Box
Testing
Black Box
Testing
Acceptanc
e Testing
12
13
Reports
14
15
16
Bibliography
17
Synopsis
1. Introduction
On-Line Shopping System is a web-based project which is made
for remote-shopping or shopping through Internet. As the technology is being
advanced the way of life is changing accordance. Now a days we can place
the order for any thing from our home. There is no need to go the shop of the
things we want. The order can be placed online through Internet. The
payment, the confirmation of purchasing; we can do every thing we want.
Now we can think that how the days have been changed with time. People
had to stand in rows to wait there terms to buy a particular thing from a
popular shop. But what is happening now a days; we can extremely surprise
that those things can be available on the door-step in few hours.
People had to suffer the rush of the market when they went for
shopping. They used to think hundred times to buy any thing having the
sufficient money for shopping. The problem was the rush; the quarrel at the
time of buying the things. But the advancement of technology brought the
new way for shopping. The way of shopping was completely changed with
the coming of Internet Technology. People have to fill a simple form on the
internet to place their order on any popular shop or shopping-mall for the
thing they want to buy. Now they can place their order from the home.
This project entitled On-Line Shopping is an implementation of the above
description. It means, it implements the E-shopping or in other word
shopping through Internet. It lets the user to place their order online for any
article.
3:Objective
Today the internet and its boom have created a new economic scenario that
not only stresses on the classical concept of the product but also on the
modern concept of service. It is this level of service that dictates whether a
commercial venture will succeed or not in the market. To provide a high
accessibility of service we will design the online shopping website, so that
potential customers need not go to a physical shop to buy products or
services.
There are several objective of this websites are following given bellows.
This site is gives all the information about the e-shopping to provide
better service for the customer.
It provides the facility to the customers who want to shop on-line due
to lock of time.
Its providing the full details about the product and related information
about the product like cost, size etc.
With the help of it we can save the time and money also.
It provides the remote shopping by the cash, or DD, or Debit card also.
2. Feasibility Study
Feasibility study is a process to check possibilities of system development. It is a method to
check various different requirements and availability of financial & technical resources.
Before starting the process various parameters must be checked like:
Technical Feasibility:
It is basically used to see existing computer, hardware and software etc., weather it is sufficient or
additional equipments are required? Minimum System Requirement is such that it can be affordable by
of the user who is having
computer. All the user requires is compatible browser and .net framework installed so our system is
fully technical feasible.
Economic Feasibility:
In Economic feasibility, analysis of the cost of the system is carried out. The system should be
only developed if it is going to give returned the current manual system user can get the price only by
purchasing the newspapers. In addition if he/she wants to see archives of particular equity then he has to
refer to all the old newspapers. For research reports he has to buy another magazine. So Instead of
buying no of magazines user has to just go online and with a single click he can get whatever
information he wants. So our project of online share news passes the test of Economic feasibility.
Operational Feasibility:
Once the system is designed there must be trained and expert operator. If there are not trained they
should give training according to the needs of the system.
From the users perspective our system fully operational feasible as it just requires some
knowledge of computer. Operators only need add daily prices of various equities and there are enough
validations available so operator does not require any special technical knowledge. So our system also
passes the test of operational feasibility.
Legal Feasibility
Determines whether the proposed system conflicts with legal requirements, e.g. a data processing
system must comply with the local Data Protection Acts.
Financial feasibility
In case of a new project, financial viability can be judged on the following parameters:
Financing of the project in terms of its capital structure, debt equity ratio and promoter's share
of total cost
3. Software Engineering
Paradigm Applied
Introduction to Software
What is exactly meant by software? I was asked by one of the official of the Starnet
Servicesin the meeting.
Lets first define the term software.
Computer software is the product that software engineers design and build.
It encompasses programs that execute within a computer of any size and architecture,
documents that encompass hard copy and virtual forms, and data that combine numbers and
text but also includes representation of pictorial, video, and audio information.
Software Engineer builds it, and virtually everyone in the industrialized world uses it either
directly or indirectly.
Because it affects nearly every aspect of our lives and has become pervasive in our
commerce, our culture, and our everyday activities.
We build computer software like we build any successful product, by applying a process that
leads to a high quality result that meets the needs of the people who will use the product.
We apply a software engineering approach.
From the point of view of a software engineer; the work product is the programs, documents,
and data that are computer software.
But from the users point of view, the work product is the resultant information that somehow
makes the users world, User privileges better.
Software is both a product and a vehicle for delivering a product.
Software Applications
System Software
System software is a collection of programs written to service other program, e.g.
COMPLIER, EDITORS, AND FILE MANAGEMENT UTILITIES, OS COMPONENTS,
DRIVERS, etc.
Real-Time software
Software that monitors or analyzes or controls real-world events as they occur is called
real time. Elements of real-time software include a data gathering component that collects
and formats information from an external environment, an analysis component that
transforms information as required by the application, a control/output component that
responds to the external environment and a monitoring component that coordinates all other
components so that real response can be maintained.
Business Software
Business information processing is the largest single software application area. Discrete
systems (e.g. PAYROLL, ACCOUNTS RECEIVABLE/PAYABLE, INVENTORY, SMBS)
Embedded software
Intelligent products have become commonplace in nearly every consumer and industrial
market. Embedded software resides in read-only memory and is used to control products and
systems for the consumer and industrial markets, e.g. keypad control for a microwave oven,
so we can say that they can perform very limited and esoteric functions.
Web-based software
The web pages retrieved by a browser are software incorporates executable instructions
(e.g. CGI, HTML, PERL, JAVA, ASP), and data (e.g. hypertext and a variety of visual and
audio formats)
final analysis, the most important factor for the success of a project may be how closely the particular
plan was followed.
Spiral Model
The spiral model, also known as the spiral lifecycle model, is a systems development lifecycle
(SDLC) model used in information technology (IT). This model of development combines the features of
the prototyping model and the waterfall model. The spiral model is favored for large, expensive, and
complicated projects.
SPIRAL MODEL
A first prototype of the new system is constructed from the preliminary design. This is usually a
scaled-down system, and represents an approximation of the characteristics of the final product.
A second prototype is evolved by a fourfold procedure: (1) evaluating the first prototype in terms of
its strengths, weaknesses, and risks; (2) defining the requirements of the second prototype; (3) planning
and designing the second prototype; (4) constructing and testing the second prototype.
At the customer's option, the entire project can be aborted if the risk is deemed too great. Risk factors
might involve development cost overruns, operating-cost miscalculation, or any other factor that could, in
the customer's judgment, result in a less-than-satisfactory final product.
System Analysis
The goal of system analysis is to determine where the problem is in an attempt to fix the system.
This step involves breaking down the system in different pieces to analyze the situation, analyzing project
goals, breaking down what needs to be created and attempting to engage users so that definite
requirements can be defined.
Requirements analysis sometimes requires individuals/teams from client as well as service
provider sides to get detailed and accurate requirements; often there has to be a lot of communication to
and from to understand these requirements. Requirement gathering is the most crucial aspect as many
times communication gaps arise in this phase and this leads to validation errors and bugs in the software
program.
Design
In systems design the design functions and operations are described in detail, including screen
layouts, business rules, process diagrams and other documentation. The output of this stage will describe
the new system as a collection of modules or subsystems.
The design stage takes as its initial input the requirements identified in the approved requirements
document. For each requirement, a set of one or more design elements will be produced as a result of
interviews, workshops, and/or prototype efforts.
Design elements describe the desired software features in detail, and generally include functional
hierarchy diagrams, screen layout diagrams, tables of business rules, business process diagrams, pseudo
code, and a complete entity-relationship diagram with a full data dictionary. These design elements are
intended to describe the software in sufficient detail that skilled programmers may develop the software
with minimal additional input design.
Testing
The code is tested at various levels in software testing. Unit, system and user acceptance testings
often performed. This is a grey area as many different opinions exist as to what the stages of testing are
and how much if any iteration occurs. Iteration is not generally part of the waterfall model, but usually
some occur at this stage. In the testing phase, the whole system is tested one by one
While white-box testing can be applied at the unit, integration and system levels of the software
testing process, it is usually done at the unit level. It can test paths within a unit, paths between units
during integration, and between subsystems during a system level test. Though this method of test design
can uncover many errors or problems, it might not detect unimplemented parts of the specification or
missing requirements.
Implementation
In this phase the designs are translated into code. Computer programs are written using a
conventional programming language or an application generator. Programming tools like Compilers,
Interpreters, and Debuggers are used to generate the code. Different high level programming languages
like C, C++, Pascal, and Java are used for coding. With respect to the type of application, the right
programming language is chosen
The .NET Framework is further comprised of Common Type System (CTS) and Common Language
Specification (CLS). The CTS defines the common data types used by .NET programming languages. The
CTS tells you how to represent characters and numbers in a program. The CLS represents the guidelines
defined by for the .NET Framework. These specifications are normally used by the compiler developers
and are available for all languages, which target the .NET Framework.
Net architecture
Developers using the CLR write code in a high level language such as C#. At compile-time, a
.NET compiler converts such code into MSIL (Microsoft Intermediate Language) code. At runtime, the
CLR's just-in-time compiler (JIT compiler) converts the MSIL code into code native to the operating
system. Alternatively, the MSIL code can be compiled to native code in a separate step prior to runtime.
This speeds up all later runs of the software as the MSIL-to-native compilation is no longer necessary.
Although some other implementations of the Common Language Infrastructure run on nonWindows operating systems, the CLR runs on Microsoft Windows operating systems.
The virtual machine aspect of the CLR allows programmers to ignore many details of the specific
CPU that will execute the program. The CLR also provides other important services, including the
following:
Memory management
Thread management
Exception handling
Garbage collection
Security
Introduction to ASP.NET
Although in C# Language, .NET is a powerful but simple language aimed primarily at developers
creating web applications for the Microsoft .NET platform. It inherits many of the best features of C++
but with some of the inconsistencies and anachronisms removed, resulting in cleaner and logical
language. C# also contains a variety of useful new innovations that accelerate application development,
especially when used in conjunction with Microsoft Visual Studio .NET.
The Common Language Runtime provides the services that are needed for executing any
application thats developed with one of the .NET languages. This is possible because all of the .NET
languages compile to a common Intermediate Language. The CLR also provides the common type system
that defines that data types that are used by all the .Net languages. That way, you can use same data types
regardless of what.NET language youre using to develop your application.
Microsoft ASP.NET( C # )
Microsoft ASP.NET( C # ) is one of the most well known languages for the front-end programming. It
provides a Rapid Application Development environment to the developers. It provides supports for the
ODBC (Open Database Connectivity) and RDO data access methods, which can be used as a powerful
development tools. It also supports ActiveX Data Objects (ADO) access methods, which is useful in
creating a web page, and writing DHTML applications. It has such tools that any programmer can have an
attractive screens which he imagines. It is the most widely used languages and is more flexible. Also one
can have the desired properties of the various commands to create textboxs, labels, used in the screens. It
also has the facility to create menu.
Microsoft ASP.NET(C #) is based on Visual Studio.NET that was developed in early 70s. Visual
Studio .Net comes in several varieties including the following:
Microsoft, realizing that ASP does possess some significant shortcomings, developed ASP.net.
ASP.net is a set of components that provide developers with a framework with which to implement
complex functionality. Two of the major improvements of ASP.net over traditional ASP are scalability and
availability. ASP.net is scalable in that it provides state services that can be utilized to manage session
variables across multiple web services in a server farm. Additionally, ASP.net possesses a high
performance process model that can detect application failures and recover from them. We use the
fundamentals of programming with C# using Visual Studio .NET and .NET framework.
The project is the starting point for authoring applications, components &services in Visual
Studio.NET 2008.It eats as a container that manages your source code, data connections & references. A
project is organized as part of a solution, which can contain multiple projects that are independent of each
other. C# project file has .asproj extension whereas solution file has .sln extension.
In order to write code against an external component, your project must first contain a reference
to it. A reference can be made to the following types of component.
(1) .NET class libraries or assemblies
(2) COM components
Features of ASP.NET:
(1) Component Infrastructure.
(2) Language Integration.
(3) Internet Interoperation.
(4) Simple Development.
(5) Simple Deployment.
(6) Reliability.
(7) Security
Like most mainframe or minicomputer databases, SQL Server is a Database that has seen an
evolution from its introduction in the mid-1960s until today. Microsofts SQL Server is founded in the
mature and powerful relational model, currently the preferred model for data storage and retrieval.
Unlike mainframe and minicomputer databases, a server database is accessed by users--called
clients--from other computer systems rather than from input/output devices, such asterminals.
Mechanisms must be in place for SQL Server to solve problems that arise from theaccess of data from
perhaps Hundreds of computer systems, each of which can processportions of the database independently
from the data on the server. Within the framework of aclient/server
database, a server database also requires integration with communication components of the server in
order to enable connections with client systems.
SQL server also contains many of the front-end tools of PC databases that traditionallyhavent
been available as part of either mainframe or minicomputer databases. In addition tousing a dialect of
Structured Query Language (SQL), GUI applications can be used for the storage, retrieval, and
administration of the database.
GetStory(),which will return information about the success story or user who met by this site.
GetMessage(), which will return information about a message for particular type of membership.
These methods, when invoked, will connect to the database, issue the appropriate query, and return
the results. These methods could simply return a Dataset or Data Reader populated by the database query,
but ideally these results should be returned using strongly-typed objects.
In strongly-typed Data Table, will have each of its columns implemented as properties, resulting in code
that looks like: DataTable .Rows [index].column Name.
Figure illustrates the workflow between the different layers of an application that uses Typed
Datasets.
To retrieve the data to populate the Data Table, I used a Table Adapter class, which functions as
my Data Access Layer. For our story Data Table, the Table Adapter is containing the methods
Getstory(), Getstorybyid(memberid), and so on that I can invoke from the presentation layer. The Data
Tables role is to serve as the strongly-typed objects used to pass data between the layers.
I have a Typed Dataset with a single Data Table (message) and a strongly-typed Data Adapter
class (FmsgTableAdapter,PmsgTableAdpter) with a GetMessage() method.
In my application I have used pattern for inserting, updating, and deleting data, this pattern
involves creating methods that, when invoked, issue an INSERT, UPDATE, or DELETE command to the
database that operates on a single database
record. Such methods are typically passed in a series of scalar values (integers, strings, Booleans, Date
Times, and so on) that correspond to the values to insert, update, or delete.
The patterns use the Table Adapters Insert Command, Update Command, and Delete Command
properties to issue their INSERT, UPDATE, and DELETE commands to the database.
Figure Each Insert, Update, and Delete Request Is Sent to the Database
Immediately.
System Implementation
The system was initially implemented in only one computer on trial basis. First, dummy data was
fed & the testing was done. All the validations & constraints in the system were checked & tested for
dummy data so that the system will not give any error in future. It satisfies the needs of the users.
After the successful & smooth running, the system is ready for the final installation or
implementation on other computers.
The system was implemented in parallel to the old system to test whether the system is able to
perform the required task with required accuracy. After near about 15 days the new system was
completely in use.
Mouse
Keyboard
Printer
Software
Microsoft Word. (MS Agent), MS-Visio, net Frame works, MS-Sql Server express edition.
Window platform
Any Windows operating system
4 GB RAM.
Software Used
MS-WORD
Window Platform
6. Analysis
Data Flow Diagram
After the conclusion of interviews of officials and observations from Preliminary Investigation,
Feasibility Study and Software Requirement Specifications was signed. I had to draw the Functional
Specifications from Data Flow Diagram techniques, to start designing the system.
I/O.
You can use two different types of notations on your data flow diagrams:
flow.
on a high level diagram can be expanded to show a more detailed data flow diagram. Draw
the context diagram
1 Level DFD:
2 Level DFD:
Process Logic
Process logic is concerned with how the system interact with users and
fulfill there requirements? Being a web based system; user of this
system can easily access this system through Internet. It provides
various functionalities, attracts the user to use it, and makes the user
comfortable to work on it.
Data Dictionary
Data Type
Integer
Size
5
Validation
2.
Field Name
S.No (autoincrement)
U_name
Varchar
20
Primary Key
3.
Password
Varchar
20
Data Type
Varchar
Varchar
Date
Varchar
Varchar
Integer
Date
Integer
Varchar
Size
20
20
Data Type
Size
Field Name
E_Id
E_Name
J_date
Sex
Address
Phone No
DOB
Salary
Specialization
Validation
Primary key
6
50
10
10
20
Category Table:
S.R
Field Name
Validation
1.
2.
Category id
Name
Integer
Varchar
5
20
Primary Key
Sub-Category Table:
S.R
1.
2.
Field Name
Sub-Category id
Name
Data Type
Integer
Varchar
Size
5
20
Category Id
Integer
Validation
Primary Key
Field Name
First Name
Data type
Varchar
Size
20
2.
3.
4.
5.
6.
7
8
9
10
11
Middle Name
Last Name
Address
Contact_no
Gender
Birth Date
User Name
Password
Question
Answer
Varchar
Varchar
Varchar
Integer
Varchar
Integer
Varchar
Varchar
Varchar
Varchar
20
20
300
12
10
20
20
20
500
1000
Purchase Table:
Validation
Primary
key
S.R
1.
2.
3.
4.
5.
6.
Field Name
Pur_id
ItemName
Rate
Item_category
Quantity
Date
Data type
Varchar
Varchar
Varchar
Varchar
Integer
Datetime
Size
10
300
100
300
5
Validation
Primary key
Data type
Varchar
Varchar
Varchar
dateTime
dateTime
Varchar
Varchar
Varchar
Varchar
Size
10
30
79
Validation
Primary key
Data Type
Varchar
Varchar
Date
Varchar
Varchar
Integer
Integer
Size
20
200
Advertisement Table:
S.R
1.
2.
3.
4.
5.
6.
7.
8.
9.
Field Name
Ad_id
Ad_name
Image
Ad_start_date
ad_end_date
Comp_name
Address
Contact_no
Email
89
78
12
78
Payment Table:
S.R
1.
2.
3.
4.
5.
6.
7.
Field Name
P_id
P_name
P_date
Cust_name
Pay_mode
Cash
DD
67
50
10
23
Validation
Primary key
S.R
S.R
1
1.
2
2.
3
3.
4.
5.
6.
7.
Field Name
Field Name
State Id
P_id
State Name
Cust_name
Country ID
Delvr_date
Amount
Contact_no
Address
Email
Data Type
Data Type
Varchar
Varchar
Varchar
Varchar
Varchar
Date
Varchar
Varchar
Varchar
Varchar
Size
Size
20
20
20
200
20
Validation
Validation
Primary key
Primary key
67
50
100
56
Country Table:
Field Name
StateId
StateName
CountryID
Data Type
Varcher
Varchar
Varchar
Size
20
50
50
Validation
Primary key
Data Type
Varchar
Varchar
Varchar
Size
20
20
20
Validation
Primary key
Data Type
Varchar
Varchar
Varchar
Size
20
20
20
Validation
Primary key
City Table:
S.R
1
2
3
Field Name
City Id
City Name
State ID
Screen Shots
Admin
Admin Change Password Form:
Advertise Form:
Coutry Form:
Employee Form:
ForgotPassword:
Payment Form:
Product Form:
Purchase Form:
SubCategory Form:
User
Customer Registrition Form:
SubCategory Form:
Product Form:
ProductDetailsForm:
Test Case
Form Name
StepDetails
1.UserName:
Login
jaimeen
Login Form
2.Password:
Login
Expected Result:
1. If UserNAme and Password Is Incorrect than the User cant Login
into the System.
2. If UserName and Password is Correct than the User will Go on the
Welcome Page
UserName And Password Correct
Test Case
Form Name
Actor Master
StepDetails
1.Actor Name
Abhishek
Expected Result:
If a enter
Test Case
Form Name
StepDetails
1.Sub Category Name
Sub Category
Master
Telivison
Expected Result:
Test Case
Change Password
Form Name
ChangePasswordForm
Electronics
StepDetails
1. If Current Password
Is Incorrect
2. New Password and
Confirm Password is
Incorrect
3. If all Fields are Correct
Expected Results:
Here Firstly the User has to Login Correctly than Only he/she can
Change Password
1. If Current Password entered does not match than a message is Shown.
2. If after inserting correct userpassword the newpassword and confirm
password should match.
3. If Newpassword and ConfirmPassword both matches than after
clicking on
thePassword will Successfully change
Test Case
Form Name
Register User
StepDetails
1. If in mobile No. field
instead of number
anything else is inserted.
2. If in Dropdown box the
User wanted field is not
there.
3. If all Data are Entered
Correctly.
1. If Mobile No. Field is not entered correctlt than a message will shown as:
2. If in Qualification the required qualification is not there as per the user
Qualification than selected Other option from Dropdown box a textbox is
visible in that he/she can write his/her Qualification.
3. If all fields are inserted than the will be submitted Successfully.
Test Case
Form Name
Forgot Password
ForgotPasswordForm
StepDetails
1. On entering UserName
and Clicking on
Forgorpassword Link.
2. Password Shown if
Emailid and Username
is Correct.
Expected Results:
1. On entering Username and Clicking on Forgot Password Link the User can
get his/her Password.
7. Coding
Admin-
Admin ChangePassword:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_AdminChangePassword : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid ClearData()
{
txtunm.Text = "";
txtcupsw.Text = "";
txtnepsw.Text = "";
}
protectedvoid btnchange_Click(object sender, EventArgs e)
{
try
{
if (txtnepsw.Text == txtrepsw.Text)
{
SqlCommand cmd = newSqlCommand("UpdateChangePsw", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@UserName", SqlDbType.VarChar);
parm.Value = txtunm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Password", SqlDbType.VarChar);
parm.Value = txtcupsw.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@ChangePassword", SqlDbType.VarChar);
parm.Value = txtnepsw.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Password SuccessFuly
Changed");
ClearData();
CloseConnection();
}
else
{
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Password Does Not
Match");
}
}
catch (Exception ex)
{
}
}
}
AdminForgot Password:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_AdminForgotPassword : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid clearData()
{
txtunm.Text = "";
txtemail.Text = "";
}
protectedvoid btnsubmit_Click(object sender, EventArgs e)
{
try
{
SqlCommand cmd = newSqlCommand("ReadForgotPsw", con);
cmd.CommandType = CommandType.StoredProcedure;
Advertise:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_Advertise : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@CompanyName", SqlDbType.VarChar);
parm.Value = txtconm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Address", SqlDbType.VarChar);
parm.Value = txtadd.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@ContactNo", SqlDbType.NChar);
parm.Value = txtcnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Email", SqlDbType.VarChar);
parm.Value = txtemail.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
ClearFields();
cmd.Dispose();
CloseConnection();
}
publicvoid ClearFields()
{
txtadnm.Text = "";
//FileUpload1.FileName ="";
txtadsdt.Text ="";
txtadedt.Text="";
txtconm.Text="";
txtadd.Text="";
txtcnm.Text="";
txtemail.Text = "";
}
}
CategoryMaster:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_CategoryMaster : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
BindControl();
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid BindControl()
{
SqlCommand cmd = newSqlCommand("ReadCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader Dr = cmd.ExecuteReader();
Gridview2.DataSource= Dr;
Gridview2.DataBind();
Dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid ClearData()
{
txtcatnm.Text="";
txtcatnm.Focus();
}
dr.Close();
cmd.Dispose();
Btnsubmit.Text = "Update";
CloseConnection();
if (e.CommandName == "DeleteButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["Catid"] = id;
SqlCommand cmd = newSqlCommand("DeleteCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@CategoryId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
//LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");
cmd.Dispose();
BindControl();
ClearData();
CloseConnection();
}
}
protectedvoid Btnsubmit_Click1(object sender, EventArgs e)
{
if (Btnsubmit.Text == "Submit")
{
SqlCommand cmd = newSqlCommand("InsertCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@CategoryName", SqlDbType.VarChar);
parm.Value = txtcatnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
ClearData();
cmd.Dispose();
CloseConnection();
else
{
SqlCommand cmd = newSqlCommand("UpdateCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@CategoryId", SqlDbType.Int);
parm.Value = ViewState["catid"].ToString();
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@CategoryName", SqlDbType.VarChar);
parm.Value = txtcatnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
// LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated
Successfully");
ClearData();
cmd.Dispose();
CloseConnection();
Btnsubmit.Text = "Submit";
}
}
City Master:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_CityMaster : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["Shopping"].ToString
());
BindCityName();
BindControl();
}
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid BindControl()
{
SqlCommand cmd = newSqlCommand("ReadCity", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();
dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid ClearData()
{
txtcnm.Text = "";
}
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
// LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated
Successfully");
ClearData();
cmd.Dispose();
CloseConnection();
btnsubmit.Text = "Submit";
}
}
publicvoid BindCityName()
{
SqlCommand cmd = newSqlCommand("ReadCity", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
DropDownList1.DataSource = dr;
DropDownList1.DataTextField = "City_Name";
DropDownList1.DataValueField = "City_Id";
DropDownList1.DataBind();
dr.Close();
cmd.Dispose();
CloseConnection();
}
protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit");
lnkEdit.CommandArgument = e.Row.RowIndex.ToString();
LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete");
lnkDelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
dr.Close();
cmd.Dispose();
btnsubmit.Text = "Update";
CloseConnection();
if (e.CommandName == "DeleteButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["Cid"] = id;
SqlCommand cmd = newSqlCommand("DeleteCity", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@City_Id", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
//LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");
cmd.Dispose();
BindControl();
ClearData();
CloseConnection();
}
}
Country Master:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_CountryMaster : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
BindControl();
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid BindControl()
{
SqlCommand cmd = newSqlCommand("ReadCountry", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader Dr = cmd.ExecuteReader();
GridView1.DataSource = Dr;
GridView1.DataBind();
Dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid ClearData()
{
txtcnm.Text = "";
txtcali.Text="";
}
ViewState["cid"] = id;
SqlCommand cmd = newSqlCommand("SelectCountry", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@CountryId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtcnm.Text = dr["Country_Name"].ToString();
txtcali.Text = dr["Country_Alias"].ToString();
}
dr.Close();
cmd.Dispose();
btnsubmit.Text = "Update";
CloseConnection();
}
if (e.CommandName == "DeleteButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["cid"] = id;
SqlCommand cmd = newSqlCommand("DeleteCountry", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@CountryId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
//LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");
cmd.Dispose();
BindControl();
ClearData();
CloseConnection();
}
}
protectedvoid btnsubmit_Click(object sender, EventArgs e)
{
if (btnsubmit.Text == "Submit")
{
SqlCommand cmd = newSqlCommand("InsertCountry", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@CountryName", SqlDbType.VarChar);
parm.Value = txtcnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@CountryAlias", SqlDbType.VarChar);
parm.Value = txtcali.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
ClearData();
cmd.Dispose();
CloseConnection();
else
{
SqlCommand cmd = newSqlCommand("UpdateCountry", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@CountryId", SqlDbType.Int);
parm.Value = ViewState["cid"].ToString();
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@CountryName", SqlDbType.VarChar);
parm.Value = txtcnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@CountryAlias", SqlDbType.VarChar);
parm.Value = txtcali.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
// LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated
Successfully");
ClearData();
cmd.Dispose();
CloseConnection();
btnsubmit.Text = "Submit";
}
Employee:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_Employee : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
protectedvoid btnsubmit_Click(object sender, EventArgs e)
{
if (btnsubmit.Text == "Submit")
{
SqlCommand cmd = newSqlCommand("InsertEmployee", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@EmployeeName", SqlDbType.VarChar);
parm.Value = txtenm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@JoinedDate", SqlDbType.Date);
parm.Value = txtjodt.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Sex", SqlDbType.VarChar);
parm.Value = DropDownList1.SelectedValue;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Address", SqlDbType.VarChar);
parm.Value = txtadd.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@PhoneNo", SqlDbType.NChar);
parm.Value = txtphnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@DOB", SqlDbType.Date);
parm.Value = txtdob.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Salary", SqlDbType.Int);
parm.Value = txtsal.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Specialization", SqlDbType.VarChar);
parm.Value = txtspec.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
ClearFields();
cmd.Dispose();
CloseConnection();
}
}
protectedvoid ClearFields()
{
txtenm.Text = "";
txtjodt.Text = "";
DropDownList1.SelectedValue = "";
txtadd.Text = "";
txtphnm.Text = "";
txtdob.Text = "";
txtsal.Text = "";
txtspec.Text = "";
}
Admin Login:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_Login : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
try
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["Shopping"].ToString
());
OpenConnection();
CloseConnection();
}
catch (Exception ex)
{
lblMessage.Text = ex.Message.ToString();
}
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
Payment:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_Payment : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid BindControl()
{
SqlCommand cmd = newSqlCommand("ReadPayment", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader Dr = cmd.ExecuteReader();
GridView1.DataSource = Dr;
GridView1.DataBind();
Dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid ClearFields()
{
txtpaynm.Text = "";
txtpaydt.Text = "";
txtcusnm.Text = "";
txtpaymode.Text = "";
txtcash.Text = "";
txtdd.Text = "";
}
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Payment Method Is
Submitted Successfully");
cmd.Dispose();
CloseConnection();
}
else
{
SqlCommand cmd = newSqlCommand("UpdatePayment", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@PaymentId", SqlDbType.Int);
parm.Value = ViewState["pid"].ToString();
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@PaymentName", SqlDbType.VarChar);
parm.Value = txtpaynm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@PaymentDate", SqlDbType.Date);
parm.Value = txtpaydt.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@CustomerName", SqlDbType.VarChar);
parm.Value = txtcusnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@PaymentMode", SqlDbType.VarChar);
parm.Value = txtpaymode.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Cash", SqlDbType.Int);
parm.Value = txtcash.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@DD", SqlDbType.Int);
parm.Value = txtdd.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
ClearFields();
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated
Successfully");
cmd.Dispose();
CloseConnection();
btnsubmit.Text = "Submit";
}
}
protectedvoid btncancel_Click(object sender, EventArgs e)
{
ClearFields();
}
protectedvoid GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow raw = GridView1.Rows[index];
if (e.CommandName == "EditButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["pid"] = id;
SqlCommand cmd = newSqlCommand("SelectPayment", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@PaymentId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtpaynm.Text = dr["Payment_Name"].ToString();
txtpaydt.Text = dr["Payment_Date"].ToString();
txtcusnm.Text = dr["Customer_Name"].ToString();
txtpaymode.Text = dr["Payment_Mode"].ToString();
txtcash.Text = dr["Cash"].ToString();
txtdd.Text = dr["DD"].ToString();
}
dr.Close();
cmd.Dispose();
btnsubmit.Text = "Update";
CloseConnection();
if (e.CommandName == "DeleteButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["pid"] = id;
SqlCommand cmd = newSqlCommand("deletePayment", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@PaymentId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted
Successfully");
cmd.Dispose();
BindControl();
ClearFields();
CloseConnection();
}
}
protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit");
lnkEdit.CommandArgument = e.Row.RowIndex.ToString();
LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete");
lnkDelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
}
Product :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_Product : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid BindControl()
{
SqlCommand cmd = newSqlCommand("ReadProduct", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader Dr = cmd.ExecuteReader();
GridView2.DataSource = Dr;
GridView2.DataBind();
Dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid ClearFields()
{
txtpnm.Text = "";
txtprodis.Text = "";
txtquan.Text = "";
txtpp.Text = "";
}
cmd.ExecuteNonQuery();
BindControl();
ClearFields();
cmd.Dispose();
CloseConnection();
else
{
SqlCommand cmd = newSqlCommand("UpdateProduct", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@ProductId", SqlDbType.Int);
parm.Value = ViewState["pid"].ToString();
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@ProductName", SqlDbType.VarChar);
parm.Value = txtpnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@PImage", SqlDbType.VarChar);
parm.Value = FileUpload1.FileName ;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@ProDiscription", SqlDbType.VarChar);
parm.Value = txtprodis.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Category", SqlDbType.VarChar);
parm.Value = DropDownList1.SelectedValue;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@SubCategory", SqlDbType.VarChar);
parm.Value = DropDownList2.SelectedValue;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Quantity", SqlDbType.Int);
parm.Value = txtquan.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@ProductPrice", SqlDbType.Int);
parm.Value = txtpp.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated
Successfully");
ClearFields();
cmd.Dispose();
CloseConnection();
btnsubmit.Text = "Submit";
}
}
dr.Close();
cmd.Dispose();
btnsubmit.Text = "Update";
CloseConnection();
if (e.CommandName == "DeleteButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["pid"] = id;
SqlCommand cmd = newSqlCommand("deleteProduct", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@ProductId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted
Successfully");
cmd.Dispose();
BindControl();
ClearFields();
CloseConnection();
}
}
protectedvoid GridView2_RowCreated1(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit");
lnkEdit.CommandArgument = e.Row.RowIndex.ToString();
LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete");
lnkDelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
}
Purchase:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_Purchase : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid BindControl()
{
SqlCommand cmd = newSqlCommand("ReadPurchase", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader Dr = cmd.ExecuteReader();
GridView1.DataSource = Dr;
GridView1.DataBind();
Dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid ClearFields()
{
txtitem.Text = "";
txtrate.Text = "";
txtquan.Text = "";
txtitemcat.Text = "";
txtdate.Text = "";
}
{
SqlCommand cmd = newSqlCommand("UpdatePurchase", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@PurchaseId", SqlDbType.Int);
parm.Value = ViewState["pid"].ToString();
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@ItemName", SqlDbType.VarChar);
parm.Value = txtitem.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Rate", SqlDbType.VarChar);
parm.Value = txtrate.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@ItemCategory", SqlDbType.VarChar);
parm.Value = txtitemcat.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Quantity", SqlDbType.Int);
parm.Value = txtquan.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Date", SqlDbType.Date);
parm.Value = txtdate.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated
Successfully");
ClearFields();
cmd.Dispose();
CloseConnection();
btnsubmit.Text = "Submit";
}
}
protectedvoid GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow raw = GridView1.Rows[index];
if (e.CommandName == "EditButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["pid"] = id;
SqlCommand cmd = newSqlCommand("SelectPurchase", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@PurchaseId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtitem.Text = dr["ItemName"].ToString();
txtrate.Text = dr["Rate"].ToString();
txtitemcat.Text = dr["Item_Category"].ToString();
txtquan.Text = dr["QUantity"].ToString();
txtdate.Text = dr["Date"].ToString();
}
dr.Close();
cmd.Dispose();
btnsubmit.Text = "Update";
CloseConnection();
}
if (e.CommandName == "DeleteButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["pid"] = id;
SqlCommand cmd = newSqlCommand("DeletePurchase", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@PurchaseId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted
Successfully");
cmd.Dispose();
BindControl();
ClearFields();
CloseConnection();
}
}
protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit");
lnkEdit.CommandArgument = e.Row.RowIndex.ToString();
LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete");
lnkDelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
State Master:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_StateMaster : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["Shopping"].ToString
());
BindControl();
BindStateName();
}
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid BindControl()
{
SqlCommand cmd = newSqlCommand("ReadState", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
GridView2.DataSource = dr;
GridView2.DataBind();
dr.Close();
cmd.Dispose();
CloseConnection();
publicvoid ClearData()
{
txtsnm.Text = "";
}
publicvoid BindStateName()
{
SqlCommand cmd = newSqlCommand("ReadState", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
DropDownList1.DataSource = dr;
DropDownList1.DataTextField = "State_Name";
DropDownList1.DataValueField = "Country_Name";
DropDownList1.DataBind();
dr.Close();
cmd.Dispose();
CloseConnection();
}
protectedvoid GridView2_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit");
lnkEdit.CommandArgument = e.Row.RowIndex.ToString();
LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete");
lnkDelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid GridView2_RowCommand(object sender,
GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow raw = GridView2.Rows[index];
if (e.CommandName == "EditButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["sid"] = id;
SqlCommand cmd = newSqlCommand("SelectState", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@StateId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtsnm.Text = dr["State_Name"].ToString();
DropDownList1.SelectedValue = dr["Country_Name"].ToString();
}
dr.Close();
cmd.Dispose();
btnsubmit.Text = "Update";
CloseConnection();
}
if (e.CommandName == "DeleteButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["sid"] = id;
SqlCommand cmd = newSqlCommand("DeleteState", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@StateId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
//LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");
cmd.Dispose();
BindControl();
ClearData();
CloseConnection();
}
}
protectedvoid btnsubmit_Click(object sender, EventArgs e)
{
if (btnsubmit.Text == "Submit")
{
SqlCommand cmd = newSqlCommand("InsertState", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@StateName", SqlDbType.VarChar);
parm.Value = txtsnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@CountryName", SqlDbType.VarChar);
parm.Value = DropDownList1.SelectedValue;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
ClearData();
cmd.Dispose();
CloseConnection();
}
else
{
SqlCommand cmd = newSqlCommand("UpdateState", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@StateId", SqlDbType.Int);
parm.Value = ViewState["sid"].ToString();
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@StateName", SqlDbType.VarChar);
parm.Value = txtsnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@CountryName", SqlDbType.VarChar);
parm.Value = DropDownList1.SelectedValue;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
ClearData();
// LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated
Successfully");
cmd.Dispose();
CloseConnection();
btnsubmit.Text = "Submit";
}
}
}
SubCategory Master:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_SubCategoryMaster : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
BindControl();
BindSubCategoryName();
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid BindControl()
{
SqlCommand cmd = newSqlCommand("ReadSubCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader Dr = cmd.ExecuteReader();
GridView1.DataSource = Dr;
GridView1.DataBind();
Dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid ClearData()
{
txtsubnm.Text = "";
}
publicvoid BindSubCategoryName()
{
SqlCommand cmd = newSqlCommand("ReadSubCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
DropDownList1.DataSource = dr;
DropDownList1.DataTextField = "SubCategoryName";
DropDownList1.DataValueField = "SubCategoryId";
DropDownList1.DataBind();
dr.Close();
cmd.Dispose();
CloseConnection();
}
{
SqlCommand cmd = newSqlCommand("UpdateSubCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@SubCategoryId", SqlDbType.Int);
parm.Value = ViewState["subid"].ToString();
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@SubCategoryName", SqlDbType.VarChar);
parm.Value = txtsubnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@CategoryId", SqlDbType.Int);
parm.Value = DropDownList1.SelectedValue;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
BindControl();
// LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Updated
Successfully");
ClearData();
cmd.Dispose();
CloseConnection();
btnsubmit.Text = "Submit";
}
}
protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnkEdit = (LinkButton)e.Row.FindControl("lnkEdit");
lnkEdit.CommandArgument = e.Row.RowIndex.ToString();
LinkButton lnkDelete = (LinkButton)e.Row.FindControl("lnkDelete");
lnkDelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow raw = GridView1.Rows[index];
if (e.CommandName == "EditButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["subid"] = id;
SqlCommand cmd = newSqlCommand("SelectSubCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@SubCategoryId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
txtsubnm.Text = dr["SubCategoryName"].ToString();
DropDownList1.SelectedValue = dr["CategoryId"].ToString();
}
dr.Close();
cmd.Dispose();
btnsubmit.Text = "Update";
CloseConnection();
}
if (e.CommandName == "DeleteButton")
{
int id;
id = Convert.ToInt32(raw.Cells[2].Text);
ViewState["subid"] = id;
SqlCommand cmd = newSqlCommand("DeleteSubCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@SubCategoryId", SqlDbType.Int);
parm.Value = id;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
//LeeGunn.Web.UI.MessageBox.MessageBox.Show("Record Deleted Successfully");
cmd.Dispose();
BindControl();
ClearData();
CloseConnection();
}
}
protectedvoid GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
User Master :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassAdmin_UserMaster : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
if (btnsubmit.Text == "Submit")
{
SqlCommand cmd = newSqlCommand("InsertUser", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@UserName", SqlDbType.VarChar);
parm.Value = txtunm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Password", SqlDbType.VarChar);
parm.Value = txtpsw.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@UserFullName", SqlDbType.VarChar);
parm.Value = txtufnm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Email", SqlDbType.VarChar);
parm.Value = txtemail.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@ContactNo", SqlDbType.VarChar);
parm.Value = txtcno.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Address", SqlDbType.VarChar);
parm.Value = txtadd.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Gender", SqlDbType.VarChar);
parm.Value = DropDownList1.SelectedValue; ;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Seq_Ques", SqlDbType.VarChar);
parm.Value = DropDownList2.SelectedValue;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Answer", SqlDbType.VarChar);
parm.Value = txtans.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
ClearFields();
cmd.Dispose();
CloseConnection();
}
}
protectedvoid DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protectedvoid Button2_Click(object sender, EventArgs e)
{
ClearFields();
}
protectedvoid ClearFields()
{
txtunm.Text = "";
txtpsw.Text = "";
txtufnm.Text = "";
txtemail.Text = "";
txtcno.Text = "";
txtadd.Text = "";
txtans.Text = "";
}
}
User
CustomerRegisratition:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassUser_CoustomerRegistrition : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
protectedvoid btnsubmit_Click(object sender, EventArgs e)
{
if (btnsubmit.Text == "Submit")
{
SqlCommand cmd = newSqlCommand("InsertCustomer", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
cmd.ExecuteNonQuery();
ClearFields();
cmd.Dispose();
CloseConnection();
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
ClearFields();
}
protectedvoid ClearFields()
{
txtunm.Text = "";
txtpsw.Text = "";
DropDownList2.SelectedValue = "";
txtfnm.Text = "";
txtmnm.Text = "";
txtlnm.Text = "";
DropDownList1.SelectedValue = "";
txtbd.Text = "";
txtconm.Text = "";
txtadd.Text = "";
txtans.Text = "";
}
}
Change Password:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using
using
using
using
System.Web.UI.WebControls;
System.Data.SqlClient;
System.Data;
System.Configuration;
publicpartialclassUser_ChangePassword : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid ClearData()
{
txtpsw.Text = "";
txtnpsw.Text = "";
txtunm.Text ="";
}
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@Password", SqlDbType.VarChar);
parm.Value = txtpsw.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
cmd.ExecuteNonQuery();
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Password SuccessFuly
Changed");
ClearData();
CloseConnection();
}
else
{
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Password Does Not
Match");
}
}
catch (Exception ex)
{
}
}
}
using
using
using
using
using
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
System.Data.SqlClient;
System.Data;
publicpartialclassUser_SelectProduct : System.Web.UI.Page
{
publicstaticSqlConnection con;
publicstaticstring strgs2;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionString
s["Shopping"].ToString());
strgs2 = Request.QueryString["SubCategory"].ToString();
SqlCommand cmd = newSqlCommand("ReadProduct", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd = newSqlCommand("SelectProductForSubCategoryWise", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@SubCategoryId", SqlDbType.Int);
parm.Value = strgs2.ToString();
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
DataList1.DataSource = dr;
DataList1.DataBind();
dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
protectedvoid DataList1_ItemCommand(object source,
DataListCommandEventArgs e)
{
if (e.CommandName == "view")
{
Label lblCategory = (Label)e.Item.FindControl("Label4");
Response.Redirect("DetailsData.aspx?Product=" + lblCategory.Text);
}
}
protectedvoid ViewMore_Click2(object sender, EventArgs e)
{
try
{
SqlCommand cmd = newSqlCommand("ProductDetails", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
dr.Close();
CloseConnection();
}
catch
{
}
}
}
Select SubCategory:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
publicpartialclassUser_SelectSubCategory : System.Web.UI.Page
{
publicstaticSqlConnection con;
publicstaticstring strgs1;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionString
s["Shopping"].ToString());
strgs1 = Request.QueryString["Category"].ToString();
SqlCommand cmd = newSqlCommand("ReadSubCategory", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("ReadProduct", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd = newSqlCommand("SelectSubcategoryforcategorywise", con);
cmd.CommandType = CommandType.StoredProcedure;
parm = newSqlParameter("@CategoryId",SqlDbType.Int);
parm.Value = strgs1.ToString();
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
DataList2.DataSource = dr;
DataList2.DataBind();
dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
Forgot Password:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
publicpartialclassUser_ForgotPassword : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(ConfigurationManager.ConnectionStrings["shopping"].ToString
());
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
publicvoid clearData()
{
txtunm.Text = "";
txtconm.Text = "";
}
protectedvoid btnsubmit_Click(object sender, EventArgs e)
{
try
{
SqlCommand cmd = newSqlCommand("ReadForgotPassword", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = newSqlParameter("@UserName", SqlDbType.VarChar);
parm.Value = txtunm.Text;
parm.Direction = ParameterDirection.Input;
cmd.Parameters.Add(parm);
parm = newSqlParameter("@ContactNo", SqlDbType.VarChar);
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
lnkpassword.Text = dr["Password"].ToString();
}
}
else
{
con.Close();
}
con.Open();
publicvoid CloseConnection()
{
con.Close();
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
try
{
string strg = "select * from CustomerTable where UserName='" + TextBox1.Text +
"' and Password='" + TextBox2.Text + "'";
SqlCommand cmd = newSqlCommand(strg, con);
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read() == true)
{
Session["UserName"] = Button1.Text;
Response.Redirect("UserWelcome.aspx");
}
else
{
lblMessage.Text = "UserName and Password Does Not Match";
}
dr.Close();
cmd.Dispose();
CloseConnection();
}
catch (Exception ex)
{
lblMessage.Text = ex.Message.ToString();
}
}
protectedvoid LinkButton1_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("ForgotPassword.aspx");
}
}
Welcome Page:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
publicpartialclassUser_UserWelcome : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con =
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionString
s["Shopping"].ToString());
Label1.Text = Session["UserName"].ToString();
SqlCommand cmd = newSqlCommand("ReadCategory",con);
cmd.CommandType = CommandType.StoredProcedure;
// SqlParameter parm = new SqlParameter("ReadSubCategory", con);
//cmd.CommandType = CommandType.StoredProcedure;
OpenConnection();
SqlDataReader dr = cmd.ExecuteReader();
DataList1.DataSource = dr;
DataList1.DataBind();
dr.Close();
cmd.Dispose();
CloseConnection();
}
publicvoid OpenConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
publicvoid CloseConnection()
{
con.Close();
}
protectedvoid DataList1_ItemCommand(object source,
DataListCommandEventArgs e)
{
if (e.CommandName == "view")
{
Label lblCategory = (Label)e.Item.FindControl("lblid");
Response.Redirect("SelectSubCategory.aspx?Category=" +
lblCategory.Text);
}
}
8. Code Efficiency
Efficiency of code is mainly dependent on how intelligently coding is done. There is no
specific technique by which any one can say, this is the efficient code and other one is a bad
one, it all depends on the programmer that how efficiently he uses his intellect. And the other
most important thing is the way one is handling the language; which is used to develop the
code and for that one has to have proper knowledge of language.
But still there are some common techniques and structures; if any one follows that then
his/her code can become quite efficient.
E.g. Variable Naming Conventions, Properly used scope of variable, use of control structure
and looping structure in a easier and a simpler way as much as possible.
To write code in a proper order and sequence, the order and sequence again depends on the
programmer and the situation.
9. Optimization Of code
If coding is done efficiently than it should also be used or done optimistically. i.e. best use of code.
What is the reason behind this optimization?
Optimization means make best or most effective use.
E.g. there is one efficient function or efficient environment oriented language or tool is
available but if optimum use of that function or tool or language makes the whole program
more simpler, effective and user friendly also.
Now, how to optimize? Again it mostly depends on the programmer, that how intelligently he
is doing all those things, still there are some basic rules to make our code optimistic.
First thing is, develop the code which is general i.e. that code cannot be purposefully
developed only by one angle. i.e. only for current system. Programmer must be awake of all
the general usage of that code, at least he/she has to look out onto most of the probabilistic
events or conditions or specifications that can occur. The most usage of any function can also
be cleared prior to making them, then only one can develop the general purpose code which
can be said as optimization of code. So ultimately code must be reusable.
Second is, Modularization i.e. most important thing for optimization. If total code is
distributed in proper modules prior to start of the actual coding then its a better way of
coding. General Module i.e. Standard Module is used.
Third thing is capabilities; utilities and facilities which are provided by language or tool or
environment in which the programmer is developing the code must be properly known.
Active X Control named as EdgeCtl.ocx
The most important thing to use OCX is its Reusability.
MDI is used so, automatically it optimizes the code.
The Optimization goal is achieved by combining the OCX and MDI.
11. Testing
System Testing
A system is tested for online responses, volume of transactions, stress, and recovery from
failure, and usability. System testing involves two kinds of activities Integration testing and
acceptance testing.
Integration Testing
Bottom up integration is the traditional; strategy used to integrate the components of a
software system into a functioning whole. Bottom-up integration consists of unit testing,
followed by subsystem testing, followed by testing of the entire system. Unit testing has the
goal of discovering errors in the individual modules of the system.
Unit Testing
A program unit is usually small enough that the programmers who developed it can test it in
great detail and certainly in greater detail will be possible when the unit is integrated into an
evolving software product.
There are four categories of tests a programmer will typically perform on a program unit:
1. Functional Tests: specify operating conditions, input values and expected results. For
example the function Numeric written to check whether data is numeric or not the argument
can be passed as null argument.
3. Stress Tests: are designed to overload a system in various ways. The purpose of test is
to determine the limitations of the system. During multiple query execution the available
memory can be reduced to see whether the program is able to handle the situation.
4. Structural Tests: are concerned with examining the internal processing logic of a
software system. For example, if a function is responsible for tax calculation, the verification
of the logic is a structural test.
To test the code there are two testing methods, which are very popular they mentioned below
1. White box 2. Black Box.
Database Testing
Modern Web Application does much more than present static content objects. In many application
domains, Web Application interface with sophisticated database management system and build dynamic
content object that are created in real time using the data acquired from a database.
Database Testing for Web Application is complicated by a variety of factor.
1) The original client side request for information is rarely presented in the form that can be input to a
database management system.
2) The database may be remote to the server that houses the Web application.
3) RAW data acquired from the database must be transmitted to the Web application Server and properly
formatted for subsequent transmittal to the client.
4) The dynamic content objects must be transmitted to the client in a form that can be displayed to the end
user.
[Layers of interaction]
In figure testing should be ensure that
1. Valid information is passed between the client and server from the interface layer
2. The Web application process script correctly and properly extract or formats user data.
1. Queries are passed to a data management layer that communicates with database access
routines.
2. User data are passed correctly to a server side data transformation function that format
appropriate queries.
Interface Testing
Interface design model is reviewed to ensure that generic quality criteria established for all user
interfaces have been achieved and that application specific interface design issue has been properly
addressed.
Compatibility Testing
Web application must operate within environment that differs from one another. Different
computer, display device, OS, browser and network connection speed can have significant on Web
application operation. Different browser some time produced slightly different results, regardless of the
degree of HTML standardization within the Web application.
The Web Engineering team derives a series of compatibility, validation tests, derived from
existing interface tests, navigation tests, performance tests and security tests.
Cost Estimation
Here, I have roughly rounded the cost estimation:
This is just a rough estimation, so it can be predicted more or less in some cases
than actual estimation.
Total there are 20 forms in the software so designing and coding costing around
10000 Rs. + Reports costing 10000 and + Database 10000 = 50000 Rs.
The cost of Extra Reports, Utilities, and Original software, Hardware are not
estimated and included in the cost estimation.
No
1
2
3
4
5
6
7
8
9
Project Goals
Analysis
Feasibility Study
Soft. Eng. Para.
Requirement Spec
Design
Coding
Validation Checks
Testing
Implementation
&
Starting Date
01-OCT-2014
21-DEC-2014
15-DEC-2014
01-JAN-2015
04-JAN-2015
06-FEB-2015
09-MAR-2015
20-MAR-2015
28-MAR-2015
10
Maintenance
Documentation
all
Ending Date
20-NOV-2014
15-DEC-2014
30-DEC-2014
03-JAN-2015
04-FEB-2015
08-MAR-2015
19-MAR-2015
27-MAR-2015
28-MAR-2015
the
Schedule
14. chart
Pert Chart
Days
50
25
15
2
30
32
10
7
2
2
Feasibility
13%
Analysis
27%
Soft. Par.
8%
Req.
1%
Impl.
6%
Design
16%
Coding
21%
Testing
8%
Val.
2%
Though the basic requirement is fulfilled, there is a scope for further work that can be done with
existing system to make administrator more power full.
User has own account in which he/she can store all details about previous order.
I am going to add facility like currency converter so any user of other country can know the
price of the products according to their currency.
After deliver the products I will send SMS for conformation to the customers on their mobile
phone.
16. bibliography
Books
ASP.NET(Black Book).
Professional ASP.NET(Wrox Publication).
C# Vijaymukhi.
ASP.NET Complete Reference.
Software engineering Concepts By Roger S.Presman
UML IN A NUTSHELL By Alhir
Fundamentals of Software Engineering By Rajib Mall
SQL Server 2008 (Wrox Publication).
Web Sites
www.google.com
www.dotnetspider.com
17. Synopsis
Project Synopsis
ONLINE SHOPPING CART
(Implemented in ASP.Net (Code Behind C#), SQL SERVER 2005)
A PROJECT SYNOPSIS SUBMITTED TO INDIRA GANDHI NATIONAL OPEN UNIVERSITY IN PARTIAL
FULFILLMENT OF THE REQUIREMENTS FOR THE AWARD OF
SUBMITTED BY
JAIMEEN GOPALBHAI AGRAWAL
(BCA-122625863)
INDIRAGANDHINATIONALOPENUNIVERSITY
Index
Contents
1.
Title of Project
2.
Introduction
3.
Objective
4.
Project Category
5.
SRS
6.
System Requirement
7.
System Analysis
Problem Definition
Primary investigation
DFD
E-R Diagram
8.
Modular Description
9.
10
Process Logic
ONLINE SHOPPING
2: Introduction
On-Line Shopping System is a web-based project which is made
for remote-shopping or shopping through Internet. As the technology is being
advanced the way of life is changing accordance. Now a days we can place
the order for any thing from our home. There is no need to go the shop of the
things we want. The order can be placed online through Internet. The
payment, the confirmation of purchasing; we can do every thing we want.
Now we can think that how the days have been changed with time. People
had to stand in rows to wait there terms to buy a particular thing from a
popular shop. But what is happening now a days; we can extremely surprise
that those things can be available on the door-step in few hours.
People had to suffer the rush of the market when they went for
shopping. They used to think hundred times to buy any thing having the
sufficient money for shopping. The problem was the rush; the quarrel at the
time of buying the things. But the advancement of technology brought the
new way for shopping. The way of shopping was completely changed with
the coming of Internet Technology. People have to fill a simple form on the
internet to place their order on any popular shop or shopping-mall for the
thing they want to buy. Now they can place their order from the home.
This project entitled On-Line Shopping is an implementation of the above
description. It means, it implements the E-shopping or in other word
shopping through Internet. It lets the user to place their order online for any
article.
3:Objective
Today the internet and its boom have created a new economic scenario that
not only stresses on the classical concept of the product but also on the
modern concept of service. It is this level of service that dictates whether a
commercial venture will succeed or not in the market. To provide a high
accessibility of service we will design the online shopping website, so that
potential customers need not go to a physical shop to buy products or
services.
There are several objective of this websites are following given bellows.
This site is gives all the information about the e-shopping to provide
better service for the customer.
It provides the facility to the customers who want to shop on-line due
to lock of time.
Its providing the full details about the product and related information
about the product like cost, size etc.
With the help of it we can save the time and money also.
It provides the remote shopping by the cash, or DD, or Debit card also.
4:PROJECT-CATEGORY
Web-Based Application Software with RDBMS:
This System i.e. On-Line Shopping is a web based application software
which perform the activities like Administering, providing information to the
shopping by the remote system or through internet. The nature of this
software to handle a particular task thats why it is the category of
application software.
This project falls under The Category of Internet
Technologies with RDBMS, since the project is mainly for providing on-line
shopping of the different items. This project is utilizing Relational Databases
as back-end. Having on-line services for the interested user it has great
demand in market. As we know that Internet is huge client-server
architecture. The client is a web browser; it is requesting a web based data, a
file, or whatever, from the sever staying anywhere in the world. Server is
nothing the service provider which provides services to the client. It holds
almost all the information that client side wants.
I have uses .Net framework to develop the software. Asp.Net is
rich set programming framework for building web-based application. It offers
amazing support to both developer and administrator.
and
analyzed
these
requirements
to
weed
out
documentation
for
the
findsjobs.com
&
its
Service
b) Interfaces
Interface
with
devices:
The
website has
just one
6:REQUIREMENT SPECIFICATION
Hardware Requirement:Processor
Secondary Storage
: 80 GB HDD
ROM
Memory
: 2 GB RAM
Network Adapter
: Ethernet Adapter
Modem
Others
Software Requirement
Platform
Operating System
: Windows
: Windows XP / 7 / 8 Professional
Framework
Front-End Tool
Editing Tool
Scripting Tool
C# is the language that uses both CUI and GUI Interfaces thus more
flexibility.
In
todays
competitive
environment,
an
organization
wants
7:SYSTEM ANALYSIS:
Problem Definition: The e-shopping Administrator is the super user and has complete control over all the
activities that can be performed. The application notifies the administrator of all shop creation requests, and
the administrator can then approve or reject them. The administrator also manages the list of available
product categories. The administrator can also view and delete entries in the guestbook.
Shop Owner: Any user can submit a shop creation request through the application. When the request is
approved by the Mall Administrator, the requester is notified, and from there on is given the role of Shop
Owner. The Shop Owner is responsible for setting up the shop and maintaining it. The job involves managing
the sub-categories of the items in the shop. Also, the shop owner can add or remove items from his shop.
The Shop Owner can view different reports that give details of the sales and orders specific to his shop. The
Shop Owner can also decide to close shop and remove it from the mall.
Employees: Purchase department under a Purchase manager to overlook purchasing activities if
warehousing needs arise.
Sales department under a Sales manager who will look after the sale of products and services, the most
important activity.
Accounts department under an Accounts manager to look after the accounting activities of the enterprise.
DFD at 0 Level:
1 Level DFD:
2 Level DFD:
8:MODULE DESCRIPTION
We know that it is quite difficult to do any thing of its whole part at a time.
So it is the task of the programmer to break/split the whole set of task into
various small module so that one can handle them effectively. But it depends
upon the software system that in which Extent it will be broken so that there
is no inter-dependency among them.
This project developed for On-Line Shopping is broken into
following module.
1. Admin Module
2. User Module
3. Customer Service Module
4. Advertisement Module
5. Employee Module
6. Payment Module
7. Purchase Module
8. Product Tracking Module
9. Searching Module
10. Report Module
11. Security
2. USER
PAGE MODULE:-
system. It is the main page of the system in which all the links of this
system are kept. Now the main thing is how to make the home page
interactive and user friendly so that there should not be any problem for
the user. This is the task of the system administrator to make the home
page Interactive.
3. CUSTOMER
customer will use this website to on-line shopping. And also the
customer send the request to the shopping.
4. ADVERTISEMENT
MODULE:-
In
any
web
based
application
advertisement.
This
module
also
calculates
the
cost
of
5. EMPLOYEE
information stored and managed in this module. Employee will look all
the demand of the customer and serve it.
6. PAYMENT
7. PURCHASE
9. SEARCH
10.
11.
SECURITY MODULE:-
Data Type
Integer
Size
5
Validation
2.
Field Name
S.No (autoincrement)
U_name
Varchar
20
Primary Key
3.
Password
Varchar
20
Data Type
Varchar
Varchar
Date
Size
20
20
Field Name
E_Id
E_Name
J_date
Validation
Primary key
4.
5.
6.
7.
8.
9.
Sex
Address
Phone No
DOB
Salary
Specialization
Varchar
Varchar
Integer
Date
Integer
Varchar
6
50
10
Data Type
Integer
Varchar
Size
5
20
Validation
Validation
10
20
Category Table:
S.R
1.
2.
Field Name
Category id
Name
Primary Key
Sub-Category Table:
S.R
1.
2.
Field Name
Sub-Category id
Name
Data Type
Integer
Varchar
Size
5
20
Category Id
Integer
Primary Key
Field Name
First Name
Data type
Varchar
Size
20
2.
3.
4.
5.
6.
7
8
9
10
11
Middle Name
Last Name
Address
Contact_no
Gender
Birth Date
User Name
Password
Question
Answer
Varchar
Varchar
Varchar
Integer
Varchar
Integer
Varchar
Varchar
Varchar
Varchar
20
20
300
12
10
20
20
20
500
1000
Purchase Table:
Validation
Primary
key
S.R
1.
2.
3.
4.
5.
6.
Field Name
Pur_id
ItemName
Rate
Item_category
Quantity
Date
Data type
Varchar
Varchar
Varchar
Varchar
Integer
Datetime
Size
10
300
100
300
5
Validation
Primary key
Data type
Varchar
Varchar
Varchar
dateTime
dateTime
Varchar
Varchar
Varchar
Varchar
Size
10
30
79
Validation
Primary key
Data Type
Varchar
Varchar
Date
Varchar
Varchar
Integer
Integer
Size
20
200
Advertisement Table:
S.R
1.
2.
3.
4.
5.
6.
7.
8.
9.
Field Name
Ad_id
Ad_name
Image
Ad_start_date
ad_end_date
Comp_name
Address
Contact_no
Email
89
78
12
78
Payment Table:
S.R
1.
2.
3.
4.
5.
6.
7.
Field Name
P_id
P_name
P_date
Cust_name
Pay_mode
Cash
DD
67
50
10
23
Validation
Primary key
S.R
1
2
S.R
3
1.
Field Name
State Id
State
Field Name
Name
Country
ID
P_id
Data Type
Varchar
Varchar
Data Type
Varchar
Varchar
Size
20
20
Size
20
20
2.
3.
4.
5.
6.
7.
Cust_name
Delvr_date
Amount
Contact_no
Address
Email
Varchar
Date
Varchar
Varchar
Varchar
Varchar
200
Validation
Primary key
Validation
Primary key
67
50
100
56
Country Table:
Field Name
StateId
StateName
CountryID
Data Type
Varcher
Varchar
Varchar
Size
20
50
50
Validation
Primary key
Data Type
Varchar
Varchar
Varchar
Size
20
20
20
Validation
Primary key
Data Type
Varchar
Varchar
Varchar
Size
20
20
20
Validation
Primary key
City Table:
S.R
1
2
3
Field Name
City Id
City Name
State ID
10 :PROCESS LOGIC
Process logic is concerned with how the system interact with users and
fulfill there requirements? Being a web based system; user of this system
can easily access this system through Internet. It provides various
functionalities, attracts the user to use it, and makes the user comfortable to
work on it.
Before providing access to the manipulating authorities, it first
demands for user name and password based on user type. If the name and
password entered are correct then one can enter the admin menu and can
change any contents from this place. Note that it also works as a public
website where one can see the information based on the purpose to access
this website. There is no need for authentication here, because they has to
only access the site not change or update any content and they also cannot
change it because they have no authority to change. Here user finds various
menus and sub menus and can select any one of them as there requirement.
Let I explain the process logic of admin module that how one
can perform the task of administrator. First one has to give user name and
password which should be checked by the system on the basis of information
stored in the database.
13:BIBLIOGRAPHY
Books:
Software engineering by Roger s. Pressman