Anda di halaman 1dari 201

Online Book Store

Submitted By : JINENDRA SHAILESH SHAH


(BCA-118186666)
Under The Guidance Of: Mr. Viki N. Patel (MCA)
Subject Code: BCS (P)-064
Submittion Time : Mar-2015.
Study Center Code: 0902
Regional Center Code : 09.

Online Book Store


SUBMITED BY:
Submitted By:Jinendra S. Shah
(BCA-118186666)

Under Guidance of
Mr. Viki N. Patel(MCA)

Submitted to the School of Computer and Information Sciences, IGNOU


in partial fulfillment of the requirements for the degree of

Master of Computer Applications (MCA)

Indira Gandhi National Open University


MaidanGarhi
New Delhi 110068

2015

CERTIFICATE OF ORIGINALITY

This is to certify that the project report entitled ________________________________


submitted to Indira Gandhi National Open University in partial fulfilment of the
requirement for the award of the degree of BACHELOR OF COMPUTER
APPLICATIONS ( BCA) , is an authentic and original work carried out by Mr. /
Ms._________________________________ with enrolment no. ___________under my
guidance. _______________________
The matter embodied in this project is 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 requirements of any course of study.
.

....

Signature of the Student:

Signature of the Guide

Date:..

Date:

Name and Address

Name, Designation

of the student

and Add. of the Guide:

Enrolment No

ACKNOWLEGEMENT
I have taken efforts in this project. However, it would not have been possible without the
kind support and help of many individuals and organizations. I would like to extend my
sincere thanks to all of them.
I am highly indebted to Mr. Viki N Patel for their guidance and constant supervision as
well as for providing necessary information regarding the project & also for their support
in completing the project.
I would like to express my gratitude towards my parents & member of ONLINE BOOK
STORE for their kind co-operation and encouragement which help me in completion of
this project. I would like to express my special gratitude and thanks to industry persons
for giving me such attention and time.
My thanks and appreciations also go to my colleague in developing the project and
people who have willingly helped me out with their abilities.

PLACE : VADODARA
(TRULY YOURS)

Index
Title
Chapter 1: Title of Project
Chapter 2: Introduction & Objective of the project
Chapter 3: Project Category
Chapter 4: Feasibility Study
4.1 Technical & System Feasibility
4.2 Economic Feasibility
4.3 Legal Feasibility
4.4 Operational Feasibility
4.5 Schedule Feasibility
Chapter 5 : System Requirement Specification
5.1 Scope Of the Solution
5.2 Software Requirement Specification
5.3 System engineering Paradigm
Chapter 6 : Requirement of Analysis
6.1 Data Flow Diagram
6.2 ER Diagram
Chapter 7 : Process Logic
Chapter 8: Data Structure
Chapter 9: Data Model / Schema Diagram
Chapter 10: Input / Output (Screen Shot)
Chapter 11: Coding

11.1 Coding

11.2 Coding Efficiency


11.3 Coding Optimization
Chapter 12 : Testing
Chapter 13 : Validation check
Chapter 14 : Cost Estimation
Chapter 15 : Reports
Chapter 16 : Number Of Modules
Chapter 17 : Charts & Schedules
Chapter 18 : Tools & Platform
Chapter 19 : Future & scope of the Project
Chapter 20 : References & Bibliography
Chapter 21 : Synopsis

[1]

Title Of Project
Online Book Store

[2]
Introduction & Objective of
the Project

Introduction:-

Online Book Store is a ecommerce website for bookstore which provides online
books shopping for user customers and customers can view the orders and the status
of the order using login dashboards. This website has option of administrator who can
add books, view orders and update the status of the orders which customers can see
through his login order page.
Using the system users or customers can view the stores available books
and can place orders through shopping cart. On checkout time user can register or
existing user can use their existing credentials proceed the checkout. There will be
different payment options to choose to place the orders. Using login section, Customers
can view placed orders and the status of the orders whether it is delivered or still
processing from admin side.
This system has administration section where admin can access all orders,
add/view/edit books to the shopping portal. As of now, the system offers only cash on
delivery and DD/Chq. on delivery options.

Background :Online Book Store: An ecommerce website for bookstore is based on B2C project. This
project has been composed on three major strands: Data collection from customer,
administrative process for delivery and revision of report. This online store is mainly a
shopping cart for customers and real time inventory control for admin with administration
panel. Admin has proper report on orders and inventory.
As per the follow-up to the project after the implementing multiple online-payment
options through Google Checkout, PayPal and etc.

Objective: Proposed online Book Store Management system provides very easy
of buying Books.

process

It is more comfortable and flexible rather than offline System.


It takes very less time for processing of various tasks.
From any place user can get more information about various categories of books.
The advertisement work as an ideal task because through it people come to
know about existing and upcoming books categories.
It can handle all the tasks very easily and accurately.
The process to store the data about customer and books is done by computer
system so it provides much more accuracy and security.

10

[3]
Project Category

11

Project Category:
Internet / Intranet / RDBMS

12

[4]
Feasibility Study

13

Feasibility Study :The feasibility study of Online- Book-Store the TELOS model which stand for
Technical, Economic, Legal, Operational and Schedule feasibility was adopted. The
feasibility study should answer the following questions:
1. Technical and system Feasibility: does the technology exist to implement the
proposed system? Is it a practical proposition?
2. Economic Feasibility: is the system cost-effective? Do benefits outweigh costs?
3. Legal Feasibility: is there any conflict between the proposed system and legal
requirements?
4. Operational Feasibility: are the current work practices and procedures
adequate to support the new system?
5. Schedule Feasibility: can the system be developed in time?

4.1 Technical and System Feasibility :The assessment is based on an outline design of system requirements in terms of Input,
Processes, Output, Fields, Programs, and Procedures. This can be quantified in terms
of volumes of data, trends, frequency of updating, etc. in order to estimate whether the
new system will perform adequately or not.
The following questions had been taken consider for the technical feasibility study for
Online Book Store.
A brief description of the business to assess more possible factor/s which could
affect the study
The part of the business being examined
The human and economic factor
The possible solutions to the problems
To implement Online Book Store, commonly available technologies and platforms may
be used and no new technology or platform is required. The networking is likely to fairly
simple and single vendor may implement the whole system. The user and admin is
required Broadband Internet connectivity with at least 60 Kbps speed with minimum
system and browser software as client-side.

14

4.2 Economic Feasibility :Economic analysis is the most frequently used method for evaluating the effectiveness
of a new system. More commonly known as cost/benefit analysis, the procedure is to
determine the benefits and savings that are expected from a candidate system and
compare them with costs. If benefits outweigh costs, then the decision is made to
design and implement the system. An entrepreneur must accurately weigh the cost
versus benefits before taking an action.
Cost-based study: A broadband infrastructure is already available in all the branches.
Use of Internet based network would thus minimize the expenses as no separate WAN
will be required. Open source technology could easily be adopted to further minimize
the cost of software. The client computers would merely be ordinary PCs connected to
the Internet, which all the formations already have. The only thing required would be a
database server, which is likely to cost not more than Rs.2 Lake, and is quite affordable.
The benefits derived from the system far outweigh the cost.
Time-based study: Installation of the entire application is have two parts. Front-end
installation which needs to be add the files in server which may take more then half and
hour and installing the database structure in the MICROSOFT SQL database which
may require 10 minutes.
Thus, the Online Book Store is economically feasible.

4.3 Legal Feasibility :Using this feasible study, we determine whether the proposed system conflicts with
legal requirements.
1. All the user data and privacy will be safe. Our system have secured password
algorithm to secure user data such as password, email and personal information.
2. At any time user can delete/remove their account from our application, which will
remove entire data of the user.
3. Email addresses are not been used for any other purpose except the Online
Book Store application.
4. Spam emails are not been sent to users email address only promotional emails
will be sent to users email that too agreed users only.
Thus, the Online Book Store is economically feasible.

15

4.4 Operational Feasibility :Operational feasibility is a measure of how well a proposed system solves the problems,
and takes advantage of the opportunities identified during scope definition and how it
satisfies the requirements identified in the requirements analysis phase of system
development.
All the data is stored in database, user can track their data using users panel. After
checkout ordered books will be sent from admin to users delivery address and payment
slip will be provided directly and the amount/cash will be collected directly as per the
system.
Thus, the Online Book Store is economically feasible.

16

4.5 Schedule Feasibility :Using SDLC approach the estimated project duration is 20 weeks approx. which comes
to 5 months. It has been planned in a modular manner and one module may be
developed more or less in parallel to another. Further, object orientation and code-reuse
will be adopted during the development process. It is estimated that about 5 man
months will be required to develop and implement the system, given the technology.
Thus, it is feasible to complete the project as per the required schedule.

Nature of Feasibility

Whether Feasible

Reason

Technical Feasibility

Does the technology


exist to implement
the
proposed
system? Is it a
practical
proposition?

FEASIBLE. Although the users of the system are


spread over a wide area, due to the use of
broadband internet at the locations and commonly
available technologies, the project is technically
feasible

Economic Feasibility

Is the system costeffective?


Do
benefits
outweigh
costs?

FEASIBLE. Use of cheap broadband internet, open


source technology, low cost server and existing PCs
as clients, the benefit derived from the system far
outweighs the cost, making it economically feasible

Legal Feasibility

Is there any conflict


between
the
proposed
system
and
legal
requirements?

FEASIBLE. As the operation is under the existing


protocol to the Treaty of Transit and broad
agreement between two governments to amend the
protocol as per requirement and due to legal binding
of the importers to adhere to the treaty, the system is
legally feasible

Operational Feasibility

Are the current work


practices
and
procedures
adequate to support
the new system?

FEASIBLE. Procedures are based on the manual


system described in the Protocol to Indo-Nepal
Treaty of Transit, suitably amended to suit
computerized processing and hence the system
automates a known process. Users are not required
to be trained on procedural aspects. Hence it is
Operationally Feasible

Can the system be


developed in time?

FEASIBLE. The system is required to be


implemented in 5 months time while it is estimated to
be developed in 5 man months if object orientation
and code reuse are adopted. Hence it is feasible to
complete the system as per required schedule

Schedule Feasibility

17

[5]
Software Requirement
Specification (SRS)

18

5.1 Scope of the solution :Online Book Store is a web based online store portal, which sells books online. This
system requires web application which includes shopping cart, members management
and administration section. Vendors who are also selling books can use this application
to sell their books through Online Book Store.
This application deal with three types of users
Vendors
Buyer
Super user/Administrator
Online Book Store allows user to view/browse the list of books and the user can add
their books to shopping cart. Using the shopping cart section, user can purchase books
online. When user is purchasing books through Online Book Store, user will be asked
to enter their details with username and password. Once user purchased books
successfully through Online Book Store application, My account section for user will be
created. User can login his/her my account section using the username/password.
Purchase books online
In users my account system contains the order history of the particular customer.
Using the login section, member/user can add books to wish-list which store the
books details in the members my account section to purchase afterwards.
Vendors who are selling books through can add their books details using vendors
login/account section. After admin review, the details will be displayed in the Online
Book-Store application. When user purchase the vendors books, the details will be
immediately sent to vendors. Vendors will deliver the books to user/customers. Vendors
section contains many other features such as
Books management Add, view and delete books details
Order management View purchased books and set status of the order
Super user is the administrator of the site who has the access to view or edit or delete
the entire system.

19

5.2 Software Requirements Specifications :Frond end: ASP.NET - ASP.NET is a widely used general-purpose scripting language
that is especially suited for Web development and can be embedded into HTML.
Back end: Microsoft SQL - Microsoft SQL Enterprise Server software is the most
reliable, secure and up-to-date version of Microsoft SQL for cost-effectively delivering Ecommerce, Online Transaction Processing (OLTP), and multi-terabyte Data
Warehousing applications. It is a fully integrated transaction-safe, ACID compliant
database with full commit, rollback, and crash recovery and row level locking
capabilities. Microsoft SQL delivers the ease of use, scalability, and performance that
has made Microsoft SQL the world's most popular open source database.
Web Server: Asp.Net Server - The Asp.Net HTTP Server Project is a collaborative
software development effort aimed at creating a robust, commercial-grade and freelyavailable source code implementation of an HTTP (Web) server. The project is jointly
managed by a group of volunteers located around the world, using the Internet and the
Web to communicate, plan, and develop the server and its related
documentation.ASP.NET - ASP.NET is a widely used general-purpose scripting
language that is especially suited for Web development and can be embedded into
HTML.
SOFTWARE REQUIREMENTS(RECOMMENDED) AT SERVER SIDE
Web Browser
Server Requirements

:Standard web browser like Internet Explorer, Mozilla firebox


etc
:ASP.NET 5.0, Microsoft SQL server

HARDWARE REQUIREMENTS TO RUN THE APPLICATIONS


Operating System
Processor
RAM
Hard-disk

:
:
:
:

Windows OS
INTEL I-3 2.9 GHZ
4GB DDR3
250 GB

HARDWARE USED WHILE DEVELOPING APPLICATION


Processor
Ram
Hard-disk

:
:
:

Intel Pentium IV 1.80 GHz.


1GB
250 GB

20

SOFTWARE USED WHILE DEVELOPING APPLICATION


OS
Front tool
Back End

:
:
:

Windows 7 and higher


Asp.Net SERVER (Frame Work 4.0)
Microsoft SQLSERVER 2008

MINIMUM HARDWARE AND SOFTWARE REQUIRED AT CLIENT LEVEL

Any browser, which is XHTML 1.0 compatible like Microsoft Internet 6.0.
Any hardware which support above said browser.

5.3 Software Engineering Paradigm :As the application domains of software are becoming complicated and design of big
software without a systematic approach is virtually impossible, the field of software
engineering is increasingly gaining importance. It is now developing like an industry.
The waterfall model provides a systematic and sequential approach to software
development and is better than the build and fix approach. But the requirements should
be available at the time of commencement of the project. There is no method to judge
the problems of software in between different phases.
The waterfall model with feedback is as follows:

21

Requirement Analysis

System Design

Coding

Testing

Maintenance

22

[6]
Requirement of Analysis

23

6.1 Data Flow Diagram:-

Context Level Diagram:


Search Book

Place Order
Make Payment

Customer

Get Customer Details

Get Book,
Bill,Receipt

Online
Book Store
Management
System

Get Payment

Get Book Details

Dispetch Order

Admin

24

1st Level Diagram of Online Book Store System:


Manage Master Table

Admin

1.0
Admin

Get Update Data


For Master Table
Order the Book
Make the Payment

Customer
2.0
Get Books
Get Reports

Get & Receive


Customer details
Get &
Re
Sale ceive th
e
s De
tails

Send Book Details

3.0

Order to Purchase Book

Purchase
Make the Payment

the P
u
Deta blisher
ils

se
rch etails
u
P
he ook D
t
B
nd
Se sher
bli
the
Pu Send etails
lier D
Supp
Send
the
Book Purchse
Deta
ils

Get the Receipt

4.0
Print The reports

Reports

Get Report

Book

Book Sales

Get Book

Admin

Sales

s
Sale
e
h
t
Send Details
Book

Send

Supplier

Customer

