Date post: | 10-Dec-2015 |
Category: |
Documents |
Upload: | sunil-joshi |
View: | 11 times |
Download: | 3 times |
Project Report
Online Shopping Cart (Implemented in ASP.Net (Code Behind C#), SQL SERVER 2008)
A PROJECT REPORT SUBMITTED TO INDIRA GANDHI NATIONAL OPEN UNIVERSITY IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE AWARD OF
BACHELOR’S IN COMPUTER APPLICATIONS (BCA)
SUBMITTED BY
KARANSINH RAJENDRASINH PARMAR
(BCA-126339493) UNDER THE GUIDENCE OF
Mr. Kamlesh Rajguru(MCA)
INDIRA GANDHI NATIONAL OPEN UNIVERSITY
SCHOOL OF COMPUTER AND INFORMATION SCIENCES
INDIRA GANDHI NATIONAL OPEN UNIVERSITY
MAIDAN GARHI, NEW DELHI – 110 068.
2015
CERTIFICATE OF ORIGINALTY
This is to certify that the project report entitled Online Shopping Cart
Submitted to Indira Gandhi National Open University in partial fulfillment of the requirement for the award of the degree in BACHELOR’S OF COMPUTER APPLICATIONS (BCA) , is an authentic and original work carried
out by KARANSINH R. PARMAR Enrolment No.: BCA- 126339493 under the
guidance of Mr. KAMLESH RAJGURU[MCA] The matter embodied in this project is a genuine work done by the student and has not been submitted
whether to this University or to any other University / Institute for the fulfillment of the requirement of any course of study.
Signature of the Student Signature of the Guide
Name and Address Name, Designation and
of the student : Address of the Guide
Enrollment No : 126339493
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 co-
operation 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: 15/04/2015 (KARANSINH RAJENDRASINH PARMAR)
Place: VADODARA
Index
Sr. No. Topic Page No. 1 Introduction & Objectives of the Project.
Introduction & Objectives. Definition
2 Feasibility Study
Technical Feasibility Economical Feasibility Operational Feasibility Legal Feasibility Financial Feasibility
3 Software Engineering Paradigm Applied
Introduction to Software Software Development Life Cycle Meaning of Spiral Model Spiral Model Analysis Design Testing Implementation
4 Technology & Operation System
.Net Framework Framework Architecture Common Language Specification Common Language Runtime Introduction of Asp.Net Introduction of Asp.Net(C#) Introduction of Sql Server Data Access Layer
5 Software And Hardware Requirement
Specifications
Software Requirement Hardware Requirement
6 Analysis Data Flow Diagrams E-R Diagrams System Flow Diagram
Process Logic Data Dictionary (Tables) Screen Shots Testcases
7 Coding 8 Coding Efficiency 9 Coding Optimization 10 Validation Checks 11 Testing
System Testing Integration Testing Unit Testing White Box Testing Black Box Testing Acceptance Testing
12 Implementation & Maintenance
System Security Security Measures Cost Estimation
13 Reports 14 Chart And Project Schedule 15 Future Scope of the Project 16 Bibliography 17 Synopsis
1. Introduction E-commerce means Electronic Commerce. It is the paperless technology that exchange of
business information using Electronic Data Interchange (EDI) and related technologies.
Electronic mails (E-mail), faxes, computer bulletin boards, Electronic Funds Transfer are all
forms of E-Commerce. All E-Commerce systems replace all or key parts of paper-based work
flow with faster, cheaper, more efficient and more reliable communications between machines.
Online auctions are an extension of this general idea into Cyberspace. E-commerce rapidly
became the most successful and popular implementation of the idea. It enabled thousands of
people to advertise goods for sale on the eBay website. People bid for the items online, and at the
close of the auction, the highest bid wins. The process goes like this:
1. Seller lists an item, and potential buyers bid
2. Sale ends at predetermined time
3. eBay sends contact data to buyer and seller
4. Buyer and seller arrange shipping details
5. Buyer sends funds – seller sends goods
6. Buyer and seller rate each other via the eBay feedback forum
7. Seller pays eBay a listing fee and, in case of a sale, a final value fee .
The system was developed to allow a user to search for product availability in a specific product
group and give description, availability and price of product (Mobile, Camera, Television,
Computer etc.). It should also show the current location of the product available in the city.This
application is three-tier client server web based application. This system contains two modules:
a) Client module
b) Administrator module
CLIENT MODULE:
In the client module, Clients can search or view the product, information of the
product availability in the city. Also he/she can view the product and can add it to their cart
and buy it online. He/She can view the image and description of product.
Client can register and place his\her order by filling up the personal detail and
shipping address. Client can have advantages of offers of discount on some product
and they can pay as per their convenient by credit card or by cash. Client can put the
advertisement of their own product as a sponsor.
ADMINISTRATOR MODULE
The administrator module contains the following sub-modules:
a) Product Management.
b) Inquiry Management.
c) Sponsor Management.
PRODUCT MANAGEMENT
The product management sub-module provide following type of facilities. The
administrator can add the new product in the application. The administrator
can view, edit and delete the product. The administrator can search and view
the product. The administrator can upload the multiple products concurrently.
INQUIRY MANAGEMENT
The inquiry management sub module provide following type of facilities. The
administrator can view, edit, delete inquiry send by client for add new product
and send reply through E-mail. The administrator can view the reseller and
purchase inquiry of customer and reply through the E-mail.
SPONSOR MANAGEMENT
The Sponsor management sub-module provide following type of facilities.
Administrator can add the new advertisement for particular product. The
administrator can view, edit, delete the inquiry send by the client for add new
advertisement for particular product. The administrator can search and view
the advertisement for particular product. The administrator can set and disable
the advertisement of particular product.
Features of the system
Search product and it’s detail without refreshing page
View advertisement of the product with result of search product.
Any client can buy product by searching product on line for Specific City.
Provides authorization and security.
Administrator can search product, product information, and also view, edit and delete
product.
2.2 Objective
One of the main objectives is to improve the management of the shopping mall via online
shopping by asserting increasing trend.
The online shopping is more convenient for customers. It reduces the dependency on the
vendors. Moreover, the customer is freed from the pressure of buying a product.
There are infinite shelf space available when u shopping through the website or online.
For comparing the quality, quantity, product price, and their features so that customer can
buy a best product.
The need of system is that there is a time savings of customer as well as the vendors who
selling the particular product.
Requirement of a more than one or more different types of products are available for
purchasing as a customer point of view.
1) To shop wile in the comfort of your own home, without having to step out of the door
2) To be able to easily save money and compare prices from website to website
3) Online resellers tent to sell at a lower price due to less overhead expenses
Internet commerce should be viewed as a new way of value creation and provision. To attract
consumers to visit Web sites, a critical question is: What are their major concerns in Internet
shopping? Nine fundamental objectives to describe the bottom line concerns to Internet
consumers have been proposed in the literature. From the perspective of the means-end chain
theory and by focusing on the shopping goods, this study proposed that different weights on
these nine fundamental concerns are assigned by different lifestyle individuals. Based on the
results of a survey of 181 on-line respondents who provided consistent data, this study indicated
that privacy, safety, and product quality were the most critical concerns of on-line consumers,
contradicting the conventional wisdom that cost and convenience are the key concerns for
consumers shopping on-line. Furthermore, for those consumers with active style, privacy factor
received significantly more concern than safety and product quality. Respondents who preferred
variety and excited lifestyle put more weights on these three Internet fundamental objectives than
consumers with other lifestyles. However, principle lifestyle individuals put more weight on
other factors, such as shopping enjoyment, environmental impacts, time to receive products, and
less weight on cost and convenience.
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:
Estimated finance is there or not?
The man power to operate the system is there or not?
The man power is trained or not?
All the above conditions must be satisfied to start the project. This is why in depth analysis of
feasibility is carried out.
There are three different ways feasibility can be tested
1) Technical Feasibility
2) Economic Feasibility
3) Operational Feasibility.
4) Financial feasibility
5) Legal feasibility
Technical Feasibility:
It is basically used to see existing computer, hardware and software etc., weather it is sufficient or
additional equipment’s 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 user’s 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:
Total estimated cost of the project
Financing of the project in terms of its capital structure, debt equity ratio and promoter's share of
total cost
Existing investment by the promoter in any other business
Projected cash flow and profitability
Final Conclusion of the Feasibility Study
Finally, from the whole study it can be concluded that the system is technically feasible, initially
if we see then the initial cost is high but by studying economical feasibility with improved level services,
customer may be attracted towards the Star Placement Services and ultimately that is our aim . Other
feasibility aspects are satisfied with considering certain risk factor, which is always present in any
proposed system project.
After completing the feasibility study I described the whole study and presented the report of the
study to the Chief Manager of Starnet Services.
We discussed about dates to start the real specification of the system and the designing days and
further details. We discussed roughly about the model of the actual software system, how it could take
place etc.
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
Services in the meeting.
Let’s 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 user’s point of view, the work product is the resultant information that somehow
makes the user’s 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)
Engineering and Scientific Software
Engineering and scientific software have been characterized by “number crunching”
algorithms. Application range from astronomy to volcanology, from automotive stress
analysis to space shuttle orbital dynamics, and from molecular biology to automated
manufacturing.
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.
Personal computer software
The personal computer software market has burgeoned over the past two decades. Word
processing, spreadsheets, computer graphics, multimedia, entertainment, personal and
business financial applications, external network, and database access are only a few of
hundreds of applications.
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)
Artificial intelligence software
Artificial intelligence (AI) software makes use of nonnumeric algorithms to solve
complex problems that are not amenable to computation or straightforward analysis. Expert
systems, pattern recognition (image and voice), artificial neural networks, theorem proving,
and game playing are representatives of applications within this category.
This proposed project could be put in the category of BUSINESS APPLICATION
SOFTWARE.
Software Development life cycle
The systems development life cycle (SDLC) is a conceptual model used in project
management that describes the stages involved in an information system development project, from an
initial feasibility study through maintenance of the completed application.
Various SDLC methodologies have been developed to guide the processes involved, including
the waterfall model (which was the original SDLC method); rapid application development (RAD); joint
application development (JAD); the fountain model; the spiral model; build and fix; and synchronize-and-
stabilize. Frequently, several models are combined into some sort of hybrid methodology. Documentation
is crucial regardless of the type of model chosen or devised for any application, and is usually done in
parallel with the development process. Some methods work better for specific types of projects, but in the
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.
Meaning of Spiral Model
A software life-cycle model which supposes incremental development, using the waterfall for
each step, with the aim of managing risk. In the spiral model, developers define and implement feature in
order of decreasing priority.
The steps in the spiral model can be generalized as follows:
The new system requirements are defined in as much detail as possible. This usually involves
interviewing a number of users representing all the external or internal users and other aspects of the
existing system.
SPIRAL MODEL
A preliminary design is created for the new system.
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 testing’s
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
Following are the types of testing:
1. White Box Testing
2. Black Box Testing
White Box Testing
White-box testing is a method of testing software that tests internal structures or workings of an
application, as opposed to its functionality (i.e. black-box testing). In white-box testing an internal
perspective of the system, as well as programming skills, are required and used to design test cases. The
tester chooses inputs to exercise paths through the code and determine the appropriate outputs. This is
analogous to testing nodes in a circuit, e.g. in-circuit testing (ICT).
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.
Black Box testing
Block Box Testing is a method of testing that tests the functionality of an application as opposed
to its internal structures or workings (see white). Specific knowledge of the application's code/internal
structure and programming knowledge in general is not required. Test cases are built around
specifications and requirements, i.e., what the application is supposed to do. It uses external descriptions
of the software, including specifications, requirements, and designs to derive test cases. These tests can be
functional or non-functional, though usually functional. The test designer selects valid and invalid inputs
and determines the correct output. There is no knowledge of the test object's internal structure.
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
4.Technology And Operation System
The .Net Framework
A frame work is commonly thought of as a set of class libraries that aid in the development of
applications. The .net framework is more than just a set of classes. The .net framework is targeted by
compliers using a wide variety of applications. Including everything from small components that run on
handheld devices to large Microsoft ASP.ET application that span web farms, where multiple web serves
act together to improve the performance fault tolerance of a web site. The .NET framework is responsible
for providing a basic platform that these applications can share. This basic platform includes a runtimes
set of services that oversee the execution of applications. A key responsibility of the runtime is to manage
execution so that software written by different programming languages uses classes and other types
safely.
Microsoft .Net Framework Architecture
Microsoft's .NET Framework is comprised of two main components - the Common Language
Runtime (CLR) and the .NET Framework class libraries. The CLR is the real foundation of the .NET
Framework. It is the execution engine for all .NET applications. Every target computer requires the CLR
to successfully run a .NET application that uses the .NET Framework.
The main features of CLR include:
Automatic Memory Management
Thread Management
Code Compilation & Execution
Code Verification
High level of security
Remoting
Structured Exception Handling
Interoperability between Managed and Unmanaged code.
Integration with Microsoft Office System
All .NET applications are compiled into Intermediate Language code (MSIL). When executed on the
CLR, MSIL is converted into native machine code specific to the operating platform. This process is done
by a Just in Time (JIT) compiler. The code executed by the CLR is called as Managed Code. This code is
type safe and thoroughly checked by the CLR before being deployed. The .NET runtime also provides a
facility to incorporate existing COM components and DLL's into a .NET application. Code that is not
controlled by the CLR is called Unmanaged Code.
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
Common Language Specification
To fully interact with other objects regardless of the language they were implemented in, objects
must expose to callers only those features that are common to all the languages they must interoperate
with. For this reason, the Common Language Specification (CLS), which is a set of basic language
features needed by many applications, has been defined. The CLS rules define a subset of the Common
Type System; that is, all the rules that apply to the common type system apply to the CLS, except where
stricter rules are defined in the CLS. The CLS helps enhance and ensure language interoperability by
defining a set of features that developer can rely on to be available in a wide variety of languages. The
CLS also establishes requirements for CLS compliance; these help you determine whether your managed
code conforms to the CLS and to what extent a given tool supports the development of managed code that
uses CLS features.
If your component uses only CLS features in the API that it exposes to other code (including
derived classes), the component is guaranteed to be accessible from any programming language that
supports the CLS. Components that adhere to the CLS rules and use only the features included in the CLS
are said to be CLS-compliant components.
The CLS was designed to be large enough to include the language constructs that are commonly
needed by developers, yet small enough that most languages are able to support it. In addition, any
language constructs that makes it impossible to rapidly verify the type safety of code was excluded from
the CLS so that all CLS-compliant languages can produce verifiable code if they choose to do so.
Common Language Runtime
The Common Language Runtime (CLR) is the virtual machine component of Microsoft's .NET
initiative. It is Microsoft's implementation of the Common Language Infrastructure (CLI) standard, which
defines an execution environment for program code. The CLR runs a form of byte code called the
Microsoft Intermediate Language (MSIL), Microsoft's implementation of the Common Intermediate
Language.
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 non-
Windows 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 that’s 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 you’re 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 textbox’s, 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 70’s. 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
(3) Other class libraries of projects in the same solution
(4) XML web services
Features of ASP.NET:
(1) Component Infrastructure.
(2) Language Integration.
(3) Internet Interoperation.
(4) Simple Development.
(5) Simple Deployment.
(6) Reliability.
(7) Security
Introduction to Microsoft SQL Server
Microsoft SQL Server enhances the performance, reliability, and scalability provided by earlier
releases of SQL Server by making the processes of developing applications, managing systems, and
replicating data easier than ever.
All of data processing is involved with the operations of storing and retrieving data. A database,
such as Microsoft SQL Server, is designed as the central repository for all the data of an organization. The
crucial nature of data to any organization underlines the importance of the method used to store it and
enable its later retrieval.
Microsoft SQL Server uses features similar to those found in other databases and some features
that are unique. Most of these additional features are made possible by SQL Server’s tight integration
with the Windows NT operating system. SQL Server contains the data storage options and the capability
to store and process the same volume of data as a mainframe or minicomputer.
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. Microsoft’s 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 as terminals.
Mechanisms must be in place for SQL Server to solve problems that arise from the access of data from
perhaps Hundreds of computer systems, each of which can process portions of the database independently
from the data on the server. Within the framework of a client/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 traditionally haven’t
been available as part of either mainframe or minicomputer databases. In addition to using a dialect of
Structured Query Language (SQL), GUI applications can be used for the storage, retrieval, and
administration of the database.
Data Access Layer:
When working with data one option is to embed the data-specific logic directly into the presentation
layer. This may take the form of writing ADO.NET code in the ASP.NET page's code portion or using the
SqlDataSource control from the markup portion. creating a connection to the database, issuing SELECT,
INSERT, UPDATE, and DELETE commands, and so on – should be located in the DAL.The
presentation layer should not contain any references to such data access code, but should instead make
calls into the DAL for any and all data requests. I have created data access layer for Fill() and Get()
methods. Get is done by two ways.
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
Table’s 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 Adapter’s 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.
5. SOFTWARE AND HARDWAREE
REQUIREMENT SPECIFICATIONS
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.
Hardware and software require
Hardware
Pentium 2.90 Ghz. Or higher microprocessor
320 GB or More Disk Space
4 GB Ram
DVD Driver.
Mouse
Keyboard
Printer
Software
Microsoft Word. (MS Agent), MS-Visio, net Frame works, MS-Sql Server express edition.
Window platform
Any Windows operating system
Details of Hardware and Software used
Details of Hardware Used
Pentium 2.90 Ghz..
320 GB Hard Disk.
4 GB RAM.
Software Used
Application Package used is Microsoft ASP.NET( C # )
Database Package: Microsoft SQL Server 2008.
Othe tools: Microsoft VISIO (UML modeling)
MS-WORD
Window Platform
Operating System: Windows 00 / NT/window XP
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.
What is a Data Flow Diagram?
Data flow diagrams illustrate how data is processed by a system in terms of I/O.
Data Flow Diagram Notations
You can use two different types of notations on your data flow diagrams: Yourdon & Coad or
Gane & Sarson.
Process: A process transforms incoming data flow into outgoing data flow.
: Yourdon & Coad
Process
: Gane & Sarson Process
Data Flow Diagram Layers
Draw data flow diagrams in several nested layers. A single process node on a high level
diagram can be expanded to show a more detailed data flow diagram. Draw the context
diagram
The nesting of data flow layers
Context Diagrams: A context diagram is a top level (also known as Level 0) data flow
diagram. It only contains one process node (process 0) that generalizes the DFD.
Data Flow Diagram
CONTEXT LEVEL DIAGRAM
ONLINE
SHOPPING
PORTAL
SYSTEM
CUSTOMER
ADMIN
Search for ItemItems into Cart
Personal Details of Customer
Items of Gallery
Cart with Items
Bill Receipt
Item Detail product info
Sponsor Detail
Admin login Detail
Admin Username, password
Username, Password
User Information Report
Customer Information Report
Sponsor Information Report
Product Information Report
Context Level Diagram
LEVEL 1- ADMIN SITE
Admin
Username
pwd1
Verify
Uname,
pwd
2
Generate
Login
msg
3
Login
msg
Loginfo
Username
Pwd info msg
Login msg
4
5
6
Operation
Of
Products
Operation
Of
Sponsor
Operation
Of
User
Level 1 of admin site
LEVEL 2- ADMIN SITE FOR USER AND SPONSER
Admin 4.1Add/Edit/
Remove
User
Detail
Uname,
pwd
Loginfo
4.2
Generate
User Info
Report
Uname,
pwd User Info
Report
5.1Add/Edit/
Remove
Sponsor
Detail
Name,
Img path
Sponsor
5.2Id,Name,
Img path Generate
Sponsor Info
Report
Sponsor
Info
Report
Reports
Level 2 of Admin site for sponsor & user
LEVEL 2 - ADMIN SITE FOR ITEMS / PRODUCTS
Admin
6.1
Add/Edit/
Remove
Item
Detail
6.2
Add/Edit/
Remove
Department
Detail
Department
Name,
Desc
6.3
Add/Edit/
Remove
category
Detail
Name,
Desc
6.4
Add/Edit/
Remove
SubCategory
Detail
Name,
Desc
Category
Category
Product
6.5
Add/Edit/
Remove
Product
Detail
Name, Price
Img Path,
Desc
6.6
Generate
Product Info
Report
Name,
Desc
Name,
Desc
Name,
Desc
Name, Price
Img Path,
Desc
Level 2 of Admin site for Items / products
Product
Info
Report
Report
LEVEL 1 - CUSTOMER SITE
Customer
1
Search
For a
Item
Item Name,
Choose
category
2
Search a
Item from
database
Item Name,
category
3
Verify
Uname,
pwd
Customer
Username
Pwd infoUname, pwd
4
Generate
Login
msg
5
Items
Selected
by user
Click for
view cart
6
Add items
info into
cart
name,date
Qty,price
Shoppingcart
7
Generate
Cart detail
8
Add
Personal
Details
Name,addess,
Phno, city,state
customer
9
Generate
Bill
Receipt
Level 1 of customer site
LEVEL 2- CLIENT SITE FOR CART AND BILL
RECEIPT
Customer
1Collect
Items
Choose By
User
Item info
Shoppingcart
1Count the
Sub Total
Of choose
Items
Item
info
name, qty
Price, total1
Cart of
Customer
With items
1Collect
Customer
Personal
detail
Customer
User info
1Collect
Items of
Cart &
total
Shoppingcart
Personal
details
Personal
details
Cart
Detail Bill
Receipt
Cart of customer
Bill Receipt
Level 2 of Client site for cart & bill receipt
Search
Product
User
Category
Department
Cart
Product
Purchase
Product
Dept ID
Category ID
Product ID
Product
Request to buy
Product
Response
LEVEL 1 – USER SEARCH PROCESS
Entity Relationship Diagram
Category
Category Id
Name
Description
SubCatagory
IdName
Category Id
Image Path
Description
Product IdClass Id
Category Id
Description
HAS
ASubCategory
Class
HAS
A
HAS
AProduct
SubCatagory
Id
Name
Category Id
Description
Class IdSubCatagory
Id
Name
Qty
Customer
Customer
Id
Cart Id
Customer
Name
Buy Shopping Cart
City
State
Country
Mobile
Phone
Pin Code
Shipping
Address
Login Name
Password 1
Cart Id
Id
Product Id Unit Price
Qty Total Price
Status
Date
Image Path
Product Id
Product
Category Id
Description
Class IdSubCatagory
Id
Name
Qty
Sales
Schema Diagram
Process Logic
1) Buyer and Seller: It is the user that uses system.
Registration: When new buyer or seller comes, he/she have to make registration.
Login: After registration, new buyer have to make login and if older buyer directly
he/she can make login.
Select Item: After login user will select the item’s information that user want to buy.
Order Item: After buyer view the item, he/she orders the item.
Upload Item’s Info: After login user have to upload his/her item’s information.
Sell Item: After uploading item’s information seller have to follow rules and
regulation of system to sell his/her item.
Upload/Select Item: After login seller or buyer can upload or select the item.
Sell/Order Item: After upload or select the item seller or buyer can Sell or order the
item.
Payment: After selecting item, to get that item, buyer has to make payment through
transaction process.
Logout: After payment process user can logout his/her login.
Start
User
Registration
Login
Seller Buyer
Upload Item's Info.
Sell Item
Select Item
Order Item
Payment
Transaction
Logout
End
Fork
Join
Seller & Buyer
Sell Item/Order
Item
Upload/Select Item
1) Admin: It is the admin that controls the system.
Login: Admin can directly login in the system.
Manage User: After login admin can manage user like admin can change the actor
(buyer/seller).
Manage Products: After login admin can manage products like admin can edit,
delete and update the products.
Manage Advertisements: After login admin can manage
advertisements.
Manage Feedback: After login admin can manage the feedback.
Manage Orders: After login admin can manage buyer and seller’s
orders.
Manage Customer’s Request: After login admin can manage
customer’s Requests.
Start
Login
Manage User (Seller/Buyer)
Manage Products
Manage Advertisements
Manage Feedback
Manage Orders
Manage Cust’s
Request
Logou
t
End
Admin login
Online Shopping
Product Process User Search Purchase Product
Insert
Process
Update
Process
Delete
Process
Simple
Search
Advance
Search
Credit Card
Verification
Product
Verification
Buyer Seller Admin
Login
Manage
Products
Manage
User Manage
Feedback
Manage
Orders Manage
Advertisement
Admin
Manage
Buyer
Products
Manage
Seller
Products
Manage
Buyer
Orders
Manage
Seller
Orders
After login user select as
After select product Admin approved by Adm
User
View
Products
Get
Products
Add to cart
Make
Orders
Payment
Sell
Products
Deliver
Products
Seller
Upload
Products
Buyer
Data Dictionary Data dictionary means it contains the information about all tables include details. There
are eleven tables in my project that are following:
1) ActorMaster
2) RegisteredUser
3) Products
4) Category
5) Cart
6) Feedback
7) OPCRelations
8) Order
9) Payment
10) BuyerPutReq
11) SellerProducts
1) ActorMaster:
Table Name: ActorMaster
Description: This table stores Actor’s number and name, whether he/she is Buyer or
Seller and it is used in master module of my project.
2) RegisteredUser:
Table Name: RegisteredUser
Description: This table stores personal information of User. After registration User can
direct login.
FIELD DATATYP
E
DATA
SIZE CONSTRAINTS DESCRIPTION
ActorNo Int - Primary Key Unique number of Actor
ActorName nchar 10 Not null Name of Actor
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
UserID Nchar 10 Primary Key Unique number of User ID
Password Nvarchar 50 Not null Password of User
Actor Int - Null Name of Actor
FName Nvarchar 15 Not null First name of user
MName Nvarchar 15 Null Middle name of user
LName Nvarchar 15 Not null Last name of user
Address Nvarchar 30 Null Address of User
City Nvarchar 20 Null City of user
State Nvarchar 15 Null State of user
PhoneM Nvarchar 10 Null Unique number of Mobile
3) Products:
Table Name: Products
Description: This table stores information of various products.
4) Category:
Table Name: Category
Description: This table stores ID and Name of product’s category.
PhoneR Nvarchar 15 Null Unique number of Residence
Question Nvarchar 50 Null Personal Questions for User
Answer Nvarchar 50 Null Answers of Personal Questions
Email Nvarchar 20 Not null Email Address of User
LoginDate Datetime - Not null Date & Time of Login
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
Pid Nvarchar 10 Primary Key Unique number of Product ID
PName Nvarchar 30 Not null Name of the product
PDesc Nvarchar 100 Null Description of the product
PImage Image - Not null Image of the product
PImageName Nvarchar 200 Null Name of the image
PPrice Numeric 6,0 Not null Price of the product
PCategoryID Int - Not null Unique number of Category ID
PQnty Int - Null Quantity of the product
Pflag Bit - Not null Flag for show Product
PLoaded Datetime - Not null Date & Time of loaded Product
5) Cart:
Table Name: Cart
Description: This table stores numbers of orders selected by the user (buyer/seller).
6) Feedback:
Table Name: Feedback
Description: This table stores information of user’s feedback or review.
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
SrNo Bigint - Primary Key Unique number of feedback
UserID Nchar 10 Foreign Key Unique number of User ID
Content_f Int - Not null Contents of Feedback
Design Int - Not null Design of Feedback
Usability Int - Not null Usability of Fedback
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
CatID Int - Primary Key Unique number of Category ID
CatName Nvarchar 50 Not null Name of Category
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
ID Nvarchar 50 Primary Key Unique number of Product ID
Quantity Int - Null Quantity of Product
Product Nvarchar 100 Null Name of Product
Cost Numeric 8,2 Null Cost of Product
UserID Nvarchar 50 Foreign Key Unique number of user ID
DownloadSpeed Int - Not null Speed of Download
Comments Nvarchar 500 Null Comments of Feeback
Mailid Nvarchar 50 Not null E-mail address of User
Show Bit - Not null Show the Feedback
7) OPCRelations:
Table Name: OPCRelations
Description: This table stores information of orders and category of products. This table
contains information of order, product and category tables.
8) Order:
Table Name: Order
Description: This table stores information of orders selected by the user (buyer/seller).
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
OrderID Int - Primary Key Unique number of Order ID
OrderDT Datetime - Not null Date & Time of Buying Products
UserID Nchar 10 Foreign Key Unique number of User ID
TotalPrice Numeric 8,0 Not null Total price of Orders
OrderCommit Bit - Not null Show committed Order
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
OrderID Int - Primary Key Unique number of Order ID
Pid Nvarchar 10 Foreign Key Unique number of Product ID
9) Payment:
Table Name: Payment
Description: This table stores information of payment of user’s orders that are selected by the
particular buyer or seller
10) BuyerPutReq:
Table Name: BuyerPutReq
Description: This table stores information of requests that are required by the user (buyer).
Quantity Int - Not null Quantity of product
Price Numeric 6,0 Not null Price of the product
Orderto Nvarchar 50 Null Order of Product
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
Creditcardno Nvarchar 20 Primary Key Unique number of credit card
Pinno Nvarchar 20 Not null Unique number of pin card
Bankname Nvarchar 50 Not null Name of the bank
Ownername Nvarchar 50 Not null Name of the owner
Deliveryaddr Nvarchar 200 Null Delivery address of User
Userid Nchar 10 Foreign Key Unique number of User ID
Ordered Int - Not null Unique number of Order
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
11) Seller Products:
Table Name: SellerProducts
Description: This table stores information of products that are selected by the user (seller).
Reqid Int - Primary Key Unique number of Request
Productname Nvarchar 50 Not null Name of Product
Productcategory Int - Null Category of product
Productquantity Int - Null Quantity of product
Productprice Numeric 8,2 Null Price of product
Productchars Nvarchar 150 Null Characteristic of Product
Userid Nchar 10 Foreign Key Unique number of user
Reqdatetime Datetime - Null Date & Time of Buying Products
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
SPid Nvarchar 10 Primary Key Unique number of Seller Product
SPName Nvarchar 30 Not null Name of Seller Product
SPDesc Nvarchar 100 Not null Description of the Seller Product
SPImage Image - Not null Image of the Seller Product
SPImageName Nvarchar 200 Not null Name of the Image
SPPrice Numeric 6,0 Not null Price of the Seller Product
SPCategoryID Int - Not null Unique number of Category ID
SPQnty Int - Not null Quantity of the Seller Product
SPflag Bit - Not null Flag for show Product
SPLoaded Datetime - Null Date & Time of loaded Product
SPDuration Int - Null Duration of Selling Product
Userid Nvarchar 50 Foreign Key Unique number of User ID
Screen Shots Admin-Side:- ActorMaster.aspx.cs
BuyerPutRequired Master.aspx.cs
CategoryMaster.aspx.cs
OrderedMaster.aspx.cs
PaymentMaster.aspx.cs
ProductMaster.aspx.cs
SellerProductMaster.aspx.cs
SubCategory.aspx.cs
Login.aspx.cs
ChangePassword.aspx.cs
ForgotPassword.aspx.cs:-
Admin Welcome.aspx.cs:-
UserSide:-
RegisteredUser.aspx.cs
Feedback Master.aspx.cs
Login.aspx.cs:-
ForgotPassword.aspx.cs:-
Test Case Form Name StepDetails
Login
Login Form
1.UserName:
2.Password:
Expected Result:
1. If UserNAme and Password Is Incorrect than the User can’t 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 StepDetails
Actor Master
Actor Master Form
1.Actor Name
Test Cases Of Admin Side
Karan
Login
Hardik
Expected Result: If a enter
Test Case Form Name StepDetails
Sub Category
Master
Sub Category Master Form
1.Sub Category Name
2.Category Name
Expected Result:
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 StepDetails
Change Password
ChangePasswordForm
1. If Current Password
Is Incorrect
2. New Password and
Confirm Password is
Incorrect
3. If all Fields are Correct
Telivison
Electronics
Test Case Form Name StepDetails
Register User
Register User Master
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 StepDetails
Forgot Password
ForgotPasswordForm
1. On entering
UserName and
Clicking on
Forgorpassword
Link.
2. Password Shown if
Emailid and
Username is
Correct.
Expected Results:
Test Cases OfUser Side
1. On entering Username and Clicking on Forgot Password Link the User can
get his/her Password.
2. If UserName or Password is not Correct than a Message is Thrown.
7. Coding
Admin-Side:-
ActorMaster.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class Admin_ActorMaster : System.Web.UI.Page { public static SqlConnection con; public static int id; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); BindControl(); } } public void BindControl() { SqlCommand cmd = new SqlCommand("ReadActor", con); cmd.CommandType = CommandType.StoredProcedure; OpenConnection(); SqlDataReader dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); dr.Close(); cmd.Dispose(); CloseConnection(); } public void OpenConnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtaname.Text = ""; txtaname.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { if (btnsubmit.Text == "Submit") { SqlCommand cmd = new SqlCommand("InsertActorMaster", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@ActorName", SqlDbType.VarChar);
parm.Value = txtaname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); BindControl(); ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("updateActor", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@ActorNo", SqlDbType.VarChar); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ActorNm", SqlDbType.VarChar); parm.Value = txtaname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Updated"); BindControl(); ClearData(); cmd.Dispose(); CloseConnection(); btnsubmit.Text = "Submit"; } } protected void 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["aid"] = id; SqlCommand cmd = new SqlCommand("selectActor", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@ActorNo", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read())
{ txtaname.Text = dr["ActorName"].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 = new SqlCommand("DeleteActor", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@ActorNo", 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(); } } protected void 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(); } } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } } StoredProcedure:- ALTER PROCEDURE InsertActorMaster /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @ActorName varchar(10) AS /* SET NOCOUNT ON */ Insert Into ActorMaster(ActorName) values (@ActorName) RETURN
BuyerPutRequired Master.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class Admin_BuyerPutRequired_Master : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); //Label1.Text = Session["unm"].ToString(); Label1.Text = "Karan"; BindControl(); Bindcontrol1(); } } public void BindControl() { SqlCommand cmd = new SqlCommand("ReadBuyerPutReq", con); cmd.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); dr.Close(); cmd.Dispose(); CloseConnection(); } public void Bindcontrol1() { SqlCommand cmd1 = new SqlCommand("ReadProduct", con); cmd1.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd1.ExecuteReader(); ddlistpcatid.DataSource = dr; ddlistpcatid.DataTextField = "PName"; ddlistpcatid.DataValueField = "PId"; ddlistpcatid.DataBind(); dr.Close(); cmd1.Dispose(); CloseConnection(); }
public void openconnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtpname.Text = ""; txtpname.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { try { if (btnsubmit.Text == "Submit") { SqlCommand cmd = new SqlCommand("InsertBuyerPutReq", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@ProductName", SqlDbType.NVarChar); parm.Value = txtpname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductCategory", SqlDbType.NVarChar); parm.Value = ddlistpcatid.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductQuentity", SqlDbType.NVarChar); parm.Value = txtpqnty.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductPrice", SqlDbType.NVarChar); parm.Value = txtpprice.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductChars", SqlDbType.NVarChar); parm.Value = txtpchars.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Userid", SqlDbType.NVarChar); parm.Value = Label1.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ReqDateTime", SqlDbType.NVarChar); parm.Value = txtrdt.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); BindControl();
ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("UpdateBuyerPutReq", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@ReqId", SqlDbType.Int); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductName", SqlDbType.VarChar); parm.Value = txtpname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductCategory", SqlDbType.VarChar); parm.Value = ddlistpcatid.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductQuentity", SqlDbType.VarChar); parm.Value = txtpqnty.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductPrice", SqlDbType.VarChar); parm.Value = txtpprice.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductChars", SqlDbType.VarChar); parm.Value = txtpchars.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Userid", SqlDbType.VarChar); parm.Value = Label1.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ReqDateTime", SqlDbType.VarChar); parm.Value = txtrdt.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); } } catch (Exception ex) { LeeGunn.Web.UI.MessageBox.MessageBox.Show(ex.Message.ToString()); } } protected void GridView1_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(); } } } protected void GridView1_RowCommand1(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["aid"] = id; SqlCommand cmd = new SqlCommand("SelectBuyerPutReq", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@ReqId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { txtpname.Text = dr["ProductName"].ToString(); ddlistpcatid.Text = dr["ProductCategory"].ToString(); txtpqnty.Text = dr["ProductQuentity"].ToString(); txtpprice.Text = dr["ProductPrice"].ToString(); txtpchars.Text = dr["Productchars"].ToString(); txtrdt.Text = dr["ReqDateTime"].ToString(); Label1.Text = dr["UserId"].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 = new SqlCommand("DeleteBuyerPutReq", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@ReqId", 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(); } } } Store Procedure:- ALTER PROCEDURE InsertBuyerPutReq /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @ProductName nvarchar(50), @ProductCategory int, @ProductQuentity int, @ProductPrice int, @ProductChars nvarchar(200), @Userid nchar(10), @ReqDateTime date AS /* SET NOCOUNT ON */ Insert into BuyerPutReq(ProductName,ProductCategory,ProductQuentity,ProductPrice,ProductChars,Userid,ReqDateTime) values (@ProductName,@ProductCategory,@ProductQuentity,@ProductPrice,@ProductChars,@Userid,@ReqDateTime) RETURN ALTER PROCEDURE DeleteBuyerPutReq /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @ReqId int=0 AS /* SET NOCOUNT ON */ delete from BuyerPutReq where ReqId=@ReqId RETURN ALTER PROCEDURE ReadBuyerPutReq /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ AS /* SET NOCOUNT ON */ select * from BuyerPutReq RETURN ALTER PROCEDURE SelectBuyerPutReq /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT )
*/ @ReqId int=0 AS /* SET NOCOUNT ON */ select * from BuyerPutReq where ReqId=@ReqId RETURN ALTER PROCEDURE UpdateBuyerPutReq /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @ReqId int=0, @ProductName nvarchar(50), @ProductCategory int, @ProductQuentity int, @ProductPrice int, @ProductChars nvarchar(200), @Userid nchar(10), @ReqDateTime date AS /* SET NOCOUNT ON */ update BuyerPutReq set ProductName=@ProductName,ProductCategory=@ProductCategory,ProductQuentity=@ProductQuentity,ProductPrice=@ProductPrice,ProductChars=@ProductChars,Userid=@Userid,ReqDateTime=@ReqDateTime where ReqId=@ReqId RETURN CategoryMaster.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class Admin_CategoryMaster1 : System.Web.UI.Page { public static SqlConnection con; public static int id; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); BindControl(); } } public void BindControl() { SqlCommand cmd = new SqlCommand("ReadCategory", con); cmd.CommandType = CommandType.StoredProcedure; OpenConnection(); SqlDataReader dr = cmd.ExecuteReader();
GridView1.DataSource = dr; GridView1.DataBind(); dr.Close(); cmd.Dispose(); CloseConnection(); } public void OpenConnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtcname.Text = ""; txtcname.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { if (btnsubmit.Text == "Submit") { SqlCommand cmd = new SqlCommand("InsertCategoryMaster", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@CatName", SqlDbType.VarChar); parm.Value = txtcname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); BindControl(); ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("UpdateCategory", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@CatId", SqlDbType.VarChar); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@CatName", SqlDbType.VarChar); parm.Value = txtcname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection();
cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Updated"); BindControl(); ClearData(); cmd.Dispose(); CloseConnection(); btnsubmit.Text = "Submit"; } } protected void 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["aid"] = id; SqlCommand cmd = new SqlCommand("SelectCategory", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@CatId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { txtcname.Text = dr["CatName"].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 = new SqlCommand("DeleteCategory", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@CatId", 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();
} } protected void 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(); } } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } }
Store Procedure:-
ALTER PROCEDURE InsertCategoryMaster /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @CatName varchar(max) AS /* SET NOCOUNT ON */ Insert Into Category(CatName) values (@CatName) RETURN ALTER PROCEDURE DeleteCategory /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @CatId int=0 AS /* SET NOCOUNT ON */ delete from Category where CatId=@CatId RETURN ALTER PROCEDURE ReadCategory /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ AS /* SET NOCOUNT ON */ Select * from Category RETURN ALTER PROCEDURE SelectCategory /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT )
*/ @CatId int=0 AS /* SET NOCOUNT ON */ Select * from Category where CatId=@CatId RETURN ALTER PROCEDURE UpdateCategory /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @CatId int=0, @CatName varchar(50) AS /* SET NOCOUNT ON */ Update Category set CatName=@CatName where CatId=@CatId RETURN OrderedMaster.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class Admin_OrderedMaster : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e) { { if (!IsPostBack) con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); BindControl(); BindControl1(); } } public void BindControl() { SqlCommand cmd = new SqlCommand("ReadOrdered", con); cmd.CommandType = CommandType.StoredProcedure; OpenConnection(); SqlDataReader dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); dr.Close(); cmd.Dispose(); CloseConnection(); }
public void BindControl1() { SqlCommand cmd1 = new SqlCommand("ReadProduct", con); cmd1.CommandType = CommandType.StoredProcedure; OpenConnection(); SqlDataReader dr = cmd1.ExecuteReader(); ddlistpid.DataSource = dr; ddlistpid.DataTextField = "PName"; ddlistpid.DataValueField = "PId"; ddlistpid.DataBind(); dr.Close(); cmd1.Dispose(); CloseConnection(); } public void OpenConnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { ddlistpid.SelectedValue = ""; ddlistpid.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { if (btnsubmit.Text == "Submit") { SqlCommand cmd = new SqlCommand("InsertOrdered", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@Pid", SqlDbType.Int); parm.Value = ddlistpid.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PQuentity", con); parm.Value = txtpqnty.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PPrice", con); parm.Value = txtpprice.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@POrder", con); parm.Value = txtporder.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); cmd.ExecuteNonQuery();
LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); BindControl(); ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("UpdateOrdered", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@Orderid", SqlDbType.VarChar); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Pid", SqlDbType.VarChar); parm.Value = ddlistpid.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PQuentity", SqlDbType.VarChar); parm.Value = txtpqnty.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PPrice", SqlDbType.VarChar); parm.Value = txtpprice.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@POrder", SqlDbType.VarChar); parm.Value = txtporder.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Updated"); BindControl(); ClearData(); cmd.Dispose(); CloseConnection(); btnsubmit.Text = "Submit"; } } protected void 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(); } }
protected void GridView1_RowCommand1(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["aid"] = id; SqlCommand cmd = new SqlCommand("SelectOrdered", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@Orderid", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { ddlistpid.SelectedValue = dr["Productid"].ToString(); txtpqnty.Text = dr["ProductQuentity"].ToString(); txtpprice.Text = dr["ProductPrice"].ToString(); txtporder.Text = dr["ProductOrder"].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 = new SqlCommand("deleteOrdered", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@Orderid", 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(); } } protected void GridView1_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(); } } }
Store Procedure:-
ALTER PROCEDURE InsertOrdered /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @Pid nvarchar(10), @PQuentity int, @PPrice varchar(20), @POrder nvarchar(50) AS /* SET NOCOUNT ON */ insert into Ordered (Pid,PQuentity,PPrice,POrder) values (@Pid,@PQuentity,@PPrice,@POrder) RETURN ALTER PROCEDURE DeleteOrdered /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @Orderid int=0 AS /* SET NOCOUNT ON */ delete from Ordered where Orderid=@Orderid RETURN ALTER PROCEDURE ReadOrdered /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ AS /* SET NOCOUNT ON */ select * from Ordered RETURN ALTER PROCEDURE SelectOrdered /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @Orderid int =0 AS /* SET NOCOUNT ON */ Select * from Ordered where Orderid=@Orderid RETURN ALTER PROCEDURE UpdateOrdered /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT )
*/ @Orderid int=0, @Pid nvarchar(10), @PQuentity int, @PPrice varchar(20), @POrder nvarchar(50) AS /* SET NOCOUNT ON */ Update Ordered set Pid=@Pid,PQuentity=@PQuentity,PPrice=@PPrice,POrder=@POrder where Orderid=Orderid RETURN
PaymentMaster.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class Admin_PaymentMaster : System.Web.UI.Page { public static SqlConnection con; public static int id; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); //Label1.Text = Session["unm"].ToString(); Label1.Text = "Karan"; BindControl(); } } public void BindControl() { SqlCommand cmd = new SqlCommand("ReadPayment", con); cmd.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); dr.Close(); cmd.Dispose(); CloseConnection(); } public void openconnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open();
} public void CloseConnection() { con.Close(); } public void ClearData() { txtpcno.Text = ""; txtpcno.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { try { if (btnsubmit.Text == "Submit") { SqlCommand cmd = new SqlCommand("InsertPayment", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@PinNo", SqlDbType.NVarChar); parm.Value = txtpcno.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@BankName", SqlDbType.NVarChar); parm.Value = txtbanknm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@OwnerName", SqlDbType.NVarChar); parm.Value = txtownnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@DeliveryAddress", SqlDbType.NVarChar); parm.Value = txtdeladd.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@UserId", SqlDbType.NChar); parm.Value = Label1.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Ordered", SqlDbType.Int); parm.Value = txtorder.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); BindControl(); ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("UpdatePayment", con);
cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@CreditCardNo", SqlDbType.Int); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PinNo", SqlDbType.NVarChar); parm.Value = txtpcno.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@BankName", SqlDbType.NVarChar); parm.Value = txtbanknm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@OwnerName", SqlDbType.NVarChar); parm.Value = txtownnm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@DeliveryAddress", SqlDbType.NVarChar); parm.Value = txtdeladd.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@UserId", SqlDbType.NChar); parm.Value = Label1.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Ordered", SqlDbType.Int); parm.Value = txtorder.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); cmd.Parameters.Add(parm); } } catch (Exception ex) { LeeGunn.Web.UI.MessageBox.MessageBox.Show(ex.Message.ToString()); } } protected void 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["aid"] = id; SqlCommand cmd = new SqlCommand("SelectPayment", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@CreditCardNo", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);
openconnection(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { txtpcno.Text = dr["PinNo"].ToString(); txtbanknm.Text = dr["BankName"].ToString(); txtownnm.Text = dr["OwnerName"].ToString(); txtdeladd.Text = dr["DeliveryAddress"].ToString(); Label1.Text = dr["UserId"].ToString(); txtorder.Text = dr["Ordered"].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 = new SqlCommand("deletePayment", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@CreditCardNo", 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(); } } protected void 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(); } } } }
Store Procedure:-
ALTER PROCEDURE InsertPayment /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @PinNo nvarchar(50), @BankName nvarchar(50), @OwnerName nvarchar(50), @DeliveryAddress nvarchar(250), @UserId nchar(10), @Ordered int AS /* SET NOCOUNT ON */ Insert into Payment (PinNo,BankName,OwnerName,DeliveryAddress,UserId,Ordered) values (@PinNo,@BankName,@OwnerName,@DeliveryAddress,@UserId,@Ordered) RETURN ALTER PROCEDURE deletePayment /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @CreditCardNo int=0 AS /* SET NOCOUNT ON */ delete from Payment where CreditCardNo=@CreditCardNo RETURN ALTER PROCEDURE ReadPayment /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ AS /* SET NOCOUNT ON */ Select * from Payment RETURN ALTER PROCEDURE SelectPayment /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @CreditCardNo int=0 AS /* SET NOCOUNT ON */ Select * from Payment where CreditCardNo=@CreditCardNo RETURN ALTER PROCEDURE UpdatePayment /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @CreditCardNo int=0, @PinNo nvarchar(50),
@BankName nvarchar(50), @OwnerName nvarchar(50), @DeliveryAddress nvarchar(250), @UserId nchar(10), @Ordered int AS /* SET NOCOUNT ON */ Update Payment set PinNo=@PinNo,BankName=@BankName,OwnerName=@OwnerName,DeliveryAddress=@DeliveryAddress,UserId=@UserId,Ordered=@Ordered where CreditCardNo=@CreditCardNo RETURN
ProductMaster.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; using System.IO; public partial class Admin_ProductMaster : System.Web.UI.Page { public static SqlConnection con; public static int id; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); BindControl(); BindControl1(); } } public void BindControl() { SqlCommand cmd = new SqlCommand("ReadProduct", con); cmd.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd.ExecuteReader();
GridView1.DataSource = dr; GridView1.DataBind(); dr.Close(); cmd.Dispose(); CloseConnection(); } public void BindControl1() { SqlCommand cmd1 = new SqlCommand("ReadCategory", con); cmd1.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd1.ExecuteReader(); ddlistPcatid.DataSource = dr; ddlistPcatid.DataTextField = "CatName"; ddlistPcatid.DataValueField = "CatId"; ddlistPcatid.DataBind(); dr.Close(); cmd1.Dispose(); CloseConnection(); } public void openconnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtPName.Text=""; txtPName.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { try { if (btnsubmit.Text == "Submit") { string str1 = Path.GetFileName(FileUpload1.FileName); FileUpload1.SaveAs(Server.MapPath("~/Images/" + str1.ToString())); Image1.ImageUrl = "~/Images/" + str1.ToString(); SqlCommand cmd = new SqlCommand("InsertProductMaster", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@PName", SqlDbType.NVarChar); parm.Value = txtPName.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Pdesc", SqlDbType.NVarChar); parm.Value = txtPDesc.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PImage", SqlDbType.NVarChar); parm.Value = str1.ToString();
parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PImageName", SqlDbType.NVarChar); parm.Value = txtPIname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PPrice", SqlDbType.Int); parm.Value = txtPPrice.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PCategoryId", SqlDbType.Int); parm.Value = ddlistPcatid.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PQnty", SqlDbType.Int); parm.Value = textPQnty.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PFlag", SqlDbType.VarChar); parm.Value = txtPFlag.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PLoaded", SqlDbType.Date); parm.Value = txtPLoaded.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); BindControl(); ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("UpdateProduct", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@ProductId", SqlDbType.Int); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductName", SqlDbType.VarChar); parm.Value = txtPName.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductDesc", SqlDbType.VarChar); parm.Value = txtPDesc.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); string str1 = Path.GetFileName(FileUpload1.FileName); FileUpload1.SaveAs(Server.MapPath("~/Images/" + str1.ToString())); Image1.ImageUrl = "~/Images/" + str1.ToString(); parm = new SqlParameter("@ProductImageName", SqlDbType.VarChar);
parm.Value = txtPIname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductPrice", SqlDbType.VarChar); parm.Value = txtPPrice.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductCategoryId", SqlDbType.VarChar); parm.Value = ddlistPcatid.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductQnty", SqlDbType.VarChar); parm.Value = textPQnty.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductFlag", SqlDbType.VarChar); parm.Value = txtPFlag.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ProductLoaded", SqlDbType.VarChar); parm.Value = txtPLoaded.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); } } catch (Exception ex) { LeeGunn.Web.UI.MessageBox.MessageBox.Show(ex.Message.ToString()); } } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } protected void GridView1_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(); } } } protected void GridView1_RowCommand1(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["aid"] = id;
SqlCommand cmd = new SqlCommand("SelectProduct", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@PId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { txtPName.Text = dr["PName"].ToString(); txtPDesc.Text = dr["PDesc"].ToString(); txtPIname.Text = dr["PImageName"].ToString(); txtPPrice.Text = dr["PPrice"].ToString(); ddlistPcatid.Text = dr["PCategoryId"].ToString(); textPQnty.Text = dr["PQnty"].ToString(); txtPFlag.Text = dr["Pflag"].ToString(); txtPLoaded.Text = dr["PLoaded"].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 = new SqlCommand("DeleteProduct", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@PId",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(); } } }
Store Procedure:-
ALTER PROCEDURE InsertProductMaster /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT )
*/ @PName nvarchar(30), @Pdesc nvarchar(100), @PImage nvarchar(100), @PImageName nvarchar(200), @PPrice int, @PCategoryId int, @PQnty int, @PFlag varchar, @PLoaded date AS /* SET NOCOUNT ON */ Insert Into Product(PName,Pdesc,PImage,PImageName,PPrice,PCategoryId,PQnty,PFlag,PLoaded) values (@PName,@Pdesc,@PImage,@PImageName,@PPrice,@PCategoryId,@Pqnty,@PFlag,@PLoaded) RETURN ALTER PROCEDURE DeleteProduct /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @PId int=0 AS /* SET NOCOUNT ON */ delete from Product Where PId=@PId RETURN ALTER PROCEDURE ReadProduct /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ AS /* SET NOCOUNT ON */ select * from Product RETURN ALTER PROCEDURE SelectProduct /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @PId int=0 AS /* SET NOCOUNT ON */ Select * From Product where PId=@PId RETURN ALTER PROCEDURE UpdateProduct /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @PId nvarchar (10), @PName nvarchar (30), @PDesc nvarchar (100), @PImage varchar, @PImageName nvarchar (100), @PPrice numeric (6,0), @PCategoryId int, @PQnty int,
@PFlag varchar, @PLoaded datetime AS /* SET NOCOUNT ON */ Update Product set PName=@PName,PDesc=@PDesc,PImage=@PImage,PImageName=@PImageName,PPrice=@PPrice,PCategoryId=@PCategoryId,PQnty=@PQnty,PFlag=@PFLag,PLoaded=@PLoaded where PId=@PId RETURN SellerProductMaster.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; using System.IO; public partial class Admin_SellerProductMaster : System.Web.UI.Page { public static SqlConnection con; public static int id; public static string str1; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); //Label1.Text = Session["unm"].ToString(); Label1.Text = "Karan"; BindControl(); BindControl1(); } } public void BindControl() { SqlCommand cmd = new SqlCommand("ReadSellerProduct", con); cmd.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd.ExecuteReader(); GridView1.DataSource = dr; GridView1.DataBind(); dr.Close(); cmd.Dispose(); CloseConnection(); } public void BindControl1() { SqlCommand cmd1 = new SqlCommand("ReadCategory", con); cmd1.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd1.ExecuteReader(); ddlistspcatid.DataSource = dr; ddlistspcatid.DataTextField = "CatName"; ddlistspcatid.DataValueField = "CatId"; ddlistspcatid.DataBind(); dr.Close();
cmd1.Dispose(); CloseConnection(); } public void openconnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtSPName.Text = ""; txtSPName.Focus(); } protected void btnsubmit_click(object sender, EventArgs e) { if (btnSubmit.Text == "Submit") { string str1 = Path.GetFileName(FileUpload1.FileName); FileUpload1.SaveAs(Server.MapPath("~/Images/" + str1.ToString())); Image1.ImageUrl = "~/Images/" + str1.ToString(); SqlCommand cmd = new SqlCommand("InsertSellerProductMaster", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@SPName", SqlDbType.NVarChar); parm.Value = txtSPName.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPDesc", SqlDbType.NVarChar); parm.Value = txtSPDesc.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPImage", SqlDbType.VarChar); parm.Value = str1.ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPImageName", SqlDbType.NVarChar); parm.Value = txtSPIName.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPPrice", SqlDbType.VarChar); parm.Value = txtSPPrice.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPCategoryId", SqlDbType.Int); parm.Value = ddlistspcatid.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPQnty", SqlDbType.Int); parm.Value = txtSPQnty.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPFlag", SqlDbType.VarChar); parm.Value = txtSPFlag.Text;
parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPLoaded", SqlDbType.Date); parm.Value = txtSPLoaded.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); parm = new SqlParameter("@SPDuration", SqlDbType.Int); parm.Value = txtSPDuration.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@UserId", SqlDbType.NVarChar); parm.Value = Label1.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); BindControl(); ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("UpdateSellerProduct", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@SellerProductid", SqlDbType.VarChar); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPName", SqlDbType.NVarChar); parm.Value = txtSPName.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPDesc", SqlDbType.NVarChar); parm.Value = txtSPDesc.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); string str1 = Path.GetFileName(FileUpload1.FileName); FileUpload1.SaveAs(Server.MapPath("~/Images/" + str1.ToString())); Image1.ImageUrl = "~/Images/" + str1.ToString(); parm = new SqlParameter("@SPImageName", SqlDbType.NVarChar); parm.Value = txtSPIName.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPPrice", SqlDbType.VarChar); parm.Value = txtSPPrice.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPCategoryId", SqlDbType.Int); parm.Value = ddlistspcatid.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPQnty", SqlDbType.Int);
parm.Value = txtSPQnty.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPFlag", SqlDbType.VarChar); parm.Value = txtSPFlag.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SPLoaded", SqlDbType.Date); parm.Value = txtSPLoaded.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); parm = new SqlParameter("@SPDuration", SqlDbType.Int); parm.Value = txtSPDuration.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@UserId", SqlDbType.NVarChar); parm.Value = Label1.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); } } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } protected void GridView1_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(); } } } protected void GridView1_RowCommand1(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["aid"] = id; SqlCommand cmd = new SqlCommand("SelectSellerProduct", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@SPId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection();
SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { txtSPName.Text = dr["SPName"].ToString(); txtSPDesc.Text = dr["SPDesc"].ToString(); txtSPIName.Text = dr["SPImage"].ToString(); txtSPIName.Text = dr["SPImageName"].ToString(); txtSPPrice.Text = dr["SPPrice"].ToString(); ddlistspcatid.Text = dr["SPCategoryId"].ToString(); txtSPQnty.Text = dr["SPQnty"].ToString(); txtSPFlag.Text = dr["SPFlag"].ToString(); txtSPLoaded.Text = dr["SPLoaded"].ToString(); txtSPDuration.Text = dr["SPDuration"].ToString(); Label1.Text = dr["Userid"].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 = new SqlCommand("DeleteSellerProduct", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@SPId", SqlDbType.VarChar); 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(); } } } Store Procedure:- ALTER PROCEDURE InsertSellerProductMaster /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @SPName Nvarchar (30), @SPDesc Nvarchar(100), @SPImage nvarchar(100), @SPImageName Nvarchar(200), @SPPrice varchar(50), @SPCategoryId varchar(50), @SPQnty varchar(50), @SPFlag Varchar(50),
@SPLoaded date, @SPDuration varchar(50), @UserId Nvarchar(50) AS /* SET NOCOUNT ON */ Insert into SellerProductMaster(SPName,SPDesc,SPImage,SPImageName,SPPrice,SPCategoryId,SPQnty,SPFlag,SPLoaded,SPDuration,UserId) values (@SPName,@SPDesc,@SPImage,@SPImageName,@SPPrice,@SPCategoryId,@SPQnty,@SPFlag,@SPLoaded,@SPDuration,@UserId) RETURN ALTER PROCEDURE DeleteSellerProduct /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @SPId int=0 AS /* SET NOCOUNT ON */ Delete from SellerProductMaster where SPId=@SPId RETURN ALTER PROCEDURE ReadSellerProduct /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ AS /* SET NOCOUNT ON */ select * from SellerProductMaster RETURN ALTER PROCEDURE SelectSellerProduct /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @SPId int=0 AS /* SET NOCOUNT ON */ select * from SellerProductMaster where SPId=@SPId RETURN ALTER PROCEDURE UpdateSellerProduct /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @SPId nvarchar(10), @SPName nvarchar (30), @SPDesc nvarchar (100), @SPImage varchar, @SPImageName nvarchar (100), @SPPrice numeric (6,0), @SPCategoryId int, @SPQnty int, @SPFlag varchar, @SPLoaded datetime, @SPDuration varchar(50),
@UserId varchar(50) AS /* SET NOCOUNT ON */ Update SellerProductMaster set SPName=@SPName,SPDesc=@SPDesc,SPImage=@SPImage,SPImageName=@SPImageName,SPPrice=@SPPrice,SPCategoryId=@SPCategoryId,SPQnty=@SPQnty,SPFlag=@SPFlag,SPLoaded=@SPLoaded,SPDuration=@SPDuration,UserId=@UserId where SPId=@SPId RETURN
SubCategory.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; using System.IO; public partial class Admin_SubCategory : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); BindControl(); BindControl1(); } } public void BindControl() { SqlCommand cmd = new SqlCommand("ReadSubCategory", con); cmd.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd.ExecuteReader(); SubCategory.DataSource = dr; SubCategory.DataBind(); dr.Close(); cmd.Dispose(); CloseConnection(); } public void BindControl1() { SqlCommand cmd1 = new SqlCommand("ReadCategory", con); cmd1.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd1.ExecuteReader(); ddlistcatid.DataSource = dr; ddlistcatid.DataTextField = "CatName";
ddlistcatid.DataValueField = "CatId"; ddlistcatid.DataBind(); dr.Close(); cmd1.Dispose(); CloseConnection(); } public void openconnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtSCatName.Text = ""; txtSCatName.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { if (btnsubmit.Text == "SUBMIT") { SqlCommand cmd = new SqlCommand("InsertSubCategory", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@SubCategoryName", SqlDbType.NVarChar); parm.Value = txtSCatName.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@CategoryId", SqlDbType.NVarChar); parm.Value = ddlistcatid.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); BindControl(); BindControl1(); ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("UpdateSubCategory", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@SubCategoryId", SqlDbType.Int); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@SubCategoryName", SqlDbType.VarChar); parm.Value = txtSCatName.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);
parm = new SqlParameter("@CategoryId", SqlDbType.VarChar); parm.Value = ddlistcatid.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); } } protected void SubCategory_SelectedIndexChanged(object sender, EventArgs e) { } protected void SubCategory_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(); } } } protected void SubCategory_RowCommand(object sender, GridViewCommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); GridViewRow raw = SubCategory.Rows[index]; if (e.CommandName == "EditButton") { int id; id = Convert.ToInt32(raw.Cells[2].Text); ViewState["aid"] = id; SqlCommand cmd = new SqlCommand("SelectSubCategory", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@SubCategoryId", SqlDbType.Int); parm.Value = id; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { txtSCatName.Text = dr["SubCategoryName"].ToString(); ddlistcatid.Text = 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["cid"] = id; SqlCommand cmd = new SqlCommand("DeleteSubCategory", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@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(); } } }
Store Procedure:-
ALTER PROCEDURE InsertSubCategory /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @SubCategoryName varchar(50), @CategoryId varchar(50) AS /* SET NOCOUNT ON */ Insert into SubCategoryMaster values (@SubCategoryName,@CategoryId) RETURN ALTER PROCEDURE DeleteSubCategory /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @SubCategoryId int=0 AS /* SET NOCOUNT ON */ delete from SubCategoryMaster where SubCategoryId=@SubCategoryId RETURN ALTER PROCEDURE ReadSubCategory /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ AS /* SET NOCOUNT ON */ select * from SubCategoryMaster RETURN ALTER PROCEDURE SelectSubCategory /* ( @parameter1 int = 5,
@parameter2 datatype OUTPUT ) */ @SubCategoryId int=0 AS /* SET NOCOUNT ON */ select * from SubCategoryMaster where SubCategoryId=@SubCategoryId RETURN ALTER PROCEDURE UpdateSubCategory /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @SubCategoryId int=0, @SubCategoryName varchar(50), @CategoryId varchar(50) AS /* SET NOCOUNT ON */ Update SubCategoryMaster set SubCategoryName=@SubCategoryName,CategoryId=@CategoryId where SubCategoryId=@SubCategoryId RETURN Login.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class Admin_Login : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); OpenConnection(); CloseConnection(); } public void OpenConnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } protected void btnlogin_Click(object sender, EventArgs e) { string strg = "select * from AdminLogin where UserName='" + txtuname.Text + "' and Password ='" + txtpasswd.Text + "'";
SqlCommand cmd = new SqlCommand(strg, con); OpenConnection(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() == true) { Session["Unm"] = txtuname.Text; Response.Redirect("Welcome.aspx"); } else { LeeGunn.Web.UI.MessageBox.MessageBox.Show("Username or password wrong"); } dr.Close(); cmd.Dispose(); CloseConnection(); { } } } ChangePassword.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class Admin_ChangePassword : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); } } public void OpenConnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData()
{ txtuname.Text = ""; txtuname.Focus(); } protected void btnpasswd_Click(object sender, EventArgs e) { try { if (btnpasswd.Text == "Submit") { SqlCommand cmd = new SqlCommand("UpdateChangePassword", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@Username", SqlDbType.VarChar); parm.Value = txtuname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Password", SqlDbType.VarChar); parm.Value = txtpasswd.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ChangePassword", SqlDbType.VarChar); parm.Value = txtnewpasswd.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Password Successfully Change"); ClearData(); CloseConnection(); } else { LeeGunn.Web.UI.MessageBox.MessageBox.Show("Password Dose Not Match"); } } catch (Exception ex) { } } } Store Procedure:-
ALTER PROCEDURE UpdateChangePassword /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @UserName varchar(50), @Password varchar(50), @ChangePassword varchar(50) AS /* SET NOCOUNT ON */ update AdminLogin set Password=@ChangePassword where UserName=@UserName and Password=@Password RETURN ForgotPassword.aspx.cs:-
using System;
using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class Admin_ForgotPassword : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); } public void OpenConnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtuname.Text = ""; txtuname.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { try { SqlCommand cmd = new SqlCommand("ReadForgotPassword", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("Username", SqlDbType.VarChar); parm.Value = txtuname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("Email", SqlDbType.VarChar); parm.Value = txtremail.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { lnkpasswd.Text = dr["Password"].ToString(); } } else { lnkpasswd.Text = "Username / Email Wrong";
} dr.Close(); ClearData(); CloseConnection(); } catch (Exception ex) { LeeGunn.Web.UI.MessageBox.MessageBox.Show(ex.Message.ToString()); } } } Store Procedure:-
ALTER PROCEDURE ReadForgotPassword /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @UserName varchar(50), @Email varchar(50) AS /* SET NOCOUNT ON */ Select * From AdminLogin where UserName=@userName and Email=@Email RETURN
Admin Welcome.aspx.cs:-
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Admin_Welcome : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { LinkButton1.Text = Session["Unm"].ToString(); } protected void LinkButton1_Click(object sender, EventArgs e) { Response.Redirect("AdminLoginMaster.aspx"); } }
UserSide:-
RegisteredUser.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;
using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class User_RegisteredUser : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); Bindcontrol(); Bindcontrol1(); } } public void Bindcontrol() { SqlCommand cmd = new SqlCommand("ReadRegisteredUser", con); cmd.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd.ExecuteReader(); dr.Close(); cmd.Dispose(); CloseConnection(); } public void Bindcontrol1() { SqlCommand cmd1 = new SqlCommand("ReadActor", con); cmd1.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd1.ExecuteReader(); ddlactor.DataSource = dr; ddlactor.DataTextField = "ActorName"; ddlactor.DataValueField = "ActorNo"; ddlactor.DataBind(); dr.Close(); cmd1.Dispose(); CloseConnection(); } public void openconnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtuname.Text = ""; txtuname.Focus();
} protected void btnsubmit_Click(object sender, EventArgs e) { if (btnsubmit.Text == "Submit") { SqlCommand cmd = new SqlCommand("InsertRegisteredUser", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@UserName", SqlDbType.NVarChar); parm.Value = txtuname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Password", SqlDbType.NVarChar); parm.Value = txtpasswd.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Actor", SqlDbType.NVarChar); parm.Value = ddlactor.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@FName", SqlDbType.NVarChar); parm.Value = txtfname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@MName", SqlDbType.NVarChar); parm.Value = txtmname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@LName", SqlDbType.NVarChar); parm.Value = txtlname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Gender", SqlDbType.NVarChar); parm.Value = rblgender.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Address", SqlDbType.NVarChar); parm.Value = txtaddress.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@City", SqlDbType.NVarChar); parm.Value = ddlcity.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@State", SqlDbType.NVarChar); parm.Value = ddlstate.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PhoneM", SqlDbType.NVarChar); parm.Value = txtpm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm);
parm = new SqlParameter("@PhoneR", SqlDbType.NVarChar); parm.Value = txtpr.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Question", SqlDbType.NVarChar); parm.Value = ddlquestion.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Answer", SqlDbType.NVarChar); parm.Value = txtanswer.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Email", SqlDbType.NVarChar); parm.Value = txtemail.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@LoginDate", SqlDbType.NVarChar); parm.Value = txtld.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); Bindcontrol(); ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("UpdateRegisteredUser", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@UserId", SqlDbType.Int); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@UserName", SqlDbType.NVarChar); parm.Value = txtuname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Password", SqlDbType.NVarChar); parm.Value = txtpasswd.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ActorName", SqlDbType.NVarChar); parm.Value = ddlactor.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@FName", SqlDbType.NVarChar); parm.Value = txtfname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@MName", SqlDbType.NVarChar);
parm.Value = txtmname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@LName", SqlDbType.NVarChar); parm.Value = txtlname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Gender", SqlDbType.NVarChar); parm.Value = rblgender.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Address", SqlDbType.NVarChar); parm.Value = txtaddress.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@City", SqlDbType.NVarChar); parm.Value = ddlcity.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@State", SqlDbType.NVarChar); parm.Value = ddlstate.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PhoneM", SqlDbType.NVarChar); parm.Value = txtpm.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@PhoneR", SqlDbType.NVarChar); parm.Value = txtpr.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Question", SqlDbType.NVarChar); parm.Value = ddlquestion.SelectedValue; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Answer", SqlDbType.NVarChar); parm.Value = txtanswer.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Email", SqlDbType.NVarChar); parm.Value = txtemail.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@LoginDate", SqlDbType.NVarChar); parm.Value = txtld.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); } } }
Store Procedure:-
ALTER PROCEDURE InsertRegisteredUser /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @UserName nvarchar(30), @Password nvarchar(15), @Actor varchar(50), @FName nvarchar(20), @MName varchar(25), @LName varchar(20), @Gender nvarchar(50), @Address varchar(30), @City nvarchar(15), @State nvarchar(20), @PhoneM varchar(15), @PhoneR varchar(20), @Question varchar(50), @Answer varchar(50), @Email nvarchar(max), @LoginDate datetime AS /* SET NOCOUNT ON */ Insert into RegisteredUser(UserName,Password,Actor,FName,MName,LName,Gender,Address,City,State,PhoneM,PhoneR,Question,Answer,Email,LoginDate) values (@UserName,@Password,@Actor,@FName,@MName,@LName,@Gender,@Address,@City,@State,@PhoneM,@PhoneR,@Question,@Answer,@Email,@LoginDate) RETURN ALTER PROCEDURE UpdateRegisteredUser /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @UserId nvarchar(20), @UserName varchar(50), @Password nvarchar(50), @Actor varchar(50), @FName nvarchar(15), @MName nvarchar(15), @LName nvarchar(15), @Gender nvarchar(50), @Address nvarchar(30), @City nvarchar(20), @State nvarchar(15), @PhoneM nvarchar(10), @PhoneR nvarchar(15), @Question nvarchar(50), @Answer nvarchar(50), @Email nvarchar(20), @LoginDate datetime AS /* SET NOCOUNT ON */ Update RegisteredUser set UserName=@UserName,Password=@Password,Actor=@Actor,FName=@FName,MName=@MName,LName=@LName,Gender=@Gender,Address=@Address,City=@City,State=@State,PhoneM=@PhoneM,PhoneR=@PhoneR,Question=@Question,Answer=@Answer,Email=@Email,LoginDate=@LoginDate Where UserId=@UserId RETURN Feedback Master.aspx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class User_Feedback_Master : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); //Label1.Text = Session["unm"].ToString(); Label1.Text = "Karan"; Bindcontrol(); } } public void Bindcontrol() { SqlCommand cmd = new SqlCommand ("ReadFeedback",con); cmd.CommandType = CommandType.StoredProcedure; openconnection(); SqlDataReader dr = cmd.ExecuteReader(); dr.Close(); cmd.Dispose(); CloseConnection(); } public void openconnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtconfeedbk.Text = ""; txtconfeedbk.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { if (btnsubmit.Text == "Submit") { SqlCommand cmd = new SqlCommand("InsertFeedback", con); cmd.CommandType = CommandType.StoredProcedure;
SqlParameter parm = new SqlParameter("@UserId", SqlDbType.NVarChar); parm.Value = Label1.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ContentFeedback", SqlDbType.NVarChar); parm.Value = txtconfeedbk.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Comments", SqlDbType.NVarChar); parm.Value = txtcommnts.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@MailId", SqlDbType.NVarChar); parm.Value = txtmailid.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); cmd.ExecuteNonQuery(); LeeGunn.Web.UI.MessageBox.MessageBox.Show("Data Submitted"); Bindcontrol(); ClearData(); cmd.Dispose(); CloseConnection(); } else { SqlCommand cmd = new SqlCommand("UpdateFeedback", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("@SrNo", SqlDbType.Int); parm.Value = ViewState["aid"].ToString(); parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@UserId", SqlDbType.NVarChar); parm.Value = Label1.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@ContentFeedback", SqlDbType.NVarChar); parm.Value = txtconfeedbk.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@Cpmments", SqlDbType.NVarChar); parm.Value = txtcommnts.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("@MailId", SqlDbType.NVarChar); parm.Value = txtmailid.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); openconnection(); } }
}
Store Procedure:-
ALTER PROCEDURE InsertFeedback /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @UserId nchar(10), @ContentFeedback int, @Comments nvarchar(500), @MailId nvarchar(50) AS /* SET NOCOUNT ON */ Insert into Feedback(UserId,ContentFeedback,Comments,MailId) values (@UserId,@ContentFeedback,@Comments,@MailId) RETURN ALTER PROCEDURE ReadFeedback /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ AS /* SET NOCOUNT ON */ Select * from Feedback RETURN ALTER PROCEDURE UpdateFeedback /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @SrNo int=0, @UserId nchar(10), @ContentFeedback int, @Comments nvarchar(500), @MailId nvarchar(50) AS /* SET NOCOUNT ON */ Update Feedback set UserId=@UserId,ContentFeedback=@ContentFeedback,Comments=@Comments,MailId=@MailId where SrNo=@SrNo RETURN Login.aspx.cs:-
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class User_Login : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e)
{ con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); OpenConnection(); CloseConnection(); } public void OpenConnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } protected void btnLogin_Click(object sender, EventArgs e) { string strg = "select * from RegisteredUser where UserName='" + txtuname.Text + "' and Password ='" + txtpasswd.Text + "'"; SqlCommand cmd = new SqlCommand(strg, con); OpenConnection(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read() == true) { Session["UserName"] = txtuname.Text; Response.Redirect("Welcome.aspx"); } else { LeeGunn.Web.UI.MessageBox.MessageBox.Show("Username or password wrong"); } dr.Close(); cmd.Dispose(); CloseConnection(); { } } } ForgotPassword.aspx.cs:-
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; public partial class User_ForgotPassword : System.Web.UI.Page { public static SqlConnection con; protected void Page_Load(object sender, EventArgs e) { con = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineShoping"].ToString()); } public void OpenConnection() { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); } public void CloseConnection() { con.Close(); } public void ClearData() { txtuname.Text = ""; txtuname.Focus(); } protected void btnsubmit_Click(object sender, EventArgs e) { try { SqlCommand cmd = new SqlCommand("ReadForgotPassword", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parm = new SqlParameter("Username", SqlDbType.VarChar); parm.Value = txtuname.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); parm = new SqlParameter("Email", SqlDbType.VarChar); parm.Value = txtregemail.Text; parm.Direction = ParameterDirection.Input; cmd.Parameters.Add(parm); OpenConnection(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { lnkpassword.Text = dr["Password"].ToString(); }
} else { lnkpassword.Text = "Username / Email Wrong"; } dr.Close(); ClearData(); CloseConnection(); } catch (Exception ex) { LeeGunn.Web.UI.MessageBox.MessageBox.Show(ex.Message.ToString()); } } } Store Procedure:- ALTER PROCEDURE ReadForgotPassword /* ( @parameter1 int = 5, @parameter2 datatype OUTPUT ) */ @UserName varchar(50), @Email varchar(50) AS /* SET NOCOUNT ON */ Select * From RegisterUser where UserName=@userName and Email=@Email
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 it’s 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.
10. Validation Check
1. All text fields that take integers, as inputs will be validated so that only the digits are allowed.
2. All text fields that take inputs as alphanumeric will be validated, so that only alphabets are taken
as parameters for input.
3. All fields that are mapped to Primary key, will be validated so that the data is not stored as
NULL in the required fields.
4. All text fields max length, are set according to the mapped database fields, so that the characters
do not exceed the maximum length.
5. Before storing the data, all fields that take in NULL are store values as NULL.
6. All Date field values are stored as “dd-MMM-yyyy” format and will be consistent through the
system.
7. All database fields that take in a single value, as flag will content Digit.
8. Primary keys are IDENTITY columns, which makes then Auto-Increment value field.
9. Data Stores in the reference table / column is validated through a Visual Graphical Component
like Combo, ListViews, TreeViews, which makes the Foreign Key Value consistent and sure to
be present in the Parent table.
10. Testing
To examine critically is called Testing. Whatever we have developed whether it is properly
working or how much correctly the development has been done or what are the errors. To answer these
type of questions testing is required.
First of all the project is debugged by method of Traditional breakpoint facility. Debugging means the
process of isolating and correcting the cause of known errors.
Various testing methods are used to test the system.
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.
2. Performance Tests: should be designed to verify response time, execution time,
throughput, primary and secondary memory utilization and traffic rates on data channels and
communications. A query executed takes 5 seconds to display results, is a test for response
time. Execution time is the time taken by CPU to execute a program. Throughput is the rate at
which data gets transferred from one data source to destination. Primary and secondary
memory utilization needs to be optimized. Traffic rates on data channels and communication
link testing are applicable for networks.
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.
Database
[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.
Client layer-user interface
Server layer- WebApp
Server layer-
Data transformation
Server layer - data
Management
Database layer – data access
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.
Interface testing strategy
The overall strategy for interface testing is to (1) Uncover error related to specific Interface
mechanisms (2) uncover errors in the way the interface implements the semantics of navigation, Web
Application functionality, or content display. to accomplish this strategy, a number of objectives must be
achieved:
Interface futures are tested to ensure that design rules, aesthetics, and related visual content are available
for the user without error. Individual interface mechanisms are tested in a manner that is a logous to unit
testing For example; tests are designed to exercise all forms, client-side scripting, dynamic HTML. Each
interface mechanism is tested within the context of a use-case or NSU for a specific user category the
interface is tested within a variety of environments to ensure that it will be compatible.
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.
12. Implementation & maintenance
After testing system will be implemented at the actual site.
Therefore, implementation team should be provided with a well-defined set of software
requirements, an architectural design specification and a detailed design description.
After that user training schedule will be arranged.
Whole system itself consists HELP MENU and HELP TOIPCS so; no major problem will be
encountered.
After three or four months first actual feedback will be taken.
Form that feedback necessary other tips and points will be discussed.
The maintenance is free for one year from system implementation year, after that it depends on
the management to continue or to discontinue. The maintenance-working schedule will be
discussed after three months evolutions.
System Security Measures
At the back end very powerful security is provide by SQL SERVER 2008.
Without proper username and password no one can enter in the database.
Again if user name and password is correct then that user can do only those operations, which
are granted by the administrator.
On Front end side, security is provided by unique user name and password which is known
by him or administrator no one else knows it.
So, anybody who does not know the password and username cannot use it.
The account creation for new user is done by administrator.
Star Placement Services do not want very high security in this version so, high level security
is not implemented .That will be implemented in the next version.
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.
13. Project schedule
No Project Goals Starting Date Ending Date Days
1 Analysis 01-OCT-2014 20-NOV-2014 50
2 Feasibility Study 21-DEC-2014 15-DEC-2014 25
3 Soft. Eng. Para. 15-DEC-2014 30-DEC-2014 15
4 Requirement Spec 01-JAN-2015 03-JAN-2015 2
5 Design 04-JAN-2015 04-FEB-2015 30
6 Coding 06-FEB-2015 08-MAR-2015 32
7 Validation Checks 09-MAR-2015 19-MAR-2015 10
8 Testing 20-MAR-2015 27-MAR-2015 7
9 Implementation &
Maintenance
28-MAR-2015 28-MAR-2015 2
10 Documentation Parallel Work done
with all the Schedule
2
14. chart
Pert Chart
Analysis 27%
Feasibility 13%
Soft. Par. 8%
Req. 1%
Design 16%
Coding 21%
Val. 2%
Testing 8%
Impl. 6%
15. Scope of future application
Future needs always may arise in every system, because at the time of analysis, we
study existing system and thinking of proposing a system which should contain all the
features which makes system user friendly but during whole SDLC phase many
changes may arise in the system which should be developed for the better use of end-
user and thus those new features,. New needs are defined as future enhancements.
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.
Add mail facility for administrator.
User has own account in which he/she can store all details about previous order.
To make search more powerful.
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
Online Shopping Cart(For FashionANDyou.com)
BCSP - 064
ONLINE SHOPPING CART
by
KARANSINH RAJENDRASINH PARMAR
Enrolment No:
126339493
Under Guidance
of
Submitted to the School of Computer and Information Sciences, IGNOU
in partial fulfillment of the requirements
for the award of the degree
Bachlor’s in Computer Applications (BCA)
Year of Submission 2014-15
Indira Gandhi National Open University
Maidan Garhi
New Delhi – 110068.
Table of Content
Sr No
Topics
1. Title of the Project
2. Introduction and Objectives of Projects
3. Project Category
4. Analysis Report (DFDs etc)
5. A Complete Structure of the Program
5.1 Number of Modules
5.2 Data Structure
5.3 Types of Output / Report Generation
5.4 Process Logic
5.5 Validation Checks
6. Tools / Platform, Languages to be used
7. Future Scope of Project
1. Title Of The Project
E-Shopping System
2. Introduction and Objective of Project
2.1 Introduction
E-commerce means Electronic Commerce. It is the paperless technology that exchange of
business information using Electronic Data Interchange (EDI) and related technologies.
Electronic mails (E-mail), faxes, computer bulletin boards, Electronic Funds Transfer are all
forms of E-Commerce. All E-Commerce systems replace all or key parts of paper-based work
flow with faster, cheaper, more efficient and more reliable communications between machines.
Online auctions are an extension of this general idea into Cyberspace. E-commerce rapidly
became the most successful and popular implementation of the idea. It enabled thousands of
people to advertise goods for sale on the eBay website. People bid for the items online, and at the
close of the auction, the highest bid wins. The process goes like this:
8. Seller lists an item, and potential buyers bid
9. Sale ends at predetermined time
10. eBay sends contact data to buyer and seller
11. Buyer and seller arrange shipping details
12. Buyer sends funds – seller sends goods
13. Buyer and seller rate each other via the eBay feedback forum
14. Seller pays eBay a listing fee and, in case of a sale, a final value fee .
The system was developed to allow a user to search for product availability in a specific product
group and give description, availability and price of product (Mobile, Camera, Television,
Computer etc.). It should also show the current location of the product available in the city.This
application is three-tier client server web based application. This system contains two modules:
a) Client module
b) Administrator module
CLIENT MODULE:
In the client module, Clients can search or view the product, information of the
product availability in the city. Also he/she can view the product and can add it to their cart
and buy it online. He/She can view the image and description of product.
Client can register and place his\her order by filling up the personal detail and
shipping address. Client can have advantages of offers of discount on some product
and they can pay as per their convenient by credit card or by cash. Client can put the
advertisement of their own product as a sponsor.
ADMINISTRATOR MODULE
The administrator module contains the following sub-modules:
a) Product Management.
b) Inquiry Management.
c) Sponsor Management.
PRODUCT MANAGEMENT
The product management sub-module provide following type of facilities. The
administrator can add the new product in the application. The administrator
can view, edit and delete the product. The administrator can search and view
the product. The administrator can upload the multiple products concurrently.
INQUIRY MANAGEMENT
The inquiry management sub module provide following type of facilities. The
administrator can view, edit, delete inquiry send by client for add new product
and send reply through E-mail. The administrator can view the reseller and
purchase inquiry of customer and reply through the E-mail.
SPONSOR MANAGEMENT
The Sponsor management sub-module provide following type of facilities.
Administrator can add the new advertisement for particular product. The
administrator can view, edit, delete the inquiry send by the client for add new
advertisement for particular product. The administrator can search and view
the advertisement for particular product. The administrator can set and disable
the advertisement of particular product.
Features of the system
Search product and it’s detail without refreshing page
View advertisement of the product with result of search product.
Any client can buy product by searching product on line for Specific City.
Provides authorization and security.
Administrator can search product, product information, and also view, edit and delete
product.
2.2 Objective
One of the main objectives is to improve the management of the shopping mall via online
shopping by asserting increasing trend.
The online shopping is more convenient for customers. It reduces the dependency on the
vendors. Moreover, the customer is freed from the pressure of buying a product.
There are infinite shelf space available when u shopping through the website or online.
For comparing the quality, quantity, product price, and their features so that customer can
buy a best product.
The need of system is that there is a time savings of customer as well as the vendors who
selling the particular product.
Requirement of a more than one or more different types of products are available for
purchasing as a customer point of view.
1) To shop wile in the comfort of your own home, without having to step out of the door
2) To be able to easily save money and compare prices from website to website
3) Online resellers tent to sell at a lower price due to less overhead expenses
Internet commerce should be viewed as a new way of value creation and provision. To attract
consumers to visit Web sites, a critical question is: What are their major concerns in Internet
shopping? Nine fundamental objectives to describe the bottom line concerns to Internet
consumers have been proposed in the literature. From the perspective of the means-end chain
theory and by focusing on the shopping goods, this study proposed that different weights on
these nine fundamental concerns are assigned by different lifestyle individuals. Based on the
results of a survey of 181 on-line respondents who provided consistent data, this study indicated
that privacy, safety, and product quality were the most critical concerns of on-line consumers,
contradicting the conventional wisdom that cost and convenience are the key concerns for
consumers shopping on-line. Furthermore, for those consumers with active style, privacy factor
received significantly more concern than safety and product quality. Respondents who preferred
variety and excited lifestyle put more weights on these three Internet fundamental objectives than
consumers with other lifestyles. However, principle lifestyle individuals put more weight on
other factors, such as shopping enjoyment, environmental impacts, time to receive products, and
less weight on cost and convenience.
3. Project Category
Relational Database Management System
[RDBMS/INTRANET/INTERNET]
4. Report Analysis(DFD/ERD)
Data Flow Diagram
CONTEXT LEVEL DIAGRAM
ONLINE
SHOPPING
PORTAL
SYSTEM
CUSTOMER
ADMIN
Search for ItemItems into Cart
Personal Details of Customer
Items of Gallery
Cart with Items
Bill Receipt
Item Detail product info
Sponsor Detail
Admin login Detail
Admin Username, password
Username, Password
User Information Report
Customer Information Report
Sponsor Information Report
Product Information Report
Context Level Diagram
LEVEL 1- ADMIN SITE
Admin
Username
pwd1
Verify
Uname,
pwd
2
Generate
Login
msg
3
Login
msg
Loginfo
Username
Pwd info msg
Login msg
4
5
6
Operation
Of
Products
Operation
Of
Sponsor
Operation
Of
User
Level 1 of admin site
LEVEL 2- ADMIN SITE FOR USER AND SPONSER
Admin 4.1Add/Edit/
Remove
User
Detail
Uname,
pwd
Loginfo
4.2
Generate
User Info
Report
Uname,
pwd User Info
Report
5.1Add/Edit/
Remove
Sponsor
Detail
Name,
Img path
Sponsor
5.2Id,Name,
Img path Generate
Sponsor Info
Report
Sponsor
Info
Report
Reports
Level 2 of Admin site for sponsor & user
LEVEL 2 - ADMIN SITE FOR ITEMS / PRODUCTS
Admin
6.1
Add/Edit/
Remove
Item
Detail
6.2
Add/Edit/
Remove
Department
Detail
Department
Name,
Desc
6.3
Add/Edit/
Remove
category
Detail
Name,
Desc
6.4
Add/Edit/
Remove
SubCategory
Detail
Name,
Desc
Category
Category
Product
6.5
Add/Edit/
Remove
Product
Detail
Name, Price
Img Path,
Desc
6.6
Generate
Product Info
Report
Name,
Desc
Name,
Desc
Name,
Desc
Name, Price
Img Path,
Desc
Level 2 of Admin site for Items / products
Product
Info
Report
Report
LEVEL 1 - CUSTOMER SITE
Customer
1
Search
For a
Item
Item Name,
Choose
category
2
Search a
Item from
database
Item Name,
category
3
Verify
Uname,
pwd
Customer
Username
Pwd infoUname, pwd
4
Generate
Login
msg
5
Items
Selected
by user
Click for
view cart
6
Add items
info into
cart
name,date
Qty,price
Shoppingcart
7
Generate
Cart detail
8
Add
Personal
Details
Name,addess,
Phno, city,state
customer
9
Generate
Bill
Receipt
Level 1 of customer site
LEVEL 2- CLIENT SITE FOR CART AND BILL
RECEIPT
Customer
1Collect
Items
Choose By
User
Item info
Shoppingcart
1Count the
Sub Total
Of choose
Items
Item
info
name, qty
Price, total1
Cart of
Customer
With items
1Collect
Customer
Personal
detail
Customer
User info
1Collect
Items of
Cart &
total
Shoppingcart
Personal
details
Personal
details
Cart
Detail Bill
Receipt
Cart of customer
Bill Receipt
Level 2 of Client site for cart & bill receipt
Search
Product
User
Category
Department
Cart
Product
Purchase
Product
Dept ID
Category ID
Product ID
Product
Request to buy
Product
Response
LEVEL 1 – USER SEARCH PROCESS
Entity Relationship Diagram
Category
Category Id
Name
Description
SubCatagory
IdName
Category Id
Image Path
Description
Product IdClass Id
Category Id
Description
HAS
ASubCategory
Class
HAS
A
HAS
AProduct
SubCatagory
Id
Name
Category Id
Description
Class IdSubCatagory
Id
Name
Qty
Customer
Customer
Id
Cart Id
Customer
Name
Buy Shopping Cart
City
State
Country
Mobile
Phone
Pin Code
Shipping
Address
Login Name
Password 1
Cart Id
Id
Product Id Unit Price
Qty Total Price
Status
Date
Image Path
Product Id
Product
Category Id
Description
Class IdSubCatagory
Id
Name
Qty
Sales
Schema Diagram
5. A Complete Structure of the Project
5.1 Number of Modules
CLIENT MODULE:
In the client module, Clients can search or view the product, information of the
product availability in the city. Also he/she can view the product and can add it to their cart
and buy it online. He/She can view the image and description of product.
Client can register and place his\her order by filling up the personal detail and
shipping address. Client can have advantages of offers of discount on some product
and they can pay as per their convenient by credit card or by cash. Client can put the
advertisement of their own product as a sponsor.
ADMINISTRATOR MODULE
The administrator module contains the following sub-modules:
a) Product Management.
b) Inquiry Management.
c) Sponsor Management.
PRODUCT MANAGEMENT
The product management sub-module provide following type of facilities. The
administrator can add the new product in the application. The administrator
can view, edit and delete the product. The administrator can search and view
the product. The administrator can upload the multiple products concurrently.
INQUIRY MANAGEMENT
The inquiry management sub module provide following type of facilities. The
administrator can view, edit, delete inquiry send by client for add new product
and send reply through E-mail. The administrator can view the reseller and
purchase inquiry of customer and reply through the E-mail.
SPONSOR MANAGEMENT
The Sponsor management sub-module provide following type of facilities.
Administrator can add the new advertisement for particular product. The
administrator can view, edit, delete the inquiry send by the client for add new
advertisement for particular product. The administrator can search and view
the advertisement for particular product. The administrator can set and disable
the advertisement of particular product.
Features of the system
Search product and it’s detail without refreshing page
View advertisement of the product with result of search product.
Any client can buy product by searching product on line for Specific City.
Provides authorization and security.
Administrator can search product, product information, and also view, edit and delete
product.
5.2 Data Structure
Data dictionary means it contains the information about all tables include details. There
are eleven tables in my project that are following:
10) ActorMaster
11) RegisteredUser
12) Products
13) Category
14) Cart
15) Feedback
16) OPCRelations
8) Order
9) Payment
10) BuyerPutReq
11) SellerProducts
5) ActorMaster:
Table Name: ActorMaster
Description: This table stores Actor’s number and name, whether he/she is Buyer or
Seller and it is used in master module of my project.
6) RegisteredUser:
Table Name: RegisteredUser
Description: This table stores personal information of User. After registration User can
direct login.
FIELD DATATYP
E
DATA
SIZE CONSTRAINTS DESCRIPTION
ActorNo Int - Primary Key Unique number of Actor
ActorName nchar 10 Not null Name of Actor
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
UserID Nchar 10 Primary Key Unique number of User ID
Password Nvarchar 50 Not null Password of User
Actor Int - Null Name of Actor
FName Nvarchar 15 Not null First name of user
MName Nvarchar 15 Null Middle name of user
LName Nvarchar 15 Not null Last name of user
Address Nvarchar 30 Null Address of User
City Nvarchar 20 Null City of user
State Nvarchar 15 Null State of user
PhoneM Nvarchar 10 Null Unique number of Mobile
PhoneR Nvarchar 15 Null Unique number of Residence
Question Nvarchar 50 Null Personal Questions for User
7) Products:
Table Name: Products
Description: This table stores information of various products.
8) Category:
Table Name: Category
Description: This table stores ID and Name of product’s category.
Answer Nvarchar 50 Null Answers of Personal Questions
Email Nvarchar 20 Not null Email Address of User
LoginDate Datetime - Not null Date & Time of Login
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
Pid Nvarchar 10 Primary Key Unique number of Product ID
PName Nvarchar 30 Not null Name of the product
PDesc Nvarchar 100 Null Description of the product
PImage Image - Not null Image of the product
PImageName Nvarchar 200 Null Name of the image
PPrice Numeric 6,0 Not null Price of the product
PCategoryID Int - Not null Unique number of Category ID
PQnty Int - Null Quantity of the product
Pflag Bit - Not null Flag for show Product
PLoaded Datetime - Not null Date & Time of loaded Product
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
5) Cart:
Table Name: Cart
Description: This table stores numbers of orders selected by the user (buyer/seller).
6) Feedback:
Table Name: Feedback
Description: This table stores information of user’s feedback or review.
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
SrNo Bigint - Primary Key Unique number of feedback
UserID Nchar 10 Foreign Key Unique number of User ID
Content_f Int - Not null Contents of Feedback
Design Int - Not null Design of Feedback
Usability Int - Not null Usability of Fedback
DownloadSpeed Int - Not null Speed of Download
Comments Nvarchar 500 Null Comments of Feeback
CatID Int - Primary Key Unique number of Category ID
CatName Nvarchar 50 Not null Name of Category
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
ID Nvarchar 50 Primary Key Unique number of Product ID
Quantity Int - Null Quantity of Product
Product Nvarchar 100 Null Name of Product
Cost Numeric 8,2 Null Cost of Product
UserID Nvarchar 50 Foreign Key Unique number of user ID
Mailid Nvarchar 50 Not null E-mail address of User
Show Bit - Not null Show the Feedback
7) OPCRelations:
Table Name: OPCRelations
Description: This table stores information of orders and category of products. This table
contains information of order, product and category tables.
8) Order:
Table Name: Order
Description: This table stores information of orders selected by the user (buyer/seller).
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
OrderID Int - Primary Key Unique number of Order ID
OrderDT Datetime - Not null Date & Time of Buying Products
UserID Nchar 10 Foreign Key Unique number of User ID
TotalPrice Numeric 8,0 Not null Total price of Orders
OrderCommit Bit - Not null Show committed Order
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
OrderID Int - Primary Key Unique number of Order ID
Pid Nvarchar 10 Foreign Key Unique number of Product ID
Quantity Int - Not null Quantity of product
Price Numeric 6,0 Not null Price of the product
Orderto Nvarchar 50 Null Order of Product
9) Payment:
Table Name: Payment
Description: This table stores information of payment of user’s orders that are selected by the
particular buyer or seller
10) BuyerPutReq:
Table Name: BuyerPutReq
Description: This table stores information of requests that are required by the user (buyer).
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
Creditcardno Nvarchar 20 Primary Key Unique number of credit card
Pinno Nvarchar 20 Not null Unique number of pin card
Bankname Nvarchar 50 Not null Name of the bank
Ownername Nvarchar 50 Not null Name of the owner
Deliveryaddr Nvarchar 200 Null Delivery address of User
Userid Nchar 10 Foreign Key Unique number of User ID
Ordered Int - Not null Unique number of Order
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
Reqid Int - Primary Key Unique number of Request
Productname Nvarchar 50 Not null Name of Product
Productcategory Int - Null Category of product
Productquantity Int - Null Quantity of product
Productprice Numeric 8,2 Null Price of product
Productchars Nvarchar 150 Null Characteristic of Product
Userid Nchar 10 Foreign Key Unique number of user
Reqdatetime Datetime - Null Date & Time of Buying Products
11) Seller Products:
Table Name: SellerProducts
Description: This table stores information of products that are selected by the user (seller).
FIELD DATATYPE DATA
SIZE CONSTRAINTS DESCRIPTION
SPid Nvarchar 10 Primary Key Unique number of Seller Product
SPName Nvarchar 30 Not null Name of Seller Product
SPDesc Nvarchar 100 Not null Description of the Seller Product
SPImage Image - Not null Image of the Seller Product
SPImageName Nvarchar 200 Not null Name of the Image
SPPrice Numeric 6,0 Not null Price of the Seller Product
SPCategoryID Int - Not null Unique number of Category ID
SPQnty Int - Not null Quantity of the Seller Product
SPflag Bit - Not null Flag for show Product
SPLoaded Datetime - Null Date & Time of loaded Product
SPDuration Int - Null Duration of Selling Product
Userid Nvarchar 50 Foreign Key Unique number of User ID
5.3 Types of Output / Report Generation
Home page:
This is my home page. In this I have provided many facilities like user can directly login to my
site and also user can search any specific product ,user also can view all categories as well as
subcategories of my products.
Registration page:
This is my registration form. This form contains details like User name, password, e-mail id, city
and other details. The person who want to see my website & who want to see the details of this
websites have to fill up registration form once. Once he/she fill up this form, next time they have
to just make login.
Login page:
When user want to login into system first login page is display,Which Contain username and
password field as input.
Feedback page:
This is my Feedback form.By this user can give comments about the services and facilities of
the system. And user can give rating about the Content, Design,Usability,Downloading Speed
and etc of the system.
Forgot Password:
This form is use to get the password of the user if the user forget the password in any case.
Tell a Friend:
This is a tell a friend page. This form is use to give any information to my friends via E-mail
regarding the system.
Contact Us:
This is Query form of the system. By this user can get specific details or solve any query
regarding system via mail.
Add to Cart page :
This is my add to cart page. After selecting product user will add the produc into the cart.
View Cart page:
This is my View cart page.In this user can see the total selected items from my site.it also gives
the facilty to delete the item from the cart if user do not want that item or if total rupees go
beyond the budget.
Payment Page:
This is my Payment page. By this user can buy the products of my site by entering valid Credit
card And Pin Number.
Admin Add Product Page:
This is admin page.In this admin can upload the products on my website.
Admin Manage Product Page:
This is admin page.In this admin can see all the products and admin also can delete the
products. And admin also can mark the products for display.
Admin Manage User page:
This is admin page.In this admin manage the user. It means Admin can change the actors.
Admin Manage Advertisement page:
This is admin page.In this admin can change the advertisements of the website.
Admin Manage Feedback page:
This is admin page.In this admin can see all the feedback of the users and admin also can
approve the feedback for display the particular feedback on the site.
Admin Manage Orderlist:
This is admin page.In this admin can see all the orders of the buyers as well as sellers.After
admin approve the order then only particular product will be deliever to the users.In this admin
also can delete the order.
Admin Manage Custmor’s Request page:
This is admin page.In this Admin can see all the customer’s request and give satisfactory
response to the user.
Admin Manage Seller’s Orderlist:
This is Admin Page. In this admin see all seller’s order and make it approve. After order
approved by the admin then particular item will be deliver.
Admin Manage Seller Products page:
This is admin page.In this admin can see all seller’s products detail and admin also can delete the
product.
Report Generation
Buyer Report
Seller Report
Product Report
Userwise Feedback Report
Customer Order Report
5.4 Process Logic
1) Buyer and Seller: It is the user that uses system.
Registration: When new buyer or seller comes, he/she have to make registration.
Login: After registration, new buyer have to make login and if older buyer directly
he/she can make login.
Select Item: After login user will select the item’s information that user want to buy.
Order Item: After buyer view the item, he/she orders the item.
Upload Item’s Info: After login user have to upload his/her item’s information.
Sell Item: After uploading item’s information seller have to follow rules and
regulation of system to sell his/her item.
Upload/Select Item: After login seller or buyer can upload or select the item.
Sell/Order Item: After upload or select the item seller or buyer can Sell or order the
item.
Payment: After selecting item, to get that item, buyer has to make payment through
transaction process.
Logout: After payment process user can logout his/her login.
Start
User
Registration
Login
Seller Buyer
Upload Item's Info.
Sell Item
Select Item
Order Item
Payment
Transaction
Logout
End
Fork
Join
Seller & Buyer
Sell Item/Order
Item
Upload/Select Item
2) Admin: It is the admin that controls the system.
Login: Admin can directly login in the system.
Manage User: After login admin can manage user like admin can change the actor
(buyer/seller).
Manage Products: After login admin can manage products like admin can edit,
delete and update the products.
Manage Advertisements: After login admin can manage
advertisements.
Manage Feedback: After login admin can manage the feedback.
Manage Orders: After login admin can manage buyer and seller’s
orders.
Manage Customer’s Request: After login admin can manage
customer’s Requests.
Start
Login
Manage User (Seller/Buyer)
Manage Products
Manage Advertisements
Manage Feedback
Manage Orders
Manage Cust’s
Request
Logou
t
End
Admin login
Online Shopping
Product Process User Search Purchase Product
Insert
Process
Update
Process
Delete
Process
Simple
Search
Advance
Search
Credit Card
Verification
Product
Verification
Buyer Seller Admin
Login
Manage
Products
Manage
User Manage
Feedback
Manage
Orders Manage
Advertisement
Admin
Manage
Buyer
Products
Manage
Seller
Products
Manage
Buyer
Orders
Manage
Seller
Orders
After login user select as
After select product Admin approved by Adm
User
View
Products
Get
Products
Add to cart
Make
Orders
Payment
Sell
Products
Deliver
Products
Seller
Upload
Products
Buyer
5.5 Validation Check
11. All text fields that take integers, as inputs will be validated so, that the only
digits are allowed.
12. All text fields that take inputs as alphanumeric will be validated, so that only
alphabets are taken as parameters for input
13. All fields that are mapped to Primary key, will be validate so that the data is not
stores as NULL in the required fields
14. All text fields max length, are set according to the mapped database fields, so that
the characters does not exceed the maximum length.
15. Before storing the data, all fields that take in NULL are store values as NULL.
16. All Date field values are stores as “dd-MMM-yyyy” format and will be
consistent through the system
17. All database fields that take in a single value, as flag will content Digit.
18. Primary keys are IDENTITY columns, which makes then Auto-Increment value
field.
19. Data Stores in the reference table / column is validated through a Visual
Graphical Component like Combo, ListViews, TreeViews, which makes the
Foreign Key Value consistent and sure to be present in the Parent table.
6. Tools / Platform, Languages to be used
Front End Tool - ASP.NET(Code Behind C#)
Back-End Tool - SQL Server 2005
Microsoft VISIO (UML modeling)
Third Party components :
1. Numeric To Verbose.OCX
2. Edge CTL.OCX
7. Future Scope of the Project
Future needs always may arise in every system, because at the time of analysis, we
study existing system and thinking of proposing a system which should contain all the
features which makes system user friendly but during whole SDLC phase many
changes may arise in the system which should be developed for the better use of end-
user and thus those new features,. New needs are defined as future enhancements.
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.
Add mail facility for administrator.
User has own account in which he/she can store all details about previous order.
To make search more powerful.
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.