se
rch
u
P
the port
d
n Re
Se
r
Orde
e
h
t
Send ports
Re

Se
Paym nd the
ent R
epor
t

Publisher

Supplier

Purchase

Order

Payment

25

Send the Sales Report


Send the Customer Report

2nd Level Diagram of Online Book Store System:


Fill the form

Customer
Send the customer details

Customer

1.1
Customer
Details

Search the data


Receive the Data Categories
1.2

Deliver To Customeer

Book
Search

Get the
data

G
Pu et th
bl
e
De icatio
tai
ls n

Order of
books

1.3
Order

Order
Payment

Get the datiles of order

Publication

Fetch the Order


Order
detail
Deatils
send
the o
r
data der
Se
nd
Order
th
de e sta
ati
ls tus

Confirm the Order

Order Status

1.5

1.4

Dispatch

Payment

Payment
Deatils

Payment

26

Admin

Book

3rd Level Diagram of Online Book Store System:


Store Publication data
Store Book data
Store Categories data
Store Customer data
Fill the Table Data

Admin
Send the customer details
2.1
Table
Selection

Customer

Search the table data


Receive the Data Categories
2.2

Confirm to User

Table
Manage

Ge

Get the
data

tP

ub

lica

tio

et

Correct the
data

Book

nd

Publication

us
ls
tat
ils
ai
r S Deta
et
ta
de
t
rd
da t Or
en
er Ge aym
tP

et

de

or

ata

rd

2.3

Ge

DataEntry

Order
Deatils

Validate
the Data

Order

Order Status
2.5

Store the data

2.4
Validation
Payment

Storage
Store Payment data
Store Order Status data
Store Order data

Store Order Details data

27

4th Level Diagram of Online Book Store System:

Fill the Report Form

us

4.1

Get C

Report
Selection

Get C

ata
Categories
Ge gories De
tails
tB
oo
kD
Ge
eta
tP
ils
ub
lica
Book
tio
nD
ata

et

Prepare Report
Datat

tail Customer

r de
tome

et

D
Order Details

us

Order

4.3

tails

nt De

ayme

tat

rS

Get P

Finally report
Check & Print

rde

tO

Ge

ata

rD

rde

Report
Prepration

Publication

ls

ai

to

4.2

Ge

er

rd

Confirm Report Print

Admin

Order Status

Report
Print
Payment

28

6.2 ER Diagram :-

Cust_Id

Purchse_Id

Email_Id

Fill

Customer

Cust_Nm

Cust_Id

Register Details

1
Order_Id
Area

Address

Totquantity

Cust_Nm

Address

Area

Email_Id

M
Make

Order

Slip_No

Cust_Id

Book_Id

Order Details

Sup_Id

Book_Nm
Price

TotAmount

Sup_Nm

ContactPers
on_Nm

Book_Id

Payment

Book
M

M
ChequeDate

Bank_Nm

1
Supply

Supplier

M
Address

Searchkey

Contact_No

Email_Id

Publish
By

Receipt

Pub_Id

Pub_Nm
1

Purchase

Publisher

Id

Price
1
Admin

AdminName

Usertype

Address

Contact_No
Order_Id

Order_date

UserNM

Generates

Description

Order

Totquantity

Stock_Id

29

[7]
Process Logic

30

Process Logic:1. Admin Side Algorithm:


Step 1: Start
Step 2: Check User is Register or Not
Step 3: If (User is not Register) then;
Call Register();
else
Login();
Enter UserName
Enter Password
End
step 4: Stop.

Manage Choice Of Master Algorithm:


Step 1: Start
Step 2: Select Admin Process
1. Book
2. Order
3. Payment
4. Publication
5. Purchase
6. Supplier
step 3: Select Choice
Step 4: Do Accept Process
Step 5: Stop.

Manage Book Master Algorithm:

31

Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
BookAdd();
Enter Book_Id
Enter Book_Nm
Enter Search_Keyword
Search Image

Select Category_Id
Enter Status
Option:-

Validate data
Store data

Book Modify();
Search Book_Id
Option:Update record
Store data
Book Delete();
Search Book_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

Manage Order Master Algorithm:


Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
OrderAdd();
Enter Order_Id
Enter Order_date
Enter Description
Enter Totquantity
Enter Stock_Id
Option:-

Validate data
Store data

Order Modify();
Search Order_Id
Option:-

Update record
Store data

Order Delete();
Search Order_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

Manage Payment Master Algorithm:

32

Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
PaymentAdd();

Enter Slip_No
Enter Payment_type
Enter TotPayment
Enter Bank_Nm
Enter Branch_Nm
Enter Date_Of_Payment
Enter Cheque_No
Enter Cheque_Date
Enter Cust_Id
Enter Courier_Id
Enter Book_Id
Option:-

Validate data
Store data

Payment Modify();
Search Slip_No
Option:-

Update record
Store data

Payment Delete();
Search Slip_No
Delete the record.
Do u Want to Delete?
step 3: Stop.

Manage Publication Master Algorithm:


Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
PublicationAdd();
Enter Pub_Id
Enter Pub_Nm
Enter Price
Enter Address
Enter Email_Id
Enter Contact_No
Option:-

Validate data
Store data
Publication Modify();
Search Pub_Id
Update record
Store data

33

Option:-

Publication Delete();
Search Pub_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

Manage Purchase Master Algorithm:


Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
PurchaseAdd();
Enter Pur_Id
Enter Pur_Nm
Enter Order_Id
Enter Totpayment
Enter Totquantity
Enter Sup_Id
Enter Date_of_Purchase
Option:Validate data
Store data
Purchase Modify();
Search Pur_Id
Option:Update record
Store data
Purchase Delete();
Search Pur_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

Manage Supplier Master Algorithm:

34

Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
SupplierAdd();
Enter Sup_Id
Enter Sup_Nm
Enter ContactPerson_Nm
Enter Address
Enter Contact_No
Enter Mobile_No
Enter Email_Id
Enter Gender

Enter Country_Id
Enter State_Id
Enter City_Id
Enter Zipcode
Option:-

Validate data
Store data

Supplier Modify();
Search Sup_Id
Option:-

Update record
Store data

Supplier Delete();
Search Sup_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

2. Client Side Algorithm:


Step 1: Start
Step 2: Display the Home Page.
Step 3: If (User is not Register) then;
Client Register();
Enter Id
Enter User_Nm
Enter Password
Enter User_type
Enter Email_Id
Enter First_Nm
Enter Middle_Nm
Enter Last_Nm
Enter Contact_No
Enter Address
Enter Gender
Enter Country_Id
Enter State_Id
Enter City_Id
Enter ZipCode
Option:-Validate data
Store data
else

35

Login();
Enter UserName
Enter Password

End
step 4: Stop.

Manage Client Side Purchase Process:


Step 1: Start
Step 2: Show the Book Menu
Step 3: Display The Book Name
Step 4: Search the Book
Step 5: Add the Cart
Step 6: Place the Order
Step 7: Paid the Amount
Step 8: Stop.

Manage Client Side Order Process:


Step 1: Start
Step 2: Show the Book Menu
Step 3: Display the Book Name
Step 4: Search the Book Key Word
Step 5: Show the Book & Price with Publication Name &
Author Name.
Step 6: If (User Purchase Book)
Add the Cart
Place the Order
Paid the Amount
Finish
Else
Finish
End
Step 7: Stop.

36

[8]
Data Structure

37

Data Structure:Chapter 6: Data Structure

1.Admin:
FieldName
Id
User_Nm
Password
User_type
Email_Id
First_Nm
Middle_Nm
Last_Nm
Contact_No
Address
Gender
Country_Id
State_Id
City_Id
ZipCode

Size
10
30
18
20
50
20
20
20
12
50
10
10
10
10
10

DataType
Numeric
Varchar
Varchar
Varchar
Varchar
Varchar
Varchar
Varchar
Numeric
Varchar
Char
Numeric
Numeric
Numeric
Numeric

Validation
PrimaryKey
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Foreignkey
Foreignkey
Foreignkey
Not null

DatType
Numeric
Varchar
Numeric
Varchar
Numeric
Numeric

Validation
PrimaryKey
Not null
Not null
Not Null
Foreign Key
Not null

Size
10
30
30

DataType
Numeric
Varchar
Varchar

Validation
PrimaryKey
Not null
Not null

Size
10
30
10

DataType
Numeric
Varchar
Numeric

Validation
PrimaryKey
Not null
Foreignkey

2.Book:
FieldName
Book_Id
Book_Nm
Search_Keyword
Image
Cate_Id
Status

Size
10
30
10
50
10
10

3.Category:
FieldName
Cate_Id
Cate_Nm
Description

4.City:
FieldName
City_Id
City_Nm
State_Id

38

5.Country:
FieldName
Country_Id
Country_Nm
Country_Alias

Size
10
30
15

DataType
Numeric
Varchar
Varchar

Validation
PrimaryKey
Not null
Not null

Size
10
30
10
10
30
30

DataType
Numeric
Varchar
Date
Date
Varchar
Varchar

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null

Size
10
20
20
20
12
50
50
10
10
10
10
10
10

Datatype
Numeric
Varchar
Varchar
Varchar
Numeric
Varchar
Varchar
Numeric
Numeric
Numeric
Numeric
Date
Numeric

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null
Not null
Foreignkey
Foreignkey
Foreignkey
Not null
Not null
Not null

Size
10
10
10
30
30

Datatype
Numeric
Numeric
Date
Varchar
Varchar

Validation
Primarykey
Foreignkey
Not null
Not null
Not null

Size
10
10
30
10
10

Datatype
Numeric
Date
Varchar
Numeric
Numeric

Validation
Primarykey
Not null
Not null
Not null
Foreignkey

6.Courier:
FieldName
Courier_Id
Courier_Nm
Delivery_date
Receiving_date
Source
Destination

7.Customer:
Fieldname
Cust_Id
First_Nm
Middle_Nm
Last_Nm
Contact_No.
Email_Id
Address
Country_Id
State_Id
City_Id
Zipcode
Date_of_purchase
Status

8.Delivery_Status:
Fieldname
Status_Id
Courier_Id
Date_Of_Purchase
Source
Destination

9.Order Master:

39

Fieldname
Order_Id
Order_date
Description
Totquantity
Stock_Id

10.Order_Detail:
Fieldname
Order_Id
Book_id
Totquantity
Price
TotAmount

Size
10
10
10
10
10

Datatype
Numeric
Numeric
Numeric
Numeric
Numeric

Validation
Foreignkey
Foreignkey
Not null
Not null
Not null

Size
10
10
10
30
30
10
10
20
10
10
10

Datatype
Numeric
Varchar
Numeric
Varchar
Varchar
Date
Date
Varchar
Numeric
Numeric
Numeric

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Foreignkey
Foreignkey
Foreignkey

Size
10
30
10
50
20
10

Datatype
Numeric
Varchar
Numeric
Varchar
Varchar
Numeric

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null

11.Payment:
Fieldname
Slip_No
Payment_type
Totpayment
Bank_Name
Branch_Name
Date_Of_Payment
Cheque_date
Cheque_No
Cust_Id
Courier_Id
Book_Id

12.Publication:
Fieldname
Pub_Id
Pub_Nm
Price
Address
Email_Id
Contact_No

13.Purchase:
Fieldname
Pur_Id
Pur_Nm
Order_Id
Totpayment
Totquantity
Cust_Id
Sup_Id
Date_Of_Purchase

Size
10
30
10
10
10
10
10
10

Datatype
Numeric
Varchar
Numeric
Numeric
Numeric
Numeric
Numeric
Date

Validation
Primarykey
Not null
Foreignkey
Not null
Not null
Foreignkey
Foreignkey
Not null

40

14.Purchase_Detail:
Fieldname
Trans_Id
Pur_Id
Book_Id
Quantity
Price

Size
10
10
10
10
10

Datatype
Numeric
Numeric
Numeric
Numeric
Numeric

Validation
Primarykey
Foreignkey
Foreignkey
Not null
Not null

Size
10
30
10

Datatype
Numeric
Varchar
Numeric

Validation
Primarykey
Not null
Foreignkey

Size
10
10
10

Datatype
Numeric
Numeric
Numeric

Validation
Primarykey
Foreignkey
Not null

Size
10
30
30
10

Datatype
Numeric
Varchar
Varchar
Numeric

Validation
Primarykey
Not null
Not null
Foreignkey

15.State:
Fieldname
State_Id
State_Nm
Country_Id

16.Stock:
Fieldname
Stock_Id
Book_Id
Totquantity

17.Subject:
Fieldname
Sub_Id
Sub_Nm
Author_Nm
Pub_Id

18.Supplier:
Fieldname
Sup_Id
Sup_Nm
Contactperson_Nm
Address
Contact_No
Mobile_No
Email_Id
Gender
Country_Id
State_Id
City_Id
Zipcode

Size
10
30
30
50
10
10
30
10
10
10
10
10

Datatype
Numeric
Varchar
Varchar
Varchar
Numeric
Numeric
Varchar
Char
Numeric
Numeric
Numeric
Numeric

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Foreignkey
Foreignkey
Foreignkey
Not null

41

[9]
Data Model / Schema Diagram

42

Data Model Diagram:Country


PK,I1 Country_Id
Country_Nm
Country_Alias
Book
PK,I1 Book_Id
Book_Nm
Search_Keyword

State
PK,I3

State_Id

State_Nm
FK1,I2,I1 Country_Id

Customer

Courier
PK,I5

PK Courier_Id

City

Cust_Id
PK,I1

First_Nm
Middle_Nm
Last_Nm
Contact_No
I6
Email_Id
Address
Gender
FK2,I4,I3 Country_Id
FK3,I8,I7 State_Id
FK1,I1,I2 City_ID
Purchase_Date

Courier_Nm
Delivery_Date
Receiving_Date
Source
Destination

Payment

Stock
PK,I2

Stock_Id

FK1,I1 Book_Id
Totquantity

Order
PK,I1

Order_Id

PK

Slip_No

Payment_Type
TotPayment
Bank_Nm
Branch_Nm
Date_Of_Payment
Cheque_Date
Cheque_No
FK3,I6,I5 Cust_Id
FK2,I4,I3 Courier_Id
FK1,I2,I1 Book_Id

Delivery_Status
PK,I4

Status_Id

I1

Courier_Id
Date_Of_Purchase
Source
Destination
FK1,I3,I2 Cust_Id

Order_Date
Description
Totquantity
FK1,I3,I2 Stock_Id

City_Id

City_Nm
FK1,I3,I2 State_Id

Publication
PK,I6

Admin
PK,I6

Id

User_Nm
Password
User_type
I5
Email_Id
First_Nm
Middle_Nm
Last_Nm
Contact_No
Address
Gender
FK2,I4,I3 Country_Id
FK3,I8,I7 State_Id
FK1,I2,I1 City_Id
I9
Zipcode

Pub_Id

Pub_Nm
Price
Address
I5
Email_Id
Contact_No
Mobile_No
FK2,I4,I3 Country_Id
FK3,I8,I7 State_Id
FK1,I2,I1 City_Id
I9
Zipcode

Supplier
PK,I5 Sup_Id

Subject
PK,I3

Sub_Id

Sub_Nm
Author_Nm
FK1,I2,I1 Pub_Id

I3
I2
I4
I1
I6

Sup_Nm
ContactPerson_Nm
Address
Contact_No
Mobile_No
Email_Id
Gender
Country_Id
State_Id
City_Id
Zipcode

Purchase

Order_Detail
PK,I5

Pur_Id
Category

FK2,I4,I3 Order_Id
FK1,I2,I1 Book_Id
Totquantity
Price
TotAmount

Pur_Nm
FK2,I4,I3 Order_Id
TotPayment
Totquantity
FK1,I2,I1 Cust_Id
FK3,I7,I6 Sup_Id
Date_Of_Purchase

PK,I1 Cate_Id
Cate_Nm
Description

Purchase_Details
PK,I5

Trans_Id

FK2,I4,I3 Pur_Id
FK1,I2,I1 Book_Id
Quantity
Price

43

[10]
Input / Output
(Screen Shot)

44

Login page

Welcome page

45

Forgote password

Change password

46

Book (save)

Book (update)

47

Book (delete)

Category ( save)

48

Category(delete)

Category(Update)

49

Country (save)

Country (update)

50

City(save)

City(update)

51

city (delete)

Stock(save)

52

stock(update)

Stock(delete)

53

Courier (save)

Courier (update)

54

Courier (delete)

Delivery status (save)

55

Delivery status (update)

Delivery status (delete)

56

Order Master (save)

Order Master (update)

57

Order Master( delete)

Order detail (save)

58

Order detail (update)

Order detail (delete)

59

Payment (save)

Payment (update)

60

Payment (delete)

Publication( save)

61

Publication (update)

Publication (delete)

62

Purchase detail (save)

Purchase detail (update)

63

Purchase detail (delete)

State (save)

64

State (update)

State (delete)

65

Subject (save)

Subject (update)

66

Subject( delete)

Supplier (save)

67

Supplier( update)

Supplier (delete)

68

Client book subcategory

Book publication detail

69

Book detail

70

[11]
Coding

71

11.1 Coding:Loginpage coding c#


using System;
using System.Collections;
using System.Configuration;
using System.Data;

using
using
using
using
using
using
using
using

System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Data.SqlClient;
LeeGunn.Web.UI.MessageBox;

publicpartialclassAdmin_login : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
con.Open();
Txtpswd.TextMode = TextBoxMode.Password;
}
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}

protectedvoid btnlogin_Click(object sender, EventArgs e)


{
SqlCommand cmd = newSqlCommand("select * from Admin where User_name='" + Txtusrnm.Text + "' and
Password='" + Txtpswd.Text + "'", con);
cmd.CommandType = CommandType.Text;
SqlDataReader red = cmd.ExecuteReader();
if (red.Read())
{
Session["unm"] = Txtusrnm.Text;
Response.Redirect("welcomepage.aspx");
}
else
{
Label1.Text = "UserName And Password are Wrong....";
Txtusrnm.Text = "";
Txtpswd.Text = "";

72

}
red.Close();
cmd.Dispose();

protectedvoid lbnfrgtpswd_Click(object sender, EventArgs e)


{
Response.Redirect("forgotpassword.aspx");
}
protectedvoid lbnchngpswd_Click(object sender, EventArgs e)
{
Response.Redirect("changepassword.aspx");
}
}

Welcome page coding c#


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
publicpartialclassAdmin_Default : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{

73

}
protectedvoid LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("book.aspx");
}
protectedvoid LinkButton2_Click(object sender, EventArgs e)
{
Response.Redirect("Category.aspx");
}
protectedvoid LinkButton3_Click(object sender, EventArgs e)
{
Response.Redirect("Country.aspx");
}
protectedvoid LinkButton4_Click(object sender, EventArgs e)
{
Response.Redirect("Customer.aspx");
}
protectedvoid LinkButton5_Click(object sender, EventArgs e)
{
Response.Redirect("OrderMaster.aspx");
}
protectedvoid LinkButton6_Click(object sender, EventArgs e)
{
Response.Redirect("publication.aspx");
}
protectedvoid LinkButton7_Click(object sender, EventArgs e)
{
Response.Redirect("state.aspx");
}
protectedvoid LinkButton8_Click(object sender, EventArgs e)
{
Response.Redirect("city.aspx");
}
protectedvoid LinkButton9_Click(object sender, EventArgs e)
{
Response.Redirect("Subject.aspx");
}
protectedvoid LinkButton10_Click(object sender, EventArgs e)

{
Response.Redirect("Supplier.aspx");
}
protectedvoid LinkButton11_Click(object sender, EventArgs e)
{
Response.Redirect("Purchase.aspx");
}
protectedvoid lbncourier_Click(object sender, EventArgs e)
{
Response.Redirect("Courier.aspx");
}
protectedvoid lbndelstatus_Click(object sender, EventArgs e)
{
Response.Redirect("Deliverystatus.aspx");
}
protectedvoid lbnodrdetl_Click(object sender, EventArgs e)
{
Response.Redirect("OrederDetail.aspx");
}
protectedvoid lbnpymnt_Click(object sender, EventArgs e)
{
Response.Redirect("Payment.aspx");
}
protectedvoid lbnprchsdetl_Click(object sender, EventArgs e)
{
Response.Redirect("PurchseDetail.aspx");
}
}
Forgote password coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.Net.Mail;
using System.Data;
publicpartialclassAdmin_forgotpassword : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
// con.Open();
bindadmin();
// clear();
}
}

74

protectedvoid opneconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}

protectedvoid closeconn()
{
con.Close();
}

protectedvoid bindadmin()
{
SqlCommand cmd = newSqlCommand("SP_Readadmin", con);
cmd.CommandType = CommandType.StoredProcedure;
opneconn();
drpscrtquesn.DataSource = cmd.ExecuteReader();
drpscrtquesn.DataTextField = "Secret_question";
drpscrtquesn.DataBind();
closeconn();
}
protectedvoid btnsbmit_Click(object sender, EventArgs e)
{

}
protectedvoid btnback_Click(object sender, EventArgs e)
{
Response.Redirect("loginpage.aspx");
}
protectedvoid btnsbmit_Click1(object sender, EventArgs e)
{
try
{
DataSet ds = newDataSet();
{
con.Open();
SqlCommand cmd = newSqlCommand("select * from Admin where User_name='" + Txtusrnm.Text + "' and
Secret_question='" + drpscrtquesn.SelectedValue + "'", con);
SqlDataAdapter da = newSqlDataAdapter(cmd);
da.Fill(ds);
con.Close();
}
if (ds.Tables[0].Rows.Count > 0)
{
MailMessage Msg = newMailMessage();
Msg.From = newMailAddress(Txtusrnm.Text);
Msg.To.Add(Txtusrnm.Text);
Msg.Subject = "Your Password Details";
Msg.Body = "Hi, <br/>Please check your Login Detailss<br/><br/>Your Username: " +
ds.Tables[0].Rows[0]["UserName"] + "<br/><br/>Your Password: " + ds.Tables[0].Rows[0]["Password"]
+ "<br/><br/>";
Msg.IsBodyHtml = true;
SmtpClient smtp = newSmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.Credentials = new System.Net.NetworkCredential("jinendra_shah@gmail.com",
"094386099");
smtp.EnableSsl = true;
smtp.Send(Msg);
lblmsg.Text = "Your Password Details Sent to your mail";
Txtusrnm.Text = "";
}
else
{
lblmsg.Text = "The Email you entered not exists.";
}
catch (Exception ex)

75

{
Console.WriteLine("{0} Exception caught.", ex);
}
}
}
Change password coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
publicpartialclassAdmin_changepassword : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
con.Open();
}
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
string strg = "select count(*) from Admin where User_name='" + Txtusrnm.Text + "' and Password='"
+ Txtpswd.Text + "'";
SqlCommand cmd = newSqlCommand(strg, con);
if (Convert.ToString(cmd.ExecuteScalar()) == "0")
{
Label1.Text = "Wrong User Name and Pass ";
}
else
{
if (Txtnewpswd.Text == Txtcnfrmpswd.Text)
{
string strgs = "Update Admin set Password='" + Txtcnfrmpswd.Text + "' where User_name='" +
Txtusrnm.Text + "'";
SqlCommand cmds = newSqlCommand(strgs, con);
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
cmds.ExecuteNonQuery();
Label2.Text = "your password is changed";
con.Close();
}

76

}
}

Book coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;
using System.IO;
publicpartialclassAdmin_BOOK : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
Bindgrid();
bindcategory();
}
}
publicvoid bindcategory()
{
SqlCommand cmd = newSqlCommand("SP_ReadCategorys", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConn();
drpcatenm.DataSource = cmd.ExecuteReader();
drpcatenm.DataTextField = "Cate_name";
drpcatenm.DataValueField = "Cate_id";
drpcatenm.DataBind();
CloseConn();
}
protectedvoid Bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_ReadBooks", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConn();
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
CloseConn();
}

77

protectedvoid OpenConn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid CloseConn()
{
con.Close();
}
protectedvoid Save_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")

{
try
{
string filenames1 = System.IO.Path.GetFileName(FileUpload1.FileName.ToString());
FileUpload1.SaveAs(Server.MapPath("~/Images/" +filenames1.ToString()));
SqlCommand cmd = newSqlCommand("SP_InsertBooks", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConn();
SqlParameter prm = newSqlParameter("@BOOKNAME", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtbooknm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@SEARCHKEYWORD", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtserachkeywrd.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@IMAGENAME", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = FileUpload1.FileName.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@CATEGORYID", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcatenm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
string Stat = "";
if (Active.Checked)
Stat = "Yes";
else
Stat = "No.";

prm = newSqlParameter("@PUBLICATIONID", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drppubnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@STATUS", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Stat;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@SUBJECT", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Stat;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@AUTHORDETAIL", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Stat;
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();

CloseConn();
MessageBox.Show("Data has been saved");
Bindgrid();

}
}

78

}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

else
{
try
{
string filenames1 = System.IO.Path.GetFileName(FileUpload1.FileName.ToString());
FileUpload1.SaveAs(Server.MapPath("~/Images/" + filenames1.ToString()));
SqlCommand cmd = newSqlCommand("SP_updatebooks", con);
cmd.CommandType = CommandType.StoredProcedure;
OpenConn();
SqlParameter prm = newSqlParameter("@BOOKNAME", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtbooknm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@SEARCHKEYWORD", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtserachkeywrd.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@IMAGENAME", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = FileUpload1.FileName.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@CATEGORYID", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpcatenm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
string Stat = "";
if (Active.Checked)
Stat = "Yes";
else
Stat = "No.";

prm = newSqlParameter("@PUBLICATIONID", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drppubnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@STATUS", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Stat;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@SUBJECT", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtsub.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@AUTHORDETAIL", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtauthrnm.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@BOOKID", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Book_id"].ToString();
cmd.Parameters.Add(prm);

79

cmd.ExecuteNonQuery();

CloseConn();
MessageBox.Show("Data updated");
Bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}
}
protectedvoid GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Book_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editbooks", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@bookid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
OpenConn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtbooknm.Text = red["Book_name"].ToString();
Txtserachkeywrd.Text = red["Search_keyword"].ToString();
drpcatenm.SelectedItem.Text = red["Cat_id"].ToString();
drppubnm.SelectedItem.Text = red["Pub_id"].ToString();
Txtsub.Text = red["Subject"].ToString();
Txtauthrnm.Text = red["Author_Detail"].ToString();

}
btnsave.Text = "Update";
CloseConn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

80

SqlCommand cmd = newSqlCommand("SP_deletebooks", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@bookid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();

cmd.Parameters.Add(prm);
OpenConn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
Bindgrid();
CloseConn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
Bindgrid();
}
}
protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");

lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtbooknm.Text = "";
Txtserachkeywrd.Text = "";
drpcatenm.SelectedIndex = 0;
drppubnm.SelectedIndex = 0;
Active.Text = "";
Txtsub.Text = "";
Txtauthrnm.Text = "";
}
}
Category coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;

81

publicpartialclassAdmin_Category : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();
}

}
publicvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_ReadCategorys", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{
SqlCommand cmd = newSqlCommand("SP_Categorys", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@categoryname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcatnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@description", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdscptn.Text;
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updateCategorys", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();

prm = newSqlParameter("@description", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;

82

SqlParameter prm = newSqlParameter("@categoryname", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtcatnm.Text;
cmd.Parameters.Add(prm);

prm.Value = Txtdscptn.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@categoryid ", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Cate_id"].ToString();
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}
}
protectedvoid GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Cate_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editCategorys", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@categoryid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtcatnm.Text = red["Cate_name"].ToString();
Txtdscptn.Text = red["Description"].ToString();
}
btnsave.Text = "Updated";
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

83

SqlCommand cmd = newSqlCommand("SP_deleteCategorys", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@categoryid", SqlDbType.Int);

prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}

protectedvoid btnreset_Click(object sender, EventArgs e)


{
Txtcatnm.Text = "";
Txtdscptn.Text = "";
}
}
Country coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;
publicpartialclassAdmin_Country : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{

84

if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();

}
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("Sp_Readcountry", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_country.DataSource = cmd.ExecuteReader();
Grid_country.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{
SqlCommand cmd = newSqlCommand("Sp_Insertcountry", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@countryname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntrynm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@countryalias", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntryalias.Text;
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Country Registered");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("Sp_updatecountry", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();

85

SqlParameter prm = newSqlParameter("@countryname", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntrynm.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@countryalias", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntryalias.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@countryid ", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Country_id"].ToString();
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Country updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
protectedvoid Grid_country_RowCommand(object sender,
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

GridViewCommandEventArgs e)

ViewState["Country_id"] = id;

SqlCommand cmd = newSqlCommand("Sp_editcountry", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@Countryid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtcntrynm.Text = red["Country_name"].ToString();
Txtcntryalias.Text = red["Country_alias"].ToString();

}
btnsave.Text = "Update";
closeconn();

SqlCommand cmd = newSqlCommand("Sp_deletecountry", con);

86

}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@countryid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_country_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtcntrynm.Text = "";
Txtcntryalias.Text = "";
}
}

City coding c#
using
using
using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections;
System.Configuration;
System.Data;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
System.Data.SqlClient;
LeeGunn.Web.UI.MessageBox;

87

publicpartialclassAdmin_City : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();
bindstate();
}
}
publicvoid bindstate()
{
SqlCommand cmd = newSqlCommand("SP_ReadState", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpstatenm.DataSource = cmd.ExecuteReader();
// drpstatenm.DataTextField = "State_name";
drpstatenm.DataValueField = "State_id";
drpstatenm.DataBind();
closeconn();
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_ReadCity", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_City.DataSource = cmd.ExecuteReader();
Grid_City.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{
SqlCommand cmd = newSqlCommand("Sp_insertcity", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@cityname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcitynm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@stateid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpstatenm.Text;
cmd.Parameters.Add(prm);

closeconn();
MessageBox.Show("Data Saved");

88

cmd.ExecuteNonQuery();

bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updateCity", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@cityname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcitynm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@stateid ", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpstatenm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@cityid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["City_id"].ToString();
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("CITY Update");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
protectedvoid Grid_City_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{
ViewState["City_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editCity", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@city_id", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

89

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();

while (red.Read())
{
Txtcitynm.Text = red["City_name"].ToString();
drpstatenm.SelectedItem.Text = red["State_id"].ToString();

}
btnsave.Text = "Updated";
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

SqlCommand cmd = newSqlCommand("SP_deleteCity", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@City_id", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_City_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtcitynm.Text = "";
drpstatenm.SelectedIndex = 0;
}
}

using System;
using System.Collections;

90

Stock coding c#

using
using
using
using
using
using
using
using
using
using
using
using

System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
System.Data.SqlClient;
LeeGunn.Web.UI.MessageBox;

publicpartialclassAdmin_stock : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();
bindbook();

91

}
protectedvoid bindbook()
{
SqlCommand cmd = newSqlCommand("SP_ReadBooks", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpbooknm.DataSource = cmd.ExecuteReader();
drpbooknm.DataTextField = "Book_name";
drpbooknm.DataValueField = "Book_id";
drpbooknm.DataBind();
closeconn();
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_Readstock", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_stock.DataSource = cmd.ExecuteReader();
Grid_stock.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{
SqlCommand cmd = newSqlCommand("SP_Insertstock", con);

cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@bookid", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = drpbooknm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@totalquantity", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txttotqun.Text;
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("data saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updatestock", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@bookid", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = drpbooknm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@totalquantity", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txttotqun.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@stockid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Stock_id"].ToString();
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("data updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}

92

}
}
protectedvoid Grid_stock_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Stock_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editstock", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@stockid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
drpbooknm.SelectedItem.Text = red["Book_id"].ToString();
Txttotqun.Text = red["Tot_quantity"].ToString();

}
btnsave.Text = "Update";
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

SqlCommand cmd = newSqlCommand("SP_deletestock", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@stockid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_stock_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();

93

}
}
protectedvoid btnreset_Click(object sender, EventArgs e)

{
drpbooknm.SelectedIndex = 0;
Txttotqun.Text = "";
}
}

Courier coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;
publicpartialclassCourier : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();
}
}
publicvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("Sp_ReadCourier", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_courier.DataSource = cmd.ExecuteReader();
Grid_courier.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{

94

SqlCommand cmd = newSqlCommand("Sp_Insertcourier", con);


cmd.CommandType = CommandType.StoredProcedure;
openconn();

SqlParameter prm = newSqlParameter("@couriername", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtcouriernm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@deliverydate", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdlvrydt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@receivingdate", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtrecvngdt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@source", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtsource.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@destination", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdstntn.Text;
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updatecourier", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();

SqlParameter prm = newSqlParameter("@couriername", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtcouriernm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@deliverydate", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdlvrydt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@receivingdate", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtrecvngdt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@source", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtsource.Text;
cmd.Parameters.Add(prm);

95

prm = newSqlParameter("@destination", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtdstntn.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@courierid ", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Courier_id"].ToString();
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}

}
protectedvoid Grid_courier_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Courier_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editcourier", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@courierid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtcouriernm.Text = red["Courier_name"].ToString();
Txtdlvrydt.Text = red["Delivery_date"].ToString();
Txtrecvngdt.Text = red["Receiving_date"].ToString();
Txtsource.Text = red["Source"].ToString();
Txtdstntn.Text = red["Destination"].ToString();
}
btnsave.Text = "Updated";
closeconn();

SqlCommand cmd = newSqlCommand("SP_deletecourier", con);

96

}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@courierid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_courier_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtcouriernm.Text = "";
Txtdlvrydt.Text = "";
Txtrecvngdt.Text = "";
Txtdstntn.Text = "";
Txtsource.Text = "";
}
}
delivery status coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;

97

publicpartialclassAdmin_Customer : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();

bindcountry();
bindstate();
bindcity();
}
}
publicvoid bindcountry()
{
SqlCommand cmd = newSqlCommand("Sp_Readcountry", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpcntry.DataSource = cmd.ExecuteReader();
drpcntry.DataTextField = "Country_name";
drpcntry.DataValueField = "Country_id";
drpcntry.DataBind();
closeconn();
}
publicvoid bindstate()
{
SqlCommand cmd = newSqlCommand("SP_ReadState", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpstate.DataSource = cmd.ExecuteReader();
drpstate.DataTextField = "State_name";
drpstate.DataValueField = "State_id";
drpstate.DataBind();
closeconn();
}
publicvoid bindcity()
{
SqlCommand cmd = newSqlCommand("SP_ReadCity", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpcity.DataSource = cmd.ExecuteReader();
drpcity.DataTextField = "City_name";
drpcity.DataValueField = "City_id";
drpcity.DataBind();
closeconn();

}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_Readcoustomers", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_customer.DataSource = cmd.ExecuteReader();
Grid_customer.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();

if (btnsave.Text == "Save")
{

98

}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{

try
{
SqlCommand cmd = newSqlCommand("SP_Insertcoustomers", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@firstname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtfstnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@middlename", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtmdlnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@lastname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtlastnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@contectno", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntcno.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@emailid", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtemailid.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@address", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtadd.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@countryid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcntry.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@stateid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpstate.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@cityid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcity.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@zipcode", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtzipcode.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@dateofpurchase", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdop.Text;
cmd.Parameters.Add(prm);
string Stat = "";
if (Active.Checked)
Stat = "Yes";
else
Stat = "No.";

99

prm = newSqlParameter("@status", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Stat;
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updatecoustomers", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@firstname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtfstnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@middlename", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtmdlnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@lastname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtlastnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@contectno", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntcno.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@emailid", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtemailid.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@address", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtadd.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@countryid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcntry.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@stateid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpstate.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@zipcode", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtzipcode.Text;

100

prm = newSqlParameter("@cityid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpcity.SelectedValue.ToString();
cmd.Parameters.Add(prm);

cmd.Parameters.Add(prm);
prm = newSqlParameter("@dateofpurchase", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdop.Text;
cmd.Parameters.Add(prm);
string Stat = "";
if (Active.Checked)
Stat = "Yes";
else
Stat = "No.";
prm = newSqlParameter("@status", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Stat;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@customerid ", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Cust_id"].ToString();
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Customer updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtfstnm.Text = "";
Txtmdlnm.Text = "";
Txtlastnm.Text = "";
Txtcntcno.Text = "";
Txtemailid.Text = "";
Txtadd.Text = "";
drpcntry.SelectedIndex = 0;
drpstate.SelectedIndex = 0;
drpcity.SelectedIndex = 0;
Txtzipcode.Text = "";
Txtdop.Text = "";
Active.Text = "";
}
protectedvoid Grid_customer_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Cust_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editcoustomers", con);


cmd.CommandType = CommandType.StoredProcedure;

101

SqlParameter prm = newSqlParameter("@customerid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtfstnm.Text = red["First_name"].ToString();
Txtmdlnm.Text = red["Middle_name"].ToString();
Txtlastnm.Text = red["Last_name"].ToString();
Txtcntcno.Text = red["Contect_no"].ToString();
Txtemailid.Text = red["Email_id"].ToString();
Txtadd.Text = red["Address"].ToString();
drpcntry.SelectedItem.Text = red["Country_id"].ToString();
drpstate.SelectedItem.Text = red["State_id"].ToString();
drpcity.SelectedItem.Text = red["City_id"].ToString();
Txtzipcode.Text = red["Zip_code"].ToString();
Txtdop.Text = red["Date_of_purchase"].ToString();

}
btnsave.Text = "Update";
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

SqlCommand cmd = newSqlCommand("SP_deletecoustomers", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@coustomerid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}

}
protectedvoid Grid_customer_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();

lnkdelete.CommandArgument = e.Row.RowIndex.ToString();

102

Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");

}
}
}
Order Master coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;
publicpartialclassAdmin_OrderMaster : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();

}
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_Readordermaster", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_ordrmaster.DataSource = cmd.ExecuteReader();
Grid_ordrmaster.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}

SqlParameter prm = newSqlParameter("@orderdate", SqlDbType.DateTime);

103

protectedvoid btnsave_Click(object sender, EventArgs e)


{
if (btnsave.Text == "Save")
{
try
{
SqlCommand cmd = newSqlCommand("SP_Insertordermaster", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();

prm.Direction = ParameterDirection.Input;
prm.Value = Txtordrdt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@description", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdscpsn.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@totalquantity", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = Txttotqun.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@stockid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpstocknm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("OrderMaster register");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updateordermaster", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@orderdate", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtordrdt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@description", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdscpsn.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@totalquantity", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = Txttotqun.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@stockid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpstocknm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

104

prm = newSqlParameter("@orderid ", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Order_id"].ToString();
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("OrderMaster update");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtordrdt.Text = "";
Txtdscpsn.Text = "";
Txttotqun.Text = "";
drpstocknm.SelectedIndex = 0;
}
protectedvoid Grid_ordrmaster_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Order_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editordermaster", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@orderid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtordrdt.Text = red["Order_date"].ToString();
Txtdscpsn.Text = red["Description"].ToString();
Txttotqun.Text = red["Tot_quntity"].ToString();
drpstocknm.SelectedItem.Text = red["Stock_id"].ToString();

}
btnsave.Text = "Update";
closeconn();

SqlCommand cmd = newSqlCommand("SP_deleteordermaster", con);

105

}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@orderid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
protectedvoid Grid_ordrmaster_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
}
Order detail coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;
publicpartialclassOrederDetail : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();
bindbook();
}

106

}
protectedvoid bindbook()
{
SqlCommand cmd = newSqlCommand("SP_ReadBooks", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpbooknm.DataSource = cmd.ExecuteReader();
drpbooknm.DataTextField = "Book_name";

drpbooknm.DataValueField = "Book_id";
drpbooknm.DataBind();
closeconn();
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_Readorderdetail", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_orderdetail.DataSource = cmd.ExecuteReader();
Grid_orderdetail.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{

SqlCommand cmd = newSqlCommand("SP_Insertorderdetail", con);


cmd.CommandType = CommandType.StoredProcedure;
openconn();

SqlParameter prm = newSqlParameter("@bookid", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = drpbooknm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@totalquantity", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = Txttotqun.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@price", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtprice.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@totalamount", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txttotamnt.Text;
cmd.Parameters.Add(prm);

107

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updateorderdetail", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();

SqlParameter prm = newSqlParameter("@bookid", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = drpbooknm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@totalquantity", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = Txttotqun.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@price", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtprice.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@totalamount", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txttotamnt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@orderid ", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Order_id"].ToString();
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}
}
protectedvoid Grid_orderdetail_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Order_id"] = id;

SqlParameter prm = newSqlParameter("@orderid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();

108

SqlCommand cmd = newSqlCommand("SP_editorderdetail", con);


cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
drpbooknm.SelectedItem.Text = red["Book_id"].ToString();
Txttotqun.Text = red["Tot_quantity"].ToString();
Txtprice.Text = red["Price"].ToString();
Txttotamnt.Text = red["Total_amount"].ToString();
}
btnsave.Text = "Updated";
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

SqlCommand cmd = newSqlCommand("SP_deleteorderdetail", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@orderid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_orderdetail_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}

109

}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
drpbooknm.SelectedIndex = 0;
Txttotqun.Text = "";
Txtprice.Text = "";
Txttotamnt.Text = "";
}
}

Payment coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;
publicpartialclassPayment : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();
bindcustomer();
bindcourier();
bindbook();
}

110

}
protectedvoid bindcustomer()
{
SqlCommand cmd = newSqlCommand("SP_Readcoustomers", con);
cmd.CommandType = CommandType.StoredProcedure;
opneconn();
drpcstmrnm.DataSource = cmd.ExecuteReader();
drpcstmrnm.DataTextField = "Cust_id";
drpcstmrnm.DataBind();
closeconn();
}
protectedvoid bindcourier()
{
SqlCommand cmd = newSqlCommand("Sp_ReadCourier", con);
cmd.CommandType = CommandType.StoredProcedure;
opneconn();
drpcouriernm.DataSource = cmd.ExecuteReader();
drpcouriernm.DataTextField = "Courier_name";
drpcouriernm.DataValueField = "Courier_id";
drpcouriernm.DataBind();
closeconn();
}
protectedvoid bindbook()
{
SqlCommand cmd = newSqlCommand("SP_ReadBooks", con);
cmd.CommandType = CommandType.StoredProcedure;
opneconn();
drpbooknm.DataSource = cmd.ExecuteReader();
drpbooknm.DataTextField = "Book_name";
drpbooknm.DataValueField = "Book_id";
drpbooknm.DataBind();
closeconn();
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_Readpayment", con);
cmd.CommandType = CommandType.StoredProcedure;
opneconn();
Grid_payment.DataSource = cmd.ExecuteReader();

Grid_payment.DataBind();
closeconn();
}
protectedvoid opneconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{

SqlCommand cmd = newSqlCommand("SP_Isertpayment", con);


cmd.CommandType = CommandType.StoredProcedure;
opneconn();

SqlParameter prm = newSqlParameter("@paymenttype", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtpymnttyp.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@totalpayment", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = TxtTotpymnt.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@bankname", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtbanknm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@branchname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtbrnchnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@dateofpayment", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdop.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@cheqedate", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtchqdt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@chequeno", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtchqno.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@courierid", SqlDbType.Int);

111

prm = newSqlParameter("@customerid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpcstmrnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm.Direction = ParameterDirection.Input;
prm.Value = drpcouriernm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@bookid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpbooknm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updatepayment", con);
cmd.CommandType = CommandType.StoredProcedure;
opneconn();

SqlParameter prm = newSqlParameter("@paymenttype", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtpymnttyp.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@totalpayment", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = TxtTotpymnt.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@bankname", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtbanknm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@branchname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtbrnchnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@dateofpayment", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtdop.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@cheqedate", SqlDbType.DateTime);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtchqdt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@chequeno", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtchqno.Text;
cmd.Parameters.Add(prm);

112

prm = newSqlParameter("@customerid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpcstmrnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@courierid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpcouriernm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@bookid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpbooknm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@slipno ", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Slip_no"].ToString();
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}
}
protectedvoid Grid_payment_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Slip_no"] = id;

SqlCommand cmd = newSqlCommand("SP_editpayment", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@slipno", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

opneconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtpymnttyp.Text = red["payment_type"].ToString();
TxtTotpymnt.Text = red["Total_payment"].ToString();
Txtbanknm.Text = red["Bank_name"].ToString();
Txtbrnchnm.Text = red["Branch_name"].ToString();
Txtdop.Text = red["Date_of_payment"].ToString();
Txtchqdt.Text = red["Cheque_date"].ToString();
Txtchqno.Text = red["Cheque_No"].ToString();
drpcstmrnm.SelectedItem.Text = red["Cust_Id"].ToString();
drpcouriernm.SelectedItem.Text = red["Courier_id"].ToString();
drpbooknm.SelectedItem.Text = red["Book_id"].ToString();

113

}
btnsave.Text = "Updated";
closeconn();

catch (Exception ex)


{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

SqlCommand cmd = newSqlCommand("SP_deletepayment", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@slipno", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
opneconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_payment_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtpymnttyp.Text = "";
TxtTotpymnt.Text = "";
Txtbanknm.Text = "";
Txtbrnchnm.Text = "";
Txtdop.Text = "";
Txtchqdt.Text = "";
Txtchqno.Text = "";
drpcstmrnm.SelectedIndex = 0;
drpcouriernm.SelectedIndex = 0;
drpbooknm.SelectedIndex = 0;
}
}

114

publication coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;

using
using
using
using

System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Data.SqlClient;
LeeGunn.Web.UI.MessageBox;

publicpartialclassAdmin_Publication : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();
bindcategory();
}
}
protectedvoid bindcategory()
{
SqlCommand cmd = newSqlCommand("SP_ReadCategorys", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpcatnm.DataSource = cmd.ExecuteReader();
drpcatnm.DataTextField = "Cate_name";
drpcatnm.DataValueField = "Cate_id";
drpcatnm.DataBind();
closeconn();
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_Readpublication", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_publication.DataSource = cmd.ExecuteReader();
Grid_publication.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{
SqlCommand cmd = newSqlCommand("SP_Insertpublication", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();

prm = newSqlParameter("@publicationname", SqlDbType.VarChar);

115

SqlParameter prm = newSqlParameter("@categoryid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpcatnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm.Direction = ParameterDirection.Input;
prm.Value = Txtpublctnnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@price", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtprice.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@address", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtadd.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@emailid", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtemailid.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@contectno", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntcno.Text;
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updatepublication", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();

SqlParameter prm = newSqlParameter("@categoryid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpcatnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@publicationname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtpublctnnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@price", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtprice.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@address", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtadd.Text;
cmd.Parameters.Add(prm);

116

prm = newSqlParameter("@emailid", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtemailid.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@contectno", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntcno.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@publicationid ", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Pub_id"].ToString();
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}

}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
drpcatnm.SelectedIndex = 0;
Txtpublctnnm.Text = "";
Txtprice.Text = "";
Txtadd.Text = "";
Txtemailid.Text = "";
Txtcntcno.Text = "";
}
protectedvoid Grid_publication_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Pub_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editpublication", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@publicationid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

117

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
drpcatnm.SelectedItem.Text = red["cate_id"].ToString();
Txtpublctnnm.Text = red["Pub_name"].ToString();
Txtprice.Text = red["price"].ToString();
Txtadd.Text = red["Address"].ToString();
Txtemailid.Text = red["Email_id"].ToString();
Txtcntcno.Text = red["Contect_no"].ToString();

btnsave.Text = "Updated";
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

SqlCommand cmd = newSqlCommand("SP_deletepublication", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@publicationid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_publication_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
}
Purchase detail coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;

118

publicpartialclassAdmin_Purchase : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindorder();
bindcustomer();
bindsupplier();
bindgrid();
}
}
publicvoid bindorder()
{
SqlCommand cmd = newSqlCommand("SP_Readordermaster", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpordernm.DataSource = cmd.ExecuteReader();
drpordernm.DataValueField = "Order_id";
drpordernm.DataBind();
closeconn();
}
publicvoid bindcustomer()
{
SqlCommand cmd = newSqlCommand("SP_Readcoustomers", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpcstmrnm.DataSource = cmd.ExecuteReader();
drpcstmrnm.DataValueField = "Cust_id";
drpcstmrnm.DataBind();
closeconn();
}
publicvoid bindsupplier()
{
SqlCommand cmd = newSqlCommand("SP_Readsupplier", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpsplrnm.DataSource = cmd.ExecuteReader();
//drpsplrnm.DataTextField = "Sup_name";
drpsplrnm.DataValueField = "Sup_id";
drpsplrnm.DataBind();
closeconn();
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_Readpurchase", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_purchase.DataSource = cmd.ExecuteReader();
Grid_purchase.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();

119

}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")

{
try
{
SqlCommand cmd = newSqlCommand("SP_Insertpurchase");
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@purchasename", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtprchsnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@orderid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpordernm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@totalpayment", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = Txttotpymnt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@totalquantity", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txttotqun.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@customerid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpcstmrnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@supplierid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpsplrnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@dateofpurchase", SqlDbType.DateTime);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtdop.Text;
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updatepurchase");
cmd.CommandType = CommandType.StoredProcedure;
openconn();

120

SqlParameter prm = newSqlParameter("@purchasename", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtprchsnm.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@orderid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpordernm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@totalpayment", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = Txttotpymnt.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@totalquantity", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txttotqun.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@customerid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpcstmrnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@supplierid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drpsplrnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@dateofpurchase", SqlDbType.DateTime);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtdop.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@purchaseid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Pur_id"].ToString();
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

}
}
}

protectedvoid Grid_purchase_RowCommand(object sender, GridViewCommandEventArgs e)


{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

121

ViewState["Pur_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editpurchase", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@purchaseid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtprchsnm.Text = red["Pur_name"].ToString();
drpsplrnm.SelectedItem.Text = red["Order_id"].ToString();
Txttotpymnt.Text = red["Tot_payment"].ToString();
Txttotqun.Text = red["Tot_quantity"].ToString();
drpcstmrnm.SelectedItem.Text = red["Cus_id"].ToString();
drpsplrnm.SelectedItem.Text = red["Sup_id"].ToString();
Txtdop.Text = red["Date_Of_purchase"].ToString();

}
btnsave.Text = "Update";
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

SqlCommand cmd = newSqlCommand("SP_deletepurchase", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@purchaseid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_purchase_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();

lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}

122

Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");

}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtprchsnm.Text = "";
drpordernm.SelectedIndex = 0;
Txttotpymnt.Text = "";
Txttotqun.Text = "";
drpcstmrnm.SelectedIndex = 0;
drpsplrnm.SelectedIndex = 0;
Txtdop.Text = "";
}
}
state coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;
publicpartialclassAdmin_state : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();
bindcountry();
}

123

}
publicvoid bindcountry()
{
SqlCommand cmd = newSqlCommand("Sp_Readcountry", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpcntrynm.DataSource = cmd.ExecuteReader();
drpcntrynm.DataTextField = "Country_name";
drpcntrynm.DataValueField = "Country_id";
drpcntrynm.DataBind();
closeconn();
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_ReadState", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_state.DataSource = cmd.ExecuteReader();
Grid_state.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()

{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{

SqlCommand cmd = newSqlCommand("SP_InsertState", con);


cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@statename", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtstatenm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@countryid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcntrynm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data Saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updateState", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@statename", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtstatenm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@countryid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcntrynm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@stateid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["State_id"].ToString();
cmd.Parameters.Add(prm);

cmd.ExecuteNonQuery();

124

closeconn();
MessageBox.Show("Data updated");
bindgrid();

catch (Exception ex)


{
MessageBox.Show(ex.Message.ToString());
}
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtstatenm.Text = "";
drpcntrynm.SelectedIndex = 0;
}
protectedvoid Grid_state_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["State_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editState", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@stateid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtstatenm.Text = red["State_name"].ToString();
drpcntrynm.SelectedItem.Text = red["Country_id"].ToString();

}
btnsave.Text = "Updated";
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

125

SqlCommand cmd = newSqlCommand("SP_deleteState", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@stateid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
bindgrid();
closeconn();

}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_state_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
}
Subject coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;
publicpartialclassAdmin_Subject : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
bindgrid();
bindpublication();
}
}
protectedvoid bindpublication()
{
SqlCommand cmd = newSqlCommand("SP_Readpublication", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drppubnm.DataSource = cmd.ExecuteReader();
drppubnm.DataValueField = "Pub_id";
drppubnm.DataBind();
closeconn();

126

}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_Readsubject", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_subject.DataSource = cmd.ExecuteReader();

Grid_subject.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{
SqlCommand cmd = newSqlCommand("SP_Insertsubject", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@subjectname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtsubnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@authorname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtauthrnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@publicationid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drppubnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data Saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
else
{
try
{
SqlCommand cmd = newSqlCommand("SP_updatesubject", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@subjectname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtsubnm.Text;
cmd.Parameters.Add(prm);

127

prm = newSqlParameter("@authorname", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtauthrnm.Text;
cmd.Parameters.Add(prm);

prm = newSqlParameter("@publicationid", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = drppubnm.SelectedValue.ToString();
cmd.Parameters.Add(prm);

prm = newSqlParameter("@subjectid ", SqlDbType.Int);


prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Sub_id"].ToString();
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data updated");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
protectedvoid Grid_subject_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Sub_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editsubject", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@subjectid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtsubnm.Text = red["Sub_name"].ToString();
Txtauthrnm.Text = red["Author_name"].ToString();
drppubnm.SelectedItem.Text = red["Pub_id"].ToString();

}
btnsave.Text = "Updated";
closeconn();

128

}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

SqlCommand cmd = newSqlCommand("SP_deletesubject", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@subjectid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}

}
protectedvoid Grid_subject_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtsubnm.Text = "";
Txtauthrnm.Text = "";
drppubnm.SelectedIndex = 0;
btnsave.Text = "Save";
}
}
Supplier coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using LeeGunn.Web.UI.MessageBox;

con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());

129

publicpartialclassAdmin_Supplier : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{

bindgrid();
bindcountry();
bindstate();
bindcity();
}
}
protectedvoid bindcountry()
{
SqlCommand cmd = newSqlCommand("Sp_Readcountry", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpcntry.DataSource = cmd.ExecuteReader();
drpcntry.DataTextField = "Country_name";
drpcntry.DataValueField = "Country_id";
drpcntry.DataBind();
closeconn();

SqlCommand cmd = newSqlCommand("SP_Insertsupplier", con);


cmd.CommandType = CommandType.StoredProcedure;
openconn();

130

}
protectedvoid bindstate()
{
SqlCommand cmd = newSqlCommand("SP_ReadState", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpstate.DataSource = cmd.ExecuteReader();
drpstate.DataTextField = "State_name";
drpstate.DataValueField = "State_id";
drpstate.DataBind();
closeconn();
}
protectedvoid bindcity()
{
SqlCommand cmd = newSqlCommand("SP_ReadCity", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
drpcity.DataSource = cmd.ExecuteReader();
drpcity.DataTextField = "City_name";
drpcity.DataValueField = "City_id";
drpcity.DataBind();
closeconn();
}
protectedvoid bindgrid()
{
SqlCommand cmd = newSqlCommand("SP_Readsupplier", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
Grid_supplier.DataSource = cmd.ExecuteReader();
Grid_supplier.DataBind();
closeconn();
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid btnsave_Click(object sender, EventArgs e)
{
if (btnsave.Text == "Save")
{
try
{

SqlParameter prm = newSqlParameter("@suppliername", SqlDbType.VarChar);


prm.Direction = ParameterDirection.Input;
prm.Value = Txtsplrnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@contectpersonname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntctprsnnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@address", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtadd.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@contectno", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntctno.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@mobileno", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtmobno.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@emailid", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtemailid.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@gender", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = RadioButtonList1.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@countryid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcntry.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@stateid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpstate.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@cityid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcity.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@zipcode", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtzipcode.Text;
cmd.Parameters.Add(prm);
cmd.ExecuteNonQuery();
closeconn();
MessageBox.Show("Data Saved");
bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());

else
{

131

}
}

try
{
SqlCommand cmd = newSqlCommand("SP_updatesupplier", con);
cmd.CommandType = CommandType.StoredProcedure;
openconn();
SqlParameter prm = newSqlParameter("@suppliername", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtsplrnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@contectpersonname", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntctprsnnm.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@address", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtadd.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@contectno", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtcntctno.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@mobileno", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtmobno.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@emailid", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtemailid.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@gender", SqlDbType.VarChar);
prm.Direction = ParameterDirection.Input;
prm.Value = RadioButtonList1.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@countryid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcntry.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@stateid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpstate.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@cityid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = drpcity.SelectedValue.ToString();
cmd.Parameters.Add(prm);
prm = newSqlParameter("@zipcode", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = Txtzipcode.Text;
cmd.Parameters.Add(prm);
prm = newSqlParameter("@supplierid ", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = ViewState["Sup_id"].ToString();
cmd.Parameters.Add(prm);

closeconn();
MessageBox.Show("Data updated");

132

cmd.ExecuteNonQuery();

bindgrid();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
protectedvoid Grid_supplier_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "Edits")
{
try
{

ViewState["Sup_id"] = id;

SqlCommand cmd = newSqlCommand("SP_editsupplier", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@supplierid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();
cmd.Parameters.Add(prm);

openconn();
SqlDataReader red;
red = cmd.ExecuteReader();
while (red.Read())
{
Txtsplrnm.Text = red["Sup_name"].ToString();
Txtcntctprsnnm.Text = red["ContectPerson_name"].ToString();
Txtadd.Text = red["Address"].ToString();
Txtcntctno.Text = red["Contect_no"].ToString();
Txtmobno.Text = red["Mobile_no"].ToString();
Txtemailid.Text = red["Email_id"].ToString();
RadioButtonList1.Text = red["Gender"].ToString();
drpcntry.SelectedItem.Text = red["Country_id"].ToString();
drpstate.SelectedItem.Text = red["State_id"].ToString();
drpcity.SelectedItem.Text = red["City_id"].ToString();
Txtzipcode.Text = red["Zip_code"].ToString();

}
btnsave.Text = "Updated";
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
if (e.CommandName == "Deletes")
{
try
{

133

SqlCommand cmd = newSqlCommand("SP_deletesupplier", con);


cmd.CommandType = CommandType.StoredProcedure;
SqlParameter prm = newSqlParameter("@supplierid", SqlDbType.Int);
prm.Direction = ParameterDirection.Input;
prm.Value = id.ToString();

cmd.Parameters.Add(prm);
openconn();
cmd.ExecuteNonQuery();
cmd.Dispose();
MessageBox.Show("Data deleted");
bindgrid();
closeconn();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
bindgrid();
}
}
protectedvoid Grid_supplier_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button lnkedit = (Button)e.Row.FindControl("lnkedit");
lnkedit.CommandArgument = e.Row.RowIndex.ToString();
Button lnkdelete = (Button)e.Row.FindControl("lnkdelete");
lnkdelete.CommandArgument = e.Row.RowIndex.ToString();
}
}
protectedvoid btnreset_Click(object sender, EventArgs e)
{
Txtsplrnm.Text = "";
Txtcntctprsnnm.Text = "";
Txtadd.Text = "";
Txtcntctno.Text = "";
Txtmobno.Text = "";
Txtemailid.Text = "";
RadioButtonList1.Text = "";
drpcntry.SelectedIndex = 0;
drpstate.SelectedIndex = 0;
drpcity.SelectedIndex = 0;
Txtzipcode.Text = "";
}
}
Subcategory coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;

134

publicpartialclassclient_welcome : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
string strg = "select Cate_id, Cate_name from Category";
SqlCommand cmd = newSqlCommand(strg, con);
openconn();

SqlDataReader dr = cmd.ExecuteReader();
DataList1.DataSource = dr;
DataList1.DataBind();
dr.Close();
cmd.Dispose();
closeconn();
}
}
protectedvoid openconn()
{
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid DataList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protectedvoid DataList1_SelectedIndexChanged1(object sender, EventArgs e)
{
Response.Redirect("Category.aspx");
}
protectedvoid DataList1_ItemCreated(object sender, DataListItemEventArgs e)
{
}
protectedvoid DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "view")
{
Label category = (Label)e.Item.FindControl("lblid");
string query = "";
query += "CategoryId=" + category.Text + "";
Response.Redirect("Publication.aspx?Category=" + category.Text);
}
}
}
bookPublicatin detail coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;

135

publicpartialclassclient_subcategory : System.Web.UI.Page
{
publicstaticSqlConnection con;
publicstaticString str1;
protectedvoid Page_Load(object sender, EventArgs e)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
str1 = Convert.ToString(Request.QueryString["Category"]);

string strg = "select c.Cate_id,c.Cate_name,p.Pub_name,p.pub_id from Category c, Publication p


where c.Cate_id=p.Cate_id and p.cate_id='" + str1 + "'";
SqlCommand cmd = newSqlCommand(strg, con);
openconn();
SqlDataReader dr = cmd.ExecuteReader();
DataList1.DataSource = dr;
DataList1.DataBind();
dr.Close();
cmd.Dispose();
closeconn();
}
protectedvoid openconn()
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid DataList1_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect("book.aspx");
}
protectedvoid DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "view")
{
//Label Publication = (Label)e.Item.FindControl("lblpublicationid");
//string query = "";
//query += "CategoryId=" + Publication.Text + "";
Response.Redirect("book.aspx?Publication=" + str1);
}
}
}
Book detail coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
publicpartialclassclient_book : System.Web.UI.Page
{
publicstaticSqlConnection con;
publicstaticstring str1;
protectedvoid Page_Load(object sender, EventArgs e)
{

136

if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
str1 = Request.QueryString["Publication"].ToString();

string
strg
=
"select
b.Book_id,b.Book_name,b.ImageName,b.Pub_id,b.Status
,c.Cate_id,c.Cate_name,p.Pub_id,p.price
from
Book
b,Category
c,Publication
p
where
c.Cate_id=p.cate_id and b.Cat_id=c.Cate_id and b.Cat_id='" + str1 + "'";
SqlCommand cmd = newSqlCommand(strg, con);
opneconn();
SqlDataReader dr = cmd.ExecuteReader();
DataList2.DataSource = dr;
DataList2.DataBind();
dr.Close();
cmd.Dispose();
closeconn();

}
}
protectedvoid opneconn()
{
if (con.State == System.Data.ConnectionState.Open)
{
con.Close();
}
con.Open();
}
protectedvoid closeconn()
{
con.Close();
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
// Response.Redirect("OrderDetail.aspx");
}
protectedvoid DataList2_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "View")
{
Label publication = (Label)e.Item.FindControl("lblpublicationid");
string query="";
query += "publicationid=" + publication.Text + "";
Response.Redirect("OrderDetail.aspx?publicationid=" + publication.Text);
}
}
protectedvoid DataList2_SelectedIndexChanged(object sender, EventArgs e)
{
// Response.Redirect("OrderDetail.aspx");
}
}

publicpartialclassAdmin_Bookwisereport : System.Web.UI.Page
{
publicstaticSqlConnection con;

137

Bookwise report coding c#


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

protectedvoid Page_Load(object sender, EventArgs e)


{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
con.Open();
bindtempbook();
}
}
protectedvoid bindgride()
{
}
protectedvoid bindtempbook()
{
SqlCommand cmd;
cmd = newSqlCommand("select Serial_no,book_name from Tempbook", con);
cmd.CommandType = CommandType.Text;
SqlDataReader red = cmd.ExecuteReader();
DropDownList1.DataSource = red;
DropDownList1.DataTextField = "book_name";
DropDownList1.DataBind();
red.Close();
cmd.Dispose();
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = newSqlCommand("Select
book_name,Quantity,price,Tot_amount from Tempbook where
book_name='"+DropDownList1.SelectedItem.Text+"'", con);
SqlDataReader red = cmd.ExecuteReader();
GridView1.DataSource = red;
GridView1.DataBind();
red.Close();
cmd.Dispose();
}
}
Category wise report coding c#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

}
}

138

publicpartialclassCategorywisereport : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
con.Open();
bindtempcategory();

protectedvoid bindtempcategory()
{
SqlCommand cmd;
cmd = newSqlCommand("select Serial_no,Category_Name from tempcategory", con);
cmd.CommandType = CommandType.Text;
SqlDataReader red = cmd.ExecuteReader();
drpcatnm.DataSource = red;
drpcatnm.DataTextField = "Category_Name";
drpcatnm.DataBind();
red.Close();
cmd.Dispose();
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
SqlCommand
cmd
=
newSqlCommand("Select
Category_Name,Quantity,price,Tot_quantity
tempcategory where Category_Name='" + drpcatnm.SelectedItem.Text + "'", con);
SqlDataReader red = cmd.ExecuteReader();
GridView1.DataSource = red;
GridView1.DataBind();
red.Close();
cmd.Dispose();
}
}

from

Deaily Report coding c#


using
using
using
using
using
using
using
using
using
using
using
using
using

System;
System.Collections;
System.Configuration;
System.Data;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
System.Data.SqlClient;

publicpartialclassAdmin_Dailyreport : System.Web.UI.Page
{
publicstaticSqlConnection con;
protectedvoid Page_Load(object sender, EventArgs e)
{
con
=
newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myproject_con"].ToS
tring());
con.Open();
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = newSqlCommand("Select * from OrderMaster where Order_date='" + Txtordrdt.Text +
"'", con);
SqlDataReader red = cmd.ExecuteReader();
GridView1.DataSource = red;
GridView1.DataBind();
red.Close();
cmd.Dispose();
}
}

139

11.2 Code Efficiency :Efficiency is the amount of computing resources and code required by a program to
perform its functions. Efficient codes are required for the better performance of the
system. Efficient coding makes a system robust. A method is robust if it does not fail
even if it receives improper parameters. Robustness against internal bugs may be trade
off against efficiency.
The need for efficiency arises due to the cost of consideration. If some resources are
scarce and expensive, it is desirable that those resources should be used efficiently. In
the computer system the resources the most often considered for efficiency are
processor time and less memory. This coding for the system has been started after
completing the design phase, because all software methodologies emphasize the
importance of first designing then coding. The codes that construct this system are
structured, modular, efficient, and require less amount of computing resources.
All functions of this system are understandable since the functions are small and
coherent. Functions and variables are meaningful variable names to increase the
readability and avoided abbreviations that may confuse the users.
In order to execute the database queries faster used the following methods. During the
retrieval of data from the database using SELECT statement all the known conditions
are specified in the WHERE clause.
If we want to find the maximum, minimum, sum and average value or the count of a
database column, use a Select list with aggregate functions instead of computing the
aggregates within the program. The RDBMS is responsible for aggregated
computations instead of transferring large amount of data to the application. Overall
network, application server and database load is also considerably less. Simplicity and
clarity are the main properties of the coding.

11.3 Code Optimization :

140

If coding is done efficiently then 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 occurr.
The most usage of any function can also be cleared prior to making
them, then only one can develop the general purpose code which
can be said as optimization of code. So ultimately code must be
reusable.

Second is, Modularization i.e. most important thing for optimization.


If total code is distributed in proper modules prior to start of the
actual coding then its a better way of coding. General Module i.e.
Standard Module is used.

Third thing is capabilities; utilities and facilities which are provided


by language or tool or environment in which the programmer is
developing the code must be properly known.
MDI is used so, automatically it optimizes the code.
The Optimization goal is achieved by combining the OCX and MDI.

141

[12]
Testing

142

Testing :Testing Strategies


Testing is involved in every stage of software life cycle, but the testing done at each
level of software development is different in nature and has different objectives.
Unit Testing is done at the lowest level. It tests the basic unit of software, which is the
smallest testable piece of software, and is often called unit, module, or component
interchangeably.
Integration Testing is performed when two or more tested units are combined into a
larger structure. The test is often done on both the interfaces between the components
and the larger structure being constructed, if its quality property cannot be assessed
from its components.
System Testing tends to affirm the end-to-end quality of the entire system.
System test is often based on the functional/requirement specification of the system.
Non-functional quality attributes, such as reliability, security, and maintainability, are
also checked.
Acceptance Testing is done when the completed system is handed over from the
developers to the customers or users. The purpose of acceptance testing is rather to
give confidence that the system is working than to find errors.
Based on the testing information flow, a testing technique specifies the strategy used in
testing to select input test cases and analyze test results. Different techniques reveal
different quality aspects of a software system, and there are
two major categories of testing techniques, functional and structural.
Functional Testing: the software program or system under test is viewed as a black
box. The selection of test cases for functional testing is based on the requirement or
design specification of the software entity under test. Examples of expected results,
some times are called test oracles, include requirement/design specifications, hand
calculated values, and simulated results. Functional testing emphasizes on the external
behavior of the software entity.
Structural Testing: the software entity is viewed as a white box. The selection of test
cases is based on the implementation of the software entity. The goal of selecting such
test cases is to cause the execution of specific spots in the software entity, such as
specific statements, program branches or paths. The expected results are evaluated on
a set of coverage criteria. Examples of coverage criteria include path coverage, branch
coverage, and data-flow coverage. Structural testing emphasizes on the internal
structure of the software entity.

Error Handling Testing

143

Error handling refers to the anticipation, detection, and resolution of programming,


application, and communications errors. Specialized programs, called error handlers,
are available for some applications. The best programs of this type forestall errors if
possible, recover from them when they occur without terminating the application, or (if

all else fails) gracefully terminate an affected application and save the error information
to a log file.

Create a set of erroneous transactions and enter them into the application
system then find out whether the system is able to identify the problems.

Using iterative testing enters transactions and trap errors. Correct them. Then
enter transactions with errors, which were not present in the system earlier.
In programming, a development error is one that can be prevented. Such an error can
occur in syntax or logic. Syntax errors, which are typographical mistakes or improper
use of special characters, are handled by rigorous proofreading.
A run-time error takes place during the execution of a program, and usually happens
because of adverse system parameters or invalid input data. An example is the lack of
sufficient memory to run an application or a memory conflict with another program. On
the Internet, run-time errors can result from electrical noise, various forms of malware or
an exceptionally heavy demand on a server. Run-time errors can be resolved, or their
impact minimized, by the use of error handler programs, by vigilance on the part of
network and server administrators, and by reasonable security countermeasures on the
part of Internet users.

Black box testing


It takes an external perspective of the test object to derive test cases. These tests can
be functional or non-functional, though usually functional. The test designer selects valid
and invalid input and determines the correct output. There is no knowledge of the test
object's internal structure.
This method of test design is applicable to all levels of software testing: unit, integration,
functional testing, system and acceptance. The higher the level, an hence the bigger
and more complex the box, the more one is forced to use black box testing to simplify.
While this method can uncover unimplemented parts of the specification, one cannot be
sure that all existent paths are tested.
this technique, we do not use the code to determine a test suite; rather, knowing the
problem that we're trying to solve, we come up with four types of test data:
1. Easy-to-compute data
2. Typical data
3. Boundary / extreme data
4. Bogus data

White Box

144

White box testing is a security testing method that can be used to validate whether code
implementation follows intended design, to validate implemented security functionality,
and to uncover exploitable vulnerabilities.
White box testing requires knowing what makes software secure or insecure, how to
think like an attacker, and how to use different testing tools and techniques. The first
step in white box testing is to comprehend and analyze source code, so knowing what
makes software secure is a fundamental requirement. Second, to create tests that
exploit software, a tester must think like an attacker. Third, to perform testing effectively,
testers need to know the different tools and techniques available for white box testing.
The three requirements do not work in isolation, but together.

Unit testing
In computer programming, unit testing is a procedure used to validate that individual
units of source code are working properly. A unit is the smallest testable part of an
application. In procedural programming a unit may be an individual program, function,
procedure, etc., while in object-oriented programming, the smallest unit is a method;
which may belong to a base/super class, abstract class or derived/child class.
Ideally, each test case is independent from the others; mock objects and test harnesses
can be used to assist testing a module in isolation. Unit testing is typically done by
developers and not by Software testers or end-users.

Performance Testing
System performance is generally assessed in terms of response time and throughput
rates under differing processing and configuration conditions. To attack the performance
problems, there are several questions should be asked first:
How much application logic should be remotely executed?
How much updating should be done to the database server over the network
from the client workstation?
How much data should be sent to each in each transaction?
Performance testing can verify that a system meets the specifications claimed by its
manufacturer or vendor. The process can compare two or more devices or programs in
terms of parameters such as speed, data transfer rate, bandwidth, throughput,
efficiency or reliability.
Slow data transfer rate may be inherent in hardware but can also result from softwarerelated problems, such as:
Too many applications running at the same time
A corrupted file in a Web browser
A security exploit
Heavy-handed antivirus software
The existence of active malware on the hard disk.
Effective performance testing can quickly identify the nature or location of a softwarerelated performance problem.

145

Test case Design


Test Case No.
Test Phase
Functionality
Environment

TC-01
:
:
:

Procedure

Expected
Outcome

Test Case No.


Test Phase
Functionality
Environment

TC-02
:
:
:

Procedure

Unit Test
Add new user information to the database.
Add New User option from the home page
accessible by the user.
1. Input user information such as Uesr name, type,
address, contact no, email etc
2. Click on Submit button. 3. A confirm message
will appear. Click Ok button to store
the entered user information in the database.
The information relating to the newly added user
should be displayed in the User Information page
by the admin.

Unit Test
Display book information
Homepage
1. Check books
homepage.

and

categories

section

in

2. Click on any links on books and category name


which will open details of books/category
Expected
Outcome

Books/Category information should be display on


the screen with appropriate list

146

Test Case No.


Test Phase
Functionality
Environment

TC-03
:
:
:

Procedure

Expected
Outcome

Test Case No.


Test Phase
Functionality
Environment

TC-04
:
:
:

Procedure

1.
2.
3.
4.

Expected
Outcome

1. Output cart with user added books image,


name and price multiplied with quantity and
grand total of the cart
2. In the top corner displays number of books
added and grand total price of the cart

Unit Test
Login/User registration
Login page
1. Create test user account
2. Login using the same test account
credential
3. Use mismatched credentials for test the
validation
1. If the user credentials are match with DB,
redirects to user account page
2. If test account user credentials are wrong,
output invalid message
3. For registration, all input values should be
validated such as phone no, email id should be in
format

Unit Test
Shopping cart
Main page, shopping cart page
Click on Add to Cart button
Add more products/books to cart
Open the cart page and test
Check the top box which displays number of
books added to cart and quantity

147

Test Reports
Test Case
Date
No

Pass/Fail

Comments

TC-01

12-Jan-13

PASS

The information relating to the newly added user


should be displayed in the User Information page
by the admin.

TC-02

23-Jan-13

PASS

Books/Category information should be display on


the screen with appropriate list

PASS

1. If the user credentials are match with DB,


redirects
to
user
account
page
2. If test account user credentials are wrong, output
invalid
message
3. For registration, all input values should be
validated such as phone no, email id should be in
format

PASS

1. Output cart with user added books image, name


and price multiplied with quantity and grand total of
the
cart
2. In the top corner displays number of books
added and grand total price of the cart

TC-03

TC-04

25-jan-13

1-Feb-13

148

[13]
Validation Checks

149

Security Mechanism:
To Valid means totally accepted so validation checks indicate, to check
whether the entered data is totally acceptable or not before actual insertion into the
database.
1.

All text fields that 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

8.

Primary keys are IDENTITY columns, which makes then


value field.

9.

Data Stores in the reference table/ column is validated through a visual


Graphical Component like Combo, ListViews,Tree Views,which makes the
Foreign Key Value consistent and sure to be present in the parent table.

flag will content Digit.


Auto-Increment

150

[14]
Cost Estimation

151

Cost Estimation
Estimation is an integral part of the software development process and should not be
taken lightly. A well-planned and well-estimated project is likely to be completed in time.
Incomplete and inaccurate documentation may pose serious hurdles to the success of a
software project. Software estimation is an important part of the software development
process. Underestimating software project and under staffing it often leads to low quality
deliverables, and the project misses the target deadline to customer dissatisfaction and
loss of credibility to the company. The cost of a project is derived not only from the
estimates of effort and size but from other parameters such as hardware, travel
expenses, telecommunication costs, training cost etc. Should also be taken into
account. The cost estimation of Oline Book Store as follows:

Cost estimation process

Cost

Development Cost

20,000.00 /-

Hardware Cost (per PC)

21,000.00 /-

Broadband Connection

600.00 /- Per
Months

Training Cost

7,000.00 /-

Total Cost

38,600.00 /-

152

[15]
Reports

153

Report

Book wise report

154

Category wise report

155

Daily Report

156

[16]
Number of Modules

157

Number Of Modules:This project has the following functionalities:

1) A Home page with product catalog:


This is the page where the user will be navigated after a successful login. It will
display all the book categories and will have a search keyword option to search for the
required book. It also includes some special sections like recommended titles, weekly
special books.

2) Search:
A search by keyword option is provided to the user using a textbox .The keyword to
be entered should be the book title.

3) Advanced Search:
Advanced search helps the user to search for a book based on Title, Author,
Category and price range. All the books which match the particular search criteria and
their total count
will be displayed. From here the user can select a book and add to
the shopping cart.

4) Book Description:
If the user would like to know details about a book he can click on the title from
where he will be directed to a Book description page. It includes the notes on the book
content and also a link to Amazon.com to get the book review.
5) User Voting:
The user can give rating to a book based on his interest. He can rate it by giving
a score of five as Excellent, four for very good, three for good, two for regular and one
for deficient. The final rating of a book will depend on all the individual user rating.

6) Shopping Cart:

158

The user can manage a shopping cart which will include all the books he
selected. The user can edit, delete and update his shopping cart. A final shopping cart
summary is displayed which includes all the items the user selected and the final total
cost.

7) Managing user accounts:


Each user should have an account to access all the functionalities of website.
User can login using login page and logout using the logout page. All the user sessions
will be saved in the database.

8) Administration:
The Administrator will be provided with special functionalities like
- Add or delete a book category
- Add or delete a member
- Manage member orders.
- Add or delete a Credit Card type.

159

[17]
Charts & Schedules

160

Chart & Scheduling


The following Gannt Chart and PERT Chart will show the schedule of the various
stages of the VERA Bookstore project.

161

Gantt Chart
1 weeks

1 weeks

5 week

8 weeks

3 weeks

1 week

week

PRELIMINARY
INVESTIGATION &
FEASIBILITY
STUDY

ANALYSIS

Feasibility Study

DESIGNING

Verification
Menu Design
Data Base Design

CODING

TESTING
Unit Testing
Combined Module
Testing

IMPLEMENTATION

162

Schedules:-

Early Start

Late Start

Early Start

Duration

Analysis

Early Finish

Slack

Late Finish

Duration

Early Finish

Feasibility Study

Late Start

Slack

Late Finish

Early Start

Duration

Early Finish

Soft. Eng. Para.

Late Start

Slack

Late Finish

Early Start

Duration

Early Finish

Requirement Spec

Late Start

Slack

Late Finish

Early Start

Duration

Early Finish

Late Start

Early Start

Late Start

Design
Slack

Late Finish

Duration

Early Finish

Coding
Slack

Late Finish

Analysis(50 Days)
01-OCT-2014
Actual Start

20-NOV-2014
Actual Finish

Feasibility Study(25 Days)

21-NOV-2014
Actual Start

15-DEC-2014
Actual Finish

Soft. Eng. Para.(15 Days)

15-DEC-2014
Actual Start

30-DEC-2014
Actual Finish

Requirement Spec(2 Days)

01-JAN-2015
Actual Start

03-JAN-2015
Actual Finish

Design(30 Days)

04-JAN-2015
Actual Start

04-FEB-2015
Actual Finish

Coding(32 Days)

06-FEB-2015
Actual Start

08-MAR-2015
Actual Finish

163

[18]
Tools & Platform Used In
Project

164

Tools & Platform Used In Project:


1.

Hardware Specification:
C.P.U.:
2.1 GHz
Monitor:
CRT/TFT/LED
RAM:
2 GB and higher
Processor:
Intel- I-3 and higher
Hard disk:
120 GB and higher
CDROM:
CD/DVD writer and USB
Keyboard
Mouse

165

2. Software Specification :
Asp.Net: (code behind C#)

SQL Server 2008: (Express Edition)

166

[19]
Future Scope of the Project

167

Future Scope Of The Project: Just Now my system does not support Mobile Computing.
My system does not provide the SMS alert system.
Does not provide the soft copy of Book in computing system.
Limitation of Book system does not provide online reading or downloading the
books.
Does not provide online Banking transaction on A/c System.

168

[20]
References & Bibliography

169

References & Bibliography

IGNOU MCA Study Material of MCS-014

Course material of the IGNOU MCA course


relating to Systems Analysis and Design

IGNOU MCA Study Material of MCS-023

Course material of the IGNOU MCA course


relating to Introduction to Database
Management Systems

IGNOU MCA Study Material of MCS-034

Course material of the IGNOU MCA course


relating to Software Engineering

IGNOU MCA Study Material of MCS-043

Course material of the IGNOU MCA course


relating
to
Advanced
Database
Management Systems

http://msdn.microsoft.com
Help for Microsoft Code
5

http://codeproject.com
Help for C# Code

IEEE Std 830-1998 : IEEE Recommended


Software Engineering Standards Committee
practice for Software Requirements
of the IEEE Society
Specifications

IEEE
Std
1016-1998
:
IEEE
Software Engineering Standards Committee
Recommended practice for Software
of the IEEE Society
Design Descriptions

IEEE Std 829-1998 : IEEE Standard for Software Engineering Standards Committee
Software Test Documentation
of the IEEE Society

IEEE Std 1016-1998 : IEEE Standard for Software Engineering Standards Committee
Software Unit Testing
of the IEEE Society

10

IEEE Std 1063-2001 : IEEE Standard for Software Engineering Standards Committee
Software User Documentation
of the IEEE Society

170

[21]
Synopsis

171

Synopsis

ONLINE BOOK STORE MANAGEMENT SYSTEM


SUBMITED BY:
Jinendra S. Shah
(BCA-118186666)
Under Guidance of
Submitted to the School of Computer and Information Sciences, IGNOU
in partial fulfillment of the requirements for the degree of

Bachlors of Computer Applications (BCA)

Indira Gandhi National Open University


MaidanGarhi
New Delhi 110068

2015

172

Index
Chapter 1:Title of Project
Chapter 2:Introduction & Objective of the project
Chapter 3: Project Category
Chapter 4: Requirement of Analysis
4.1 Data Flow Diagram
4.2 ER Diagram
4.3 Data Model Diagram
Chapter 5: Number of Modules
Chapter 6: Data Structure
Chapter 7: Process Logic
Chapter 8: Types of Output/Report Generation
Chapter 9: Security Mechanism
Chapter 10: Tools & Platform used in Project
Chapter 11: Future Scope of the Project

173

Chapter 1:Title of Project


ONLINE BOOK STORE MANAGEMENT SYSTEM

174

Chapter 2:Introduction & Objective of the project

Introduction:-

Online Book Store is a ecommerce website for bookstore which provides online
books shopping for user customers and customers can view the orders and the status
of the order using login dashboards. This website has option of administrator who can
add books, view orders and update the status of the orders which customers can see
through his login order page.
Using the system users or customers can view the stores available books
and can place orders through shopping cart. On checkout time user can register or
existing user can use their existing credentials proceed the checkout. There will be
different payment options to choose to place the orders. Using login section, Customers
can view placed orders and the status of the orders whether it is delivered or still
processing from admin side.
This system has administration section where admin can access all orders,
add/view/edit books to the shopping portal. As of now, the system offers only cash on
delivery and DD/Cheque on delivery options.

Background :Online Book Store: An ecommerce website for bookstore is based on B2C project. This
project has been composed on three major strands: Data collection from customer,
administrative process for delivery and revision of report. This online store is mainly a
shopping cart for customers and real time inventory control for admin with administration
panel. Admin has proper report on orders and inventory.
As per the follow-up to the project after the implementing multiple online-payment
options through Google Checkout, PayPal and etc.

175

Objective: Proposed online Book Store Management system provides very easy
of buying Books.

process

It is more comfortable and flexible rather than offline System.


It takes very less time for processing of various tasks.
From any place user can get more information about various categories of books.
The advertisement work as an ideal task because through it people come to
know about existing and upcoming books categories.
It can handle all the tasks very easily and accurately.
The process to store the data about customer and books is done by computer
system so it provides much more accuracy and security.

176

Chapter 3: Project Category


Internet / Intranet / RDBMS

177

Chapter 4: Requirement of Analysis


4.1 Data Flow Diagram
Context Level Diagram:
Search Book

Place Order
Make Payment

Customer

Get Customer Details

Get Book,
Bill,Receipt

Online
Book Store
Management
System

Get Payment

Get Book Details

Dispetch Order

Admin

178

1st Level Diagram of Online Book Store System:


Manage Master Table

Admin

1.0
Admin

Get Update Data


For Master Table
Order the Book
Make the Payment

Customer
2.0
Get Books
Get Reports

Get & Receive


Customer details
Get &
Re
Sale ceive th
e
s De
tails

Send Book Details

3.0

Order to Purchase Book

Purchase
Make the Payment

the P
u
Deta blisher
ils

se
rch etails
u
P D
the ook
d
B
n
Se sher
i
bl
the
Pu Send etails
lier D
Supp
Send
the
Book Purchse
Deta
ils

Get the Receipt

4.0
Print The reports

Reports

Get Report

Book

Book Sales

Get Book

Admin

Sales

les
e Sa
h
t
d
ils
Sen
Deta
Book

Send

Supplier

Customer

e
hs
c
r
Pu
he ort
t
nd Rep
Se
der
e Or
h
t
d
Sen ports
Re

Se
Paym nd the
ent R
epor
t

Publisher

Supplier

Purchase

Order

Payment

179

Send the Sales Report


Send the Customer Report

2nd Level Diagram of Online Book Store System:


Fill the form

Customer
Send the customer details

Customer

1.1
Customer
Details

Search the data


Receive the Data Categories
1.2

Deliver To Customeer

Book
Search

Get the
data
G
Pu et th
bli
e
De catio
tai
ls n

Order of
books

1.3
Order

Order
Payment

Get the datiles of order

Publication

Fetch the Order


Order
detail
Deatils
send
the o
r
data der
Se
nd
Order
th
de e sta
ati
ls tus

Confirm the Order

Order Status

1.5

1.4

Dispatch

Payment

Payment
Deatils

Payment

180

Admin

Book

3rd Level Diagram of Online Book Store System:


Store Publication data
Store Book data
Store Categories data
Store Customer data
Fill the Table Data

Admin
Send the customer details
2.1
Table
Selection

Customer

Search the table data


Receive the Data Categories
2.2

Confirm to User

Table
Manage

Ge

Get the
data

tP

ub

lica

tio

et

Correct the
data

Book

nd

Publication

us
ls
tat
ils
ai
r S Deta
et
ta
de
t
rd
da t Or
en
er Ge aym
tP

et

de

or

ata

rd

2.3

Ge

DataEntry

Order
Deatils

Validate
the Data

Order

Order Status
2.5

Store the data

2.4
Validation
Payment

Storage
Store Payment data
Store Order Status data
Store Order data

Store Order Details data

181

4th Level Diagram of Online Book Store System:

Fill the Report Form

us

4.1

Get C

Report
Selection

Get C

ata
Categories
Ge gories De
tails
tB
oo
kD
Ge
eta
tP
ils
ub
lica
Book
tio
nD
ata
et

Prepare Report
Datat

tail Customer

r de
tome

et

Order Details

us

tat

rS

tails
nt De
ayme

4.3

Get P

Finally report
Check & Print

rde

tO

Ge

ata

rD

rde

Report
Prepration

Publication

ls

ai

to

4.2

Ge

er

rd

Confirm Report Print

Admin

Order

Order Status

Report
Print
Payment

182

4.2 ER Diagram

Cust_Id

Purchse_Id

Email_Id

Customer

Cust_Nm

Cust_Id

Fill

Register Details

1
Order_Id
Area

Address

Totquantity

Cust_Nm

Address

Area

Email_Id

M
Order

Make

Slip_No

Cust_Id

Book_Id

Order Details

Sup_Id

Book_Nm
Price

TotAmount

Sup_Nm

ContactPers
on_Nm

Book_Id

M
M

Book

Payment

M
ChequeDate

Bank_Nm

1
Supplier

Supply

M
Address

Searchkey

Contact_No

Email_Id

Publish
By

Receipt

Pub_Id

Pub_Nm
1

Purchase

Publisher

Price

Id
1
Admin

AdminName

Usertype

Address

Contact_No
Order_Id

Order_date

UserNM

Generates

Description

Order

Totquantity

Stock_Id

183

4.3 Data Model Diagram


Country
PK,I1 Country_Id
Country_Nm
Country_Alias
Book
PK,I1 Book_Id
Book_Nm
Search_Keyword

State
PK,I3

State_Id

State_Nm
FK1,I2,I1 Country_Id

Courier

Customer

PK Courier_Id

PK,I5

City

Cust_Id
PK,I1

Courier_Nm
Delivery_Date
Receiving_Date
Source
Destination

Payment

Stock
PK,I2

Stock_Id

FK1,I1 Book_Id
Totquantity

Order
PK,I1

Order_Id

First_Nm
Middle_Nm
Last_Nm
Contact_No
I6
Email_Id
Address
Gender
FK2,I4,I3 Country_Id
FK3,I8,I7 State_Id
FK1,I1,I2 City_ID
Purchase_Date

PK

Slip_No

Payment_Type
TotPayment
Bank_Nm
Branch_Nm
Date_Of_Payment
Cheque_Date
Cheque_No
FK3,I6,I5 Cust_Id
FK2,I4,I3 Courier_Id
FK1,I2,I1 Book_Id

Delivery_Status
PK,I4

Status_Id

I1

Courier_Id
Date_Of_Purchase
Source
Destination
FK1,I3,I2 Cust_Id

Order_Date
Description
Totquantity
FK1,I3,I2 Stock_Id

Order_Detail

City_Id

City_Nm
FK1,I3,I2 State_Id

Publication
PK,I6

Admin
PK,I6

Id

User_Nm
Password
User_type
I5
Email_Id
First_Nm
Middle_Nm
Last_Nm
Contact_No
Address
Gender
FK2,I4,I3 Country_Id
FK3,I8,I7 State_Id
FK1,I2,I1 City_Id
I9
Zipcode

Pub_Id

Pub_Nm
Price
Address
I5
Email_Id
Contact_No
Mobile_No
FK2,I4,I3 Country_Id
FK3,I8,I7 State_Id
FK1,I2,I1 City_Id
I9
Zipcode

Supplier
PK,I5 Sup_Id

Subject
PK,I3

Sub_Id

Sub_Nm
Author_Nm
FK1,I2,I1 Pub_Id

I3
I2
I4
I1
I6

Sup_Nm
ContactPerson_Nm
Address
Contact_No
Mobile_No
Email_Id
Gender
Country_Id
State_Id
City_Id
Zipcode

Purchase
PK,I5

Pur_Id
Category

FK2,I4,I3 Order_Id
FK1,I2,I1 Book_Id
Totquantity
Price
TotAmount

Pur_Nm
FK2,I4,I3 Order_Id
TotPayment
Totquantity
FK1,I2,I1 Cust_Id
FK3,I7,I6 Sup_Id
Date_Of_Purchase

PK,I1 Cate_Id
Cate_Nm
Description

Purchase_Details
PK,I5

Trans_Id

FK2,I4,I3 Pur_Id
FK1,I2,I1 Book_Id
Quantity
Price

184

Chapter 5: Number of Modules


This project has the following functionalities:

1) A Home page with product catalog:


This is the page where the user will be navigated after a successful login. It will
display all the book categories and will have a search keyword option to search for the
required book. It also includes some special sections like recommended titles, weekly
special books.

2) Search:
A search by keyword option is provided to the user using a textbox .The keyword to
be entered should be the book title.

3) Advanced Search:
Advanced search helps the user to search for a book based on Title, Author,
Category and price range. All the books which match the particular search criteria and
their total count
will be displayed. From here the user can select a book and add to
the shopping cart.

4) Book Description:
If the user would like to know details about a book he can click on the title from
where he will be directed to a Book description page. It includes the notes on the book
content and also a link to Amazon.com to get the book review.
5) User Voting:
The user can give rating to a book based on his interest. He can rate it by giving
a score of five as Excellent, four for very good, three for good, two for regular and one
for deficient. The final rating of a book will depend on all the individual user rating.

6) Shopping Cart:

185

The user can manage a shopping cart which will include all the books he
selected. The user can edit, delete and update his shopping cart. A final shopping cart
summary is displayed which includes all the items the user selected and the final total
cost.

7) Managing user accounts:


Each user should have an account to access all the functionalities of website.
User can login using login page and logout using the logout page. All the user sessions
will be saved in the database.

8) Administration:
The Administrator will be provided with special functionalities like
- Add or delete a book category
- Add or delete a member
- Manage member orders.
- Add or delete a Credit Card type.

186

Chapter 6: Data Structure

1.Admin:
FieldName
Id
User_Nm
Password
User_type
Email_Id
First_Nm
Middle_Nm
Last_Nm
Contact_No
Address
Gender
Country_Id
State_Id
City_Id
ZipCode

Size
10
30
18
20
50
20
20
20
12
50
10
10
10
10
10

DataType
Numeric
Varchar
Varchar
Varchar
Varchar
Varchar
Varchar
Varchar
Numeric
Varchar
Char
Numeric
Numeric
Numeric
Numeric

Validation
PrimaryKey
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Foreignkey
Foreignkey
Foreignkey
Not null

2.Book:
FieldName
Book_Id
Book_Nm
Search_Keyword
Image
Cate_Id
Status

Size
10
30
10
50
10
10

DatType
Numeric
Varchar
Numeric
Varchar
Numeric
Numeric

Validation
PrimaryKey
Not null
Not null
Not Null
Foreign Key
Not null

3.Category:
FieldName
Cate_Id
Cate_Nm
Description

Size
10
30
30

DataType
Numeric
Varchar
Varchar

Validation
PrimaryKey
Not null
Not null

Size
10
30
10

DataType
Numeric
Varchar
Numeric

Validation
PrimaryKey
Not null
Foreignkey

Size
10
30
15

DataType
Numeric
Varchar
Varchar

Validation
PrimaryKey
Not null
Not null

4.City:
FieldName
City_Id
City_Nm
State_Id

5.Country:

187

FieldName
Country_Id
Country_Nm
Country_Alias

6.Courier:
FieldName
Courier_Id
Courier_Nm
Delivery_date
Receiving_date
Source
Destination

Size
10
30
10
10
30
30

DataType
Numeric
Varchar
Date
Date
Varchar
Varchar

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null

Datatype
Numeric
Varchar
Varchar
Varchar
Numeric
Varchar
Varchar
Numeric
Numeric
Numeric
Numeric
Date
Numeric

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null
Not null
Foreignkey
Foreignkey
Foreignkey
Not null
Not null
Not null

Datatype
Numeric
Numeric
Date
Varchar
Varchar

Validation
Primarykey
Foreignkey
Not null
Not null
Not null

7.Customer:
Fieldname
Cust_Id
First_Nm
Middle_Nm
Last_Nm
Contact_No.
Email_Id
Address
Country_Id
State_Id
City_Id
Zipcode
Date_of_purchase
Status

Size
10
20
20
20
12
50
50
10
10
10
10
10
10

8.Delivery_Status:
Fieldname
Status_Id
Courier_Id
Date_Of_Purchase
Source
Destination

Size
10
10
10
30
30

9.Order Master:
Fieldname
Order_Id
Order_date
Description
Totquantity
Stock_Id

Size
10
10
30
10
10

Datatype
Numeric
Date
Varchar
Numeric
Numeric

Validation
Primarykey
Not null
Not null
Not null
Foreignkey

188

10.Order_Detail:
Fieldname
Order_Id
Book_id
Totquantity
Price
TotAmount

Size
10
10
10
10
10

Datatype
Numeric
Numeric
Numeric
Numeric
Numeric

Validation
Foreignkey
Foreignkey
Not null
Not null
Not null

11.Payment:
Fieldname
Slip_No
Payment_type
Totpayment
Bank_Name
Branch_Name
Date_Of_Payment
Cheque_date
Cheque_No
Cust_Id
Courier_Id
Book_Id

Size
10
10
10
30
30
10
10
20
10
10
10

Datatype
Numeric
Varchar
Numeric
Varchar
Varchar
Date
Date
Varchar
Numeric
Numeric
Numeric

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Foreignkey
Foreignkey
Foreignkey

12.Publication:
Fieldname
Pub_Id
Pub_Nm
Price
Address
Email_Id
Contact_No

Size
10
30
10
50
20
10

Datatype
Numeric
Varchar
Numeric
Varchar
Varchar
Numeric

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null

13.Purchase:
Size
10
30
10
10
10
10
10
10

Datatype
Numeric
Varchar
Numeric
Numeric
Numeric
Numeric
Numeric
Date

Validation
Primarykey
Not null
Foreignkey
Not null
Not null
Foreignkey
Foreignkey
Not null

189

Fieldname
Pur_Id
Pur_Nm
Order_Id
Totpayment
Totquantity
Cust_Id
Sup_Id
Date_Of_Purchase

14.Purchase_Detail:
Fieldname
Trans_Id
Pur_Id
Book_Id
Quantity
Price

Size
10
10
10
10
10

Datatype
Numeric
Numeric
Numeric
Numeric
Numeric

Validation
Primarykey
Foreignkey
Foreignkey
Not null
Not null

Size
10
30
10

Datatype
Numeric
Varchar
Numeric

Validation
Primarykey
Not null
Foreignkey

Size
10
10
10

Datatype
Numeric
Numeric
Numeric

Validation
Primarykey
Foreignkey
Not null

Size
10
30
30
10

Datatype
Numeric
Varchar
Varchar
Numeric

Validation
Primarykey
Not null
Not null
Foreignkey

15.State:
Fieldname
State_Id
State_Nm
Country_Id

16.Stock:
Fieldname
Stock_Id
Book_Id
Totquantity

17.Subject:
Fieldname
Sub_Id
Sub_Nm
Author_Nm
Pub_Id

18.Supplier:
Size
10
30
30
50
10
10
30
10
10
10
10
10

Datatype
Numeric
Varchar
Varchar
Varchar
Numeric
Numeric
Varchar
Char
Numeric
Numeric
Numeric
Numeric

Validation
Primarykey
Not null
Not null
Not null
Not null
Not null
Not null
Not null
Foreignkey
Foreignkey
Foreignkey
Not null

190

Fieldname
Sup_Id
Sup_Nm
Contactperson_Nm
Address
Contact_No
Mobile_No
Email_Id
Gender
Country_Id
State_Id
City_Id
Zipcode

Chapter 7: Process Logic

1. Admin Side Algorithm:


Step 1: Start
Step 2: Check User is Register or Not
Step 3: If (User is not Register) then;
Call Register();
else
Login();
Enter UserName
Enter Password
End
step 4: Stop.

Manage Choice Of Master Algorithm:


Step 1: Start
Step 2: Select Admin Process
1. Book
2. Order
3. Payment
4. Publication
5. Purchase
6. Supplier
step 3: Select Choice
Step 4: Do Accept Process
Step 5: Stop.

191

Manage Book Master Algorithm:


Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
BookAdd();
Enter Book_Id
Enter Book_Nm
Enter Search_Keyword
Search Image
Select Category_Id
Enter Status
Option:-

Validate data
Store data

Book Modify();
Search Book_Id
Option:Update record
Store data
Book Delete();
Search Book_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

Manage Order Master Algorithm:


Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
OrderAdd();
Enter Order_Id
Enter Order_date
Enter Description
Enter Totquantity
Enter Stock_Id
Option:-

Validate data
Store data

192

Order Modify();
Search Order_Id

Option:-

Update record
Store data

Order Delete();
Search Order_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

Manage Payment Master Algorithm:


Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
PaymentAdd();
Enter Slip_No
Enter Payment_type
Enter TotPayment
Enter Bank_Nm
Enter Branch_Nm
Enter Date_Of_Payment
Enter Cheque_No
Enter Cheque_Date
Enter Cust_Id
Enter Courier_Id
Enter Book_Id
Option:-

Validate data
Store data

Payment Modify();
Search Slip_No
Option:-

Update record
Store data

Payment Delete();
Search Slip_No
Delete the record.
Do u Want to Delete?
step 3: Stop.

193

Manage Publication Master Algorithm:


Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
PublicationAdd();
Enter Pub_Id
Enter Pub_Nm
Enter Price
Enter Address
Enter Email_Id
Enter Contact_No
Option:-

Validate data
Store data

Publication Modify();
Search Pub_Id
Option:-

Update record
Store data

Publication Delete();
Search Pub_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

Manage Purchase Master Algorithm:

Purchase Modify();

194

Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
PurchaseAdd();
Enter Pur_Id
Enter Pur_Nm
Enter Order_Id
Enter Totpayment
Enter Totquantity
Enter Sup_Id
Enter Date_of_Purchase
Option:Validate data
Store data

Search Pur_Id
Option:Update record
Store data
Purchase Delete();
Search Pur_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

Manage Supplier Master Algorithm:


Step 1:
Start
step 2: Enter your Choice(Add/Modify/Delete)
SupplierAdd();
Enter Sup_Id
Enter Sup_Nm
Enter ContactPerson_Nm
Enter Address
Enter Contact_No
Enter Mobile_No
Enter Email_Id
Enter Gender
Enter Country_Id
Enter State_Id
Enter City_Id
Enter Zipcode
Option:-

Validate data
Store data

Supplier Modify();
Search Sup_Id
Option:-

Update record
Store data

Supplier Delete();
Search Sup_Id
Delete the record.
Do u Want to Delete?
step 3: Stop.

195

2. Client Side Algorithm:

Step 1: Start
Step 2: Display the Home Page.
Step 3: If (User is not Register) then;
Client Register();
Enter Id
Enter User_Nm
Enter Password
Enter User_type
Enter Email_Id
Enter First_Nm
Enter Middle_Nm
Enter Last_Nm
Enter Contact_No
Enter Address
Enter Gender
Enter Country_Id
Enter State_Id
Enter City_Id
Enter ZipCode
Option:-Validate data
Store data
else
Login();
Enter UserName
Enter Password
End
step 4: Stop.

Manage Client Side Purchase Process:

196

Step 1: Start
Step 2: Show the Book Menu
Step 3: Display The Book Name
Step 4: Search the Book
Step 5: Add the Cart
Step 6: Place the Order
Step 7: Paid the Amount
Step 8: Stop.

Manage Client Side Order Process:


Step 1: Start
Step 2: Show the Book Menu
Step 3: Display the Book Name
Step 4: Search the Book Key Word
Step 5: Show the Book & Price with Publication Name &
Author Name.
Step 6: If (User Purchase Book)
Add the Cart
Place the Order
Paid the Amount
Finish
Else
Finish
End
Step 7: Stop.

197

Chapter 8: Types ofOutput/Report Generation

Admin :Admin Home


Add User
Book Master
Category
Change Password
City Master
Country Master
Customer Details
Login
Forgot Password
Payment Master
Publication Details
Purchase Details
State Details
Stock Details
Subject Detail
Supplier Details
Client
About Us
Add Cart
Book Details
Client Home
Category Name
Change Password
Different Category
Client User
Contact Us
Courier Details
Customer Details
Login
Forgot Password
Inquiry Form
Order Form
Search Book

198

Report Generation
Book Wise Report
Category Wise Report
Category Wise Most Popular Report
Daily Report
Month Wise Report
Receipt

Chapter 9: Security Mechanism


To Valid means totally accepted so validation checks indicate, to check whether the
entered data is totally acceptable or not before actual insertion into the database.
1.

All text fields that 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

8.

Primary keys are IDENTITY columns, which makes then


value field.

9.

Data Stores in the reference table/ column is validated through a visual


Graphical Component like Combo, ListViews,Tree Views,which makes the
Foreign Key Value consistent and sure to be present in the parent table.

flag will content Digit.


Auto-Increment

199

Chapter 10: Tools & Platform used in Project


1.

Hardware Specification:
C.P.U.:
2.1 GHz
Monitor:
CRT/TFT/LED
RAM:
2 GB and higher
Processor:
Core 2 duo and higher
Hard disk:
120 GB and higher
CDROM:
CD/DVD writer and USB
Keyboard
Mouse

2. Software Specification :
Front End :Asp.Net: (code behind C#)

Back End :SQL Server 2008: (Express Edition)

200

Chapter 11: Future Scope of the Project


Just Now my system does not support Mobile Computing.
My system does not provide the SMS alert system.
Does not provide the soft copy of Book in computing system.
Limitation of Book system does not provide online reading or downloading the
books.
Does not provide online Banking transaction on A/c System.

201

Anda mungkin juga menyukai