You are on page 1of 103

A

PROJECT REPORT
ON
“Online Medical System”

FOR
KOKATE MEDICAL SHOP
CHICHONDIPATIL

By
Mr. THOMARE MAHESH ASHOK

In Partial Fulfillment Of
Master of Computer Application (MCA)

SAVITRIBAI PHULE PUNE UNIVERSITY


Institute of Management Studies Career Development & Research,
Station Road, Ahmednagar – 414001

2019-2020
2

ACKNOWLEDGEMENT
3

ACKNOWLEDGEMENT

It is a matter of great pleasure for me that I have been selected to work on

this project to prove my knowledge and abilities. This project not only enhanced

my knowledge in this field but also increased my general awareness.

The completion of any project is always due to the effort from numerous

people, so no project would be considered complete without words of appreciation

for all those who contributed to the project.

In completing this project I have been fortunate to have help, support and

encouragement from many people. I would like to acknowledge them for their co-

operation.

First, I would like to thank my internal project guide Dr. Bhakkad sir , for

his constant motivation and valuable help through the project work. express my

gratitude to Dr. U. H. Nagarkar, head of M.C.A. department for his valuable

suggestions and advices throughout the M.C.A course. I also extend my thanks to

other Faculties for their Cooperation durimy Course. I express my deep thanks to

Dr. M. B. Mehta (Director, IMSCD&R) for warm hospitality and affection

extended towards me. I would also like to thank my Senior, who set help has me

to complete this work successfully.

Mahesh Ashok Thombare


4

INDEX
Chapter Description Page
1 Introduction
1.1 Company Profile 6
1.2 Existing System & Need for the System 7
1.3 Scope of Work 8
1.4 Operating Environment 10
1.5 Detail Description of Technology Used 11
2 Proposed System
2.1 Proposed System 13
2.2 Objective of System 13
2.3 User Requirements 14
3 Analysis and Design
3.1 Use Case Diagrams 19
3.2 Activity Diagrams 23
3.3 Sequence Diagram 37
3.4 Collaboration Diagram 50
3.5 Class Diagram 61
3.6 Menu Tree/Module Hierarchy Diagram 62
3.7 Component Diagram 63
3.8 Deployment Design 64
3.9 Table Design 65
3.10 Test Procedures & Implementation 68
4 User Manual 75
5 Drawbacks & Limitations 79
6 Proposed Enhancements 80
7 Conclusion 82
8 Bibliography 84
9 Annexure 1:User Interface Screen 85
Annexure 2:Sample Example Code 97
5
6

1.INTRODUCTION

1.1 Company Profile :-

The organization of KOKATE Medical Store is establish in year 2016 which are grown in
full

organization within.

 It is situated at Chichondi patil , Tal-Dist –Ahmednagar ,414201


 The owner of this Medical store is Mr. Pravin Kokate
 The organization is concerned with the different Medical Related items.
 It is one of the popular Medical Store in Chichondi Patil
 In this Medical store many type of Items are maintain and sale.
This Medical store cannot establish second branch.

Chapter-I
INTRODUCTION
7

1.2 Existing System and Need of System :-

Existing System:

The existing Medical Store System is manual system. The main drawback of the

existing system is time consumption. There are number of records and hence a larger

number of registers have to be kept to the store.

This document required more storing space, more manpower and job become tedious.

In Existing system following points are observed:

 chances of errors and data processing time


 Timely Due to manual process, required more time to complete user
requirement
 It will increase updating is complicated and time consuming.
 Security of data were not maintain

Need For System:


 The existing of Medical Store System is manually which require more paper
work
so it needs to computerize the system to get following benefits.
 Computer enhances easy and simple means of Storing information. The space
occupied for storing of information is reduced.
 Computers helps in fast retrieval of information .we can search information in
a
short of time.
 Maintenance of data is very easy and workload is reduced.
 It’s a paperless system.
 We can generated report on demand.
 It will give faster modification.
 Product sale will be easy.
8

1.3 Scope of Work :-

The main objective of this Online Medical Shop system is to take the whole
medical store online so that it is reachable to customers 24/7. It also aims at going
towards cashless transactions. It will impart a wider visibility to the customers.
Thus boosting the business to higher levels. The medical Booking Store will be a
web based system with a very user friendly interface which indeed will make the
whole management process easy to manage and operate with zero redundancies.
Overall online medical booking store will become an efficient, highly responsive
and an extremely accurate system.
This application is for all who wants to order their medicine online that is
customer. Customer first register to website then place order for the require
medicines. The delivery boy can track the order and also gives that information to
the customers. Admin can maintain all the details about customers , medicine
stock as well as the delivery boy.
Admin:
1. Login: Admin can login to the system by entering valid credentials.
2. Maintain product: Admin can maintain product details.
3.Maintain product category: Admin can maintain product categories.
4.View customer details: Admin can view customer details.
6. Generate bill: Admin can generate bill as per customer.
7. Generate purchase order: Admin can generate purchase order.
8. Maintain supplier detail: Admin can maintain supplier’s details i.e. Admin can
add, update and delete the suppliers details from the database.
9. Maintain delivery status: Admin can maintain details of delivery status.
10. Maintain Customer details: Admin can maintain customer details i.e. Admin
can perform add, update, delete function on customer .
11.manage order: Admin can manage order details
12. View Cart: Admin can view the cart i.e. products added into the cart.
13. view feedback: Admin can view the feedback given the customer.
9

14. Change password: Admin can change the password by clicking on change
password button.
15. Forgot password: Admin can change password if He forget the password.

Customer:
1. Registration: Customer has to register his profile to the system for using it.
2. Login: Customer can login after doing registration.
3. Change password: Customer can change the password .
4. Forgot password: Customer can change the password by doing Forgot
password.
5. View product: Customer can view the products after login.
6. Search and purchase product: Customer can search a product and purchase it.
7. Select product type as per prescription: Customer select product type as per
prescription.
8. Add to cart: Customer can add product to the cart by the clicking on Add to
Cart.
9. View cart: Customer can view the products added to the cart and he can remove
any product from the cart.
10. Make payment: Customer can make payment by Cash or by using credit/debit
card.
11. Track delivery details: Customer can track the status of the delivery
12. Give feedback: Customer can give feedback for the products, for delivery, or
for the website also.
13. Cancel order: Customer can cancel order.
14. Update profile: Customer can update his profile.
Delivery boy:
1. View order: Delivery boy can view order
2. Accept order: Delivery boy can accept order.
3.Send Notification: Delivery boy can send notification to admin and customer.
4.Update delivery status: Delivery boy can update delivery status.
10

1.4 Operating Environment :-

The project will be operating in windows environment. The online medical


shop is a website and shall operate in all famous browser, for a model we are
takingMicrosoft Internet Explorer, Google Chrome, and Mozilla Firefox & Opera
7.0 or higher version. The only requirement to use this online product would be
the internet connection.The hardware configuration include - Hard Disk: 80 GB ,
RAM:1GB ,Monitor: 15” Color monitor, Keyword: 122 Keys. The basic input
devices required are keyboard, mouse and output devices are monitor, printer, etc.
Hardware requirement-

 Client side requirement:

 RAM : 512MB or More.

 Developer side requirements:

 Processor :Pentium 4(1.6)GHZ

 RAM : 4GB RAM and more.

Software Requirements :

 Client side requirement:

Operating system :

 Windows

 Developer side requirements:

Operating system :

 Windows

1.5 Detail Description of Technology Used :-


11

HTML-
HTML is an acronym which stands for Hyper Text Mark-up Language
which is used for creating attractive web pages and web applications.
CSS-
CSS stands for Cascading Style Sheets. It is a style sheet which is used to
describe the look and formatting of a document written in mark-up language. It
provides and additional feature to HTML.
SQL Server-
SQL server is a relational database management system. It is open-source
and free. It is very commonly used in conjunction with Asp.net to create
powerful and dynamic web forms.
ASP.NET
ASP.NET is a web application framework developed and marketed by
Microsoft
to allow programmers to build dynamic web sites. It allows you to use a full featured
programming language such as C# or VB.NET to build web applications easily.

Bootstrap

Bootstrap is the most popular HTML, CSS, and JavaScript framework for

developing responsive, mobile-first websites.

Bootstrap is completely free to download and use!

1.1References:
 Websites:
www.en.m.wikipedia.org/wiki
www.javatpoint.com
www.w3school.com
 Tools:
Rational Rose Enterprise Edition 2008
Notepad++
 Books:
Object Oriented Analysis and Design- Dr. Potdar Sir
12

Chapter-II
Proposed System
13

2. PROPOSED SYSTEM

2.1 Proposed System :-

The Online Medical shop needs to sell different types of products to


customer & maintain records. The application will show all products in
categorized manner. Admin can browse any product for its price and other details
. Products can be managed by admin. Admin can keep track of orders, Sales &
Stock. Admin can also maintain the supplier and delivery boy.

2.2 Objectives of System :-

Following are the objective of the proposed system

The Online Medical Shop is a very important application used by chemist’s

to assist people making purchases. The primary goal of an The Medical shop

is to sell products to the customer online & maintain records of products.

Paper less work is done in this system.

 Automate the process :-

This all system is automatic there is only need of internet connection.

 Increase the reliability :-

In manual system buy product is time consuming but with the help of site we can

buy product in less time.

 Timely report to be generated automatically :-

Manually showing report is difficult; hence the objective is to develop a system

which shows all type of reports easily.


14

2.3 User Requirements :-

2.3.1 Functional Requirements :

There are three users can login into System, Admin ,Customer and Delivery boy :
Admin:
1. Admin can login to the system by entering valid credentials.
2. Admin can maintain product details.
3. Admin can maintain product categories.
4. Admin can view customer details.
6. Admin can generate bill as per customer.
7. Admin can generate purchase order.
8. Admin can maintain supplier’s details i.e. Admin can add, update and delete the
suppliers details from the database.
9. Admin can maintain details of delivery status.
10. Admin can maintain customer details i.e. Admin can perform add, update,
delete function on customer .
11. Admin can manage order details
12. Admin can view the cart i.e. products added into the cart.
13. Admin can view the feedback given the customer.
14. Admin can change the password by clicking on change password button.
15. Admin can change password if He forget the password.
Customer:
1. Customer has to register his profile to the system for using it.
2. Customer can login after doing registration.
3. Customer can change the password .
4. Customer can change the password by doing Forgot password.
5. Customer can view the products after login.
6 Customer can search a product and purchase it.
7. Customer select product type as per prescription.
8. Customer can add product to the cart by the clicking on Add to Cart.
15

9. Customer can view the products added to the cart and he can remove any
product from the cart.
10. Customer can make payment by Cash or by using credit/debit card.
11. Customer can track the status of the delivery .
12. Customer can give feedback for the products, for delivery, or for the website
also.
13. Customer can cancel order.
14. Customer can update his profile.
Delivery boy:
1. Delivery boy can view order.
2. Delivery boy can accept order.
3. Delivery boy can send notification to admin and customer.
4. Delivery boy can update delivery status.
16

2.3.2 Non Functional Requirements :-

The proposed system that we are going to develop will be used by the admin and
by many customers. Admin can manage the data of product, sales, purchases, bill,
and various customers. The online medical shop management system is developed
to enable customer to buy medicines. The database is handled by the admin only
that He can retrieve product details and manage it. Therefore, it is expected that
the database
would perform functionality all the requirements that are specified by the
university.
 The performance of the system should be fast and accurate.
 Online Medical shop system shall handle expected and non-expected errors in
a ways that prevent loss in information and long downtime period. Thus it
should have inbuilt error testing to identify invalid username and password.
 The system should be able to handle large amount data because many products
and customers are handled.

2.3.2.1 Safety Requirement


The database may get crashed at any certain time due to virus or operating system
failure. Therefore, it is required to take the database backup so that the database is
not lost. Proper UPS/inverter facility should be there in case of power supply
failure.
2.3.2.2 Security Requirement
 System will use secured database.
 Normal users can just read information of product but they cannot edit and
delete anything except their personal information.
 System will have different type of users and every user has access constraints.
 Proper user authentication should be provided.
 No one should be able to hack user’s password.
 There should be separate accounts for admin and customers such that no other
customer can access the database and only admin has rights to update the
database.
17

2.3.2.3 Requirement attributes


 The Quality of the database is maintained in such way that it can be very user
friendly to all the users of the database.
 The user can easily download and install the system.

The users of the system are Admin , Customers and delivery boy. The Admin and
the delivery boy should have more knowledge of the internals of the system and is
able to rectify the small problems that may arise due to disk crashes, power
failures and other catastrophes to maintain the system. The proper user interface,
user manual, online help and the guide to install and maintain the system must be
sufficient to educate the users on how to use the system without any problems.
The admin provides certain facilities to the users in the form of :
 Backup and Recovery
 Forgot Password
 Data migration i.e. whenever user register for the first time then the data is
stored in the server
 Data replication i.e. if the data is lost in one branch, it is still stored with the
server
 Auto Recovery i.e. frequently auto saving the information
 Maintaining files i.e. File Organization
 The server must be maintained regularly and it has to be updated time to time.
18

Chapter III
Analysis and Design
19

3. ANALYSIS AND DESIGN


3.1 Global Use Case Diagram
20

Actor-wise Use-case Diagram


ACTOR: ADMIN

Login

Maintain Product

Maintain Product Category

View Product

Generate Purchase Order


Admin
(from Usecases)

Generate Bill

Maintain Delivery Details

View Cust_Details

Maintain Supplier

View Feedback

Maintain Frequent_Cust
21

Actor-wise Use-case Diagram


ACTOR: CUSTOMER

Registration

Login

Purchase product as per


prescription
Customer
(f rom Usecases)

View Product

Search and Purchase product

Make Payment

Cancel Order

Send Feedback

Update Profile
22

Actor-wise Use-case Diagram


ACTOR: DELIVERY BOY

Login
(from Usecase Diagram)

Update Profile
(from Usecase Diagram)

Maintain Delivery Details


(from Usecase Diagram)

delivery boy
(from Usecase Diagram)

View Cust_Details
(from Usecase Diagram)

View Feedback
(from Usecase Diagram)

accept order
(from Usecase Diagram)

Cancel Order
(from Usecase Diagram)
23

3.2 Activity Diagram

3.2.1 Activity Diagram for login form-

Enter Username

Enter password

[If invalid]

[if valid]

Go to next page

3.2.2 Activity Diagram for Change password form-

Enter current
password

Enter new
password

confirm Display Error


password Message

[ if invalid ]

[ if valid ]

save
24

3.2.3 Activity Diagram for Registration form-


25

Ente r Full name

Enter Address

Enter mobile
Number

Display Error Message

if invalid

Enter Email

Display Error
Message
[ if invalid ]

[ if valid ]

Enter Username

Ente r password

Confirm Display Error


Password Message

[ if invalid ]

[ if valid ]

Enter Security Enter Answer update profile


Question

3.2.4 Activity Diagram for Forget password form-


26

Enter Username

Enter Security
Question
Display Error
Message

Enter answer
[ if invallid ]

[ if valid ]

Enter new
password

Display Error
Message
confirm
password

[ if invalid ]

[ if vallid ]

save

3.2.4 Activity Diagram for View Cart form-

Display Cart

[ If remove product ] [ if add quantity ]

Remove product Display list

Make Proceed
payment

3.2.6 Activity Diagram for Maintain delivary Status form-


27

Enter Order Id

Enter Customer
Name

Display Product
Detail

Enter Delivary
Boy Name

Enter Delivary Boy


Contact Number

Send

3.2.7 Activity Diagram for Cancel Order form-

Enter order id

Enter username

[ if not found ]

[validate]

[ if found ]

Display order
Details

cancel Order

3.2.8 Activity Diagram for Maintain Product form-


28

[add product]
[ update/delete product ]

Add product
name

[ if update ]
Add catagory

[ if delete ]

Add product
company Display
Displayproduct
product Display product
list
list list

Add packing
Display list
Display list

Enter product
save name Delete Supplier

Edit catagory

Enter product
company

Enter packing

save

3.2.9 Activity Diagram for Maintain Product Catagory form-


29

[ if update/delete catagory

[ if add catagory ]

Add product Display


catagory catagory

Add product [ if update catagory


catagory Name
[ if delete catagory ]

save Display
Display catagory list
catagory list

Select catagory

select catagory

Edit catagory
name
Delete catagory
name
save

3.2.10 Activity Diagram for Maintain Supplier form-


30

[ update/delete supplier ]
[ if add supplier ]

Edit supplier
name

[ if update ]
Add supplier [ if delete ]
name

Display Supplier
Edit supplier list
contact Display Supplier
list

select Supplier
save
select Supplier
Edit supplier
name

Edit supplier Delete Supplier


contact

save

3.2.11 Activity Diagram for Payment form-


31

Fetch customer
details

Dislay Details

Select payment
method

[ if credit ] [ if debit ]

Credit card Debit card

Enter card
number

Enter expiration
date

Enter security [ if invalid ]


code

[ if valid ]

Place order

3.2.12 Activity Diagram for Product Details form-


32

Enter produt id

Enter batch

Enter expiry
date

Display Error
Message

[ if invalid ]

[ if valid ]

Enter M.R.P.

Enter quantity

Enter rate

Enter amount

Add supplier ID

save

3.2.13 Activity Diagram for Purchase Order form-


33

Enter supplier
name

Enter supplier
Adress

Enter shipping
address

Enter product
name

Enter product
company

Enter packing

Enter quantity

want to continue

calculate
amount

select payment
method

[ if COD ]
cash on delivary
[ if online ]

online

Pay bill

Print purchase
order

3.2.14 Activity Diagram for Search and Purchase form


34

Enter product

Search product

[ If not found [ If found ]

Display list

Add product to
cart

Show cart page

3.2.15 Activity Diagram for Select Product form

[ If search product ] [ if select catagory ]

Select Product
Enter product Catagory

Display list

[ not found ]

[ If found ]

Display product

3.2.16 Activity Diagram for Update Profile form


35

Fetch user Id

Enter Full name

Enter Address

Enter mobile
Number

if inv alid
Display Error Message

Enter Email Display Error


Message

[ if inv alid ]

[ if v alid ]

Enter Username

Enter password

Display Error
Message
Conf irm
[ if inv alid ]
Password

[ if v alid ]

Enter Security
Question

Enter Answer

update prof ile

3.2.17 Activity Diagram for Send Feedback form


36

Enter name

Enter Email

Enter Feedback

save

3.2.18 Activity Diagram for Send Feedback form

Display list

Display
feedback

3.2.19 Activity Diagram for maintain Cart form


37

Display Cart

[ If remove product ] [ if add quantity ]

Remove product Display list

Make Proceed
payment

3.2.20 Activity Diagram for view Customer form

Enter customer
name

[ if not found ]

[ if found ]

Display
customer ID

Display
customer name

Display customer
Adress

Display customer
mobile no

3.3. Sequence Diagram


38

3.3.1 Sequence Diagram for login form

: customer : Loginboundry : Logincontrol : RegistrationDB


Enter Username( )

Enter password( )

Send Data( )
Validate( )
[If invalid]
DisplayError message

[If valid]
login sucessfully

3.3.2 Sequence Diagram for Add Product form

: Admin : Add product boundry : Add product control : ProductDB


Enter product ID( )

Enter batch( )

Enter expiry date( )


Send data( )

[if invalid] validate( )


Display error message
[if valid]
Enter M.R.P.( )
enter quantity( )
enter rate( )
enter amount( )
Add supplier ID( )
Send data( )

validate( )

Save in database( )
Display appropriate mess...

3.3.3 Sequence Diagram for Registration form


39

: customer : Registration boundry : Registration control : RegistrationDB

Enter fullname( )

Enter Adress( )

Enter mobile no( )


Send data( )

[if invalid] validate( )


Display error message

[if valid]
Select Gender( )
Enter age( )
Enter Email( )

Send data( )

validate( )
[if invalid]
display error message

[if valid]
Enter username( )
Enter password( )

confirmed password( )
Send data( )
validate( )
[if invalid]
Display error message

[if valid]
enter security question( )

Enter answer( )
Send data( )
Update Database( )
display appropriate message

3.3.4 Sequence Diagram for Cancel Order form


40

: customer : cancel order boundry : cancel order control : OrderDB

Enter Order ID( )

SEnd data( )

fetch order details()

Request to cancel( )

Display msg to customer...

3.3.5 Sequence Diagram for Changed password form

: customer : Changesd password boundry : changes password : RegistrationDB


control
Enter current password...

Enter new password( )

confirmed password( )
Send Data( )
Validate( )
[If invalid]
Display error message

update database()
[If valid]
Display password updated message

3.3.6 Sequence Diagram for Send Feedback form


41

: customer : feedback boundry : feedback control : feedbackDB


Enter name( )

Enter Email( )

Enter feedback( )

Send Details( )

[If invalid] validate( )


display error message

[If valid]
save in database( )

3.3.7 Sequence Diagram for Forget Password form

: customer : forgrt password boundry : forget password control : RegistrationDB

Enter username( )

Enter security question( )

Enter answer( )
Send Data( )
Validate( )
[if invalid]
Display error message
[if valid]
Enter password( )

confirm password( )
Send data( )

Validate( )
[if invalid]
Display error message
[if valid]
Upadate database( )

display appropriate mess...

3.3.8 Sequence Diagram for Maintain Delivary form


42

: Admin : maintain delivary boundry : maintain delivary control : OrderDB

Enter order ID( )

Enter customer name( )


Send data( )

Display product details... Fetch data()

Enter delivary boy name...


enter delivary boy contact...
Send data( )

validate( )
Display delivary details...
Details send to customer...

3.3.9 Sequence Diagram for Search and Perchase form

: customer : Search and purchase boundry : search and purchase : ProductDB


control
Enter product( )

Send data( )
Validate( )

[if not found]


Display error msg

fetch product details...

[if found]
Display product( )
Add product to cart...
Display product details...
if want to continue
Display products( )

3.3.10 Sequence Diagram for Maintain Product form


43

: Admin : maintain product boundry : maintain product control : ProductDB

fetch product list( )

Select option( )

Add product name( )


[if Add]
Add catagory( )
add company name( )
add packing( )
Send data( )

validate( )

[if valid]
Save in database( )
Display approriate mess...

[if update
fetch product list( )

Display product list...


Select Product( )

Edit product name( )


Edit catagory( )
Edit product company...

Edit packing( )
Send data( )

validate( )

[if valid]

Update database( )
[if delete]

Display appropriate mess...

fetch product list( )

Display product list...


Select Product( )
Delete product( )
Send data( )

validate( )

[if valid]
Update database( )
Display appropriate mess...

3.3.11 Sequence Diagram for Maintain Product category form


44

: Admin : maintain catagory boundry : maintain catagory : ProductDB


control
fetch catagory list...

Slect option( )

[if Add] add product catagory...


Add catagory name( )
Send data( )

validate( )

[if valid]
Save in database( )

display appropriate mess...

[if update fetch catagory list...

Display catagory list...


Select catagory( )

edit catagory name...


Send data( )

validate( )
[if valid]
Update database( )
Display appropriate mess...
[if delete]

fetch catagory list...


Display catagory list...
Select catagory( )
delete catagory( )
Send data( )

validate( )

[if valid]
Update database( )
Display appropriate message

3.3.12 Sequence Diagram for Maintain Supplier form


45

: Admin : maintain supplier boundry : maintain suppliier : supplierDB


select option( ) control

add supplier name( )


[if ADD]
Add supplier contact...

Add supplier adress...


Send data( )

validate( )
Save in database( )
Display appropriate message

fetch supplier list( )


[if update] select supplier( )
Edir supplier name( )
Edit supplier contact...

Edit supplier adresss...


Send data( )

validate( )
update database( )
Display approprite mess...

fetch supplier list( )


[if Delete] select supplier( )
Delete supplier( )
Send data( )
validate( )

update database( )
Displat appropriate mess...

3.3.14 Sequence Diagram for Payment form


46

: customer : Payment boundry : payment control : ProductDB : OrderDB


fetch product details...
fetch data()

[if credit]
Display Details( )

Select payment method...


Enter card number( )
enter expiration( )
Enter security code...
[if invalid]
Send data( )

validate( )

Display error message

[if debit] [if valid]


place order( )

Enter card number( )


enter expiration( )
Enter security code...
[ifSend
invalid]data( )

validate( )

Display eror message

[if valid]

place order( )
Update database()

3.3.15 Sequence Diagram for Purchase Order form


47

: Admin : prchase order boundry : purchase order control : PurchaseOrderDB

Enter supplier name( )


enter supplier adress...
Ente shipping adresss...

Enter product name( )

Enter company( )
Enter packing( )

Enter quantity( )
Send data( )

[if invalid] Validate( )


Display error message

[if you want to continue]


Calculate amount( )
Select payment method...

Enter card details( )

[If online] Enter security code...


Pay bill( )
Send data( )
Validate( )
[if invalid]
Display error message

[if valid]

Print P.O( )

Update database()
[if COD]

Print P.O( )

3.3.16 Sequence Diagram for Select Product form


48

: customer : select product boundry : select product : ProductDB : supplierDB

fetch supplier details...

Enter product( )

Select supplier( )
if search Send data( )

validate( )
[if invalid]
display error message
[if valid]
Display product( )

if select
catagory fetch product details...

Display catagory list...

select product catagory...

Display products( )

3.3.17 Sequence Diagram for Maintain Cart form

: customer : view cart boundry : view cart control : ProductDB


Display cart( )

Select option( )

[IF ADD] fetch product details...

Add quantity( )
send data( )
Save in DB( )
Display Appropriate mess...

IF REMOVE Select Product( )


Remove Product( )
Update Database( )
Display Appropriate mess...

3.3.18 Sequence Diagram for Update Profile form


49

: customer : update profile boundry : update profile control : RegistrationDB

Enter full name( )

Enter adress( )

Enter mobile( )
[ifsend
invalid]
data( )

[if valid]
validate( )
display error msg

Enter email( ) [if invalid]


send data( )

[if vaLID]
validate( )

Display error message

Enter username( )
[if invalid]
Enter password( )

[if valid]password( )
confirm send data( )

validate( )

display error msg

Enter security question...

enter answer( )
send data( )

validate( )
save in database( )
Display appropriate mess...

3.3.19 Sequence Diagram for Update View Customer form


50

: Admin : view customer boundry : view customer control : Customer DB

Enter customer name...

Send data( )

Validate( )
[if invalid]
Display error message
fetch data()
[if valid]

Display customer details...

3.3.20 Sequence Diagram for Update View Product form

: customer : view product boundry : view product control : ProductDB

Search product( )
Send data( )

fetch product details...

Display product details...

3.4 Collaboration Diagram


51

3.4.1 collaboration diagram for Login Form

1: Enter Username( )
2: Enter password( )

: customer 5: DisplayError mess... : Loginboundry


6: login sucessfu...

3: Send Data( )

4: Validate( )

: Logincontrol : RegistrationDB

3.4.2 collaboration diagram for Feedback Form

1: Enter name( )
2: Enter Email( )
3: Enter feedback( )

: customer
: feedback boundry

6: display error mess...

5: validate( )
4: Send Details( )

7: save in database...

: feedback control
: feedbackDB

3.4.3 collaboration diagram for Registration Form


52

1: Enter fullname( )
2: Enter Adress( )
3: Enter mobile no( )
7: Select Gender( )
8: Enter age( )
9: Enter Email( )
13: Enter username( )
14: Enter password( )
15: confirmed password( )
19: enter security question( )
20: Enter answer( )
: customer

: Registration boundry

6: Display error mess...


12: display error mess...
18: Display error mess...
23: display appropriate message

4: Send data( )
5: validate( ) 10: Send data( )
11: validate( ) 16: Send data( )
17: validate( ) 21: Send data( )

22: Update Database( )

: RegistrationDB

: Registration control

3.4.4 collaboration diagram for Add Product Form

1: Enter product ID( )


2: Enter batch( )
3: Enter expiry date( )
7: Enter M.R.P.( )
8: enter quantity( )
9: enter rate( )
10: enter amount( )
11: Add supplier ID( )

: Add product boundry


: Admin

6: Display error message


15: Display appropriate message

4: Send data( )
5: validate( ) 12: Send data( )
13: validate( )

14: Save in database( )

: ProductDB
: Add product control

3.4.5 collaboration diagram for Cancel Order Form


53

1: Enter Order ID( )


4: Request to cancel( )

: customer : cancel order boundry


5: Display msg to customer( )
3: fetch order details()
2: SEnd data( )

: cancel order control : OrderDB

3.4.6 collaboration diagram for Changed password Form


54

1: Enter current password( )


2: Enter new password( )
3: confirmed password( )

: Changesd password boundry


: customer 6: Display error message
8: Display password updated message

4: Send Data( )
5: Validate( )
7: update databas...

: changes password : RegistrationDB


control

3.4.7 collaboration diagram for Forget password Form


1: Enter username( )
2: Enter security question( )
3: Enter answer( )
8: Enter password( )
9: confirm password( )

: customer : forgrt password boundry

6: Display error mess...


7: [if valid]
12: Display error mess...
14: display appropriate message

4: Send Data( )
11: Validate( ) 10: Send data( )

5: Validate( )
13: Upadate database...

: forget password control


: RegistrationDB
55

3.4.8 collaboration diagram for Maintain Delivary Form

1: Enter order ID( )


2: Enter customer name( )
6: Enter delivary boy name( )
7: enter delivary boy contact( )
11: Details send to customer( )

: Admin : maintain delivary boundry

4: Display product details( )


10: Display delivary details( )

9: validate( )
3: Send data( )
8: Send data( )

5: Fetch data()
: maintain delivary control : OrderDB

3.4.9 collaboration diagram for Maintain Product Form


56

2: Select option( )
3: Add product name( )
4: Add catagory( )
5: add company name( )
6: add packing( )
12: Display product list( )
13: Select Product( )
14: Edit product name( )
15: Edit catagory( )
16: Edit product company( )
17: Edit packing( )
23: Display product list( )
24: Select Product( )
25: Delete product( )

: maintain product boundry


: Admin

10: Display approriate message


21: Display appropriate message
29: Display appropriate message

1: fetch product list( )


8: validate( ) 7: Send data( ) 11: fetch product list( )
19: validate( ) 18: Send data( ) 22: fetch product list( )
27: validate( ) 26: Send data( )

9: Save in database( )
20: Update database( )
28: Update database( )

: maintain product control


: ProductDB

3.4.10 collaboration diagram for Maintain Product Catagory Form


2: Slect option( )
3: add product catagory( )
4: Add catagory name( )
10: Display catagory list( )
11: Select catagory( )
12: edit catagory name( )
18: Display catagory list( )
19: Select catagory( )
20: delete catagory( )

: Admin : maintain catagory boundry

8: display appropriate message


16: Display appropriate message
24: Display appropriate message
6: validate( )
14: validate( ) 1: fetch catagory list( )
22: validate( ) 5: Send data( ) 9: fetch catagory list( )
13: Send data( ) 17: fetch catagory list( )
21: Send data( )
7: Save in database( )
15: Update database( )
23: Update database( )

: maintain catagory
control : ProductDB

3.4.11 collaboration diagram for Maintain Supplier Form


57

1: select option( )
2: add supplier name( )
3: Add supplier contact( )
4: Add supplier adress( )
10: select supplier( )
11: Edir supplier name( )
12: Edit supplier contact( )
13: Edit supplier adresss( )
19: select supplier( )
20: Delete supplier( )

: Admin : maintain supplier boundry

8: Display appropriate message


17: Display approprite message
24: Displat appropriate message

6: validate( ) 9: fetch supplier list( )


15: validate( ) 5: Send data( ) 18: fetch supplier list( )
22: validate( ) 14: Send data( )
21: Send data( )

7: Save in database( )
16: update database( )
23: update database( )

: maintain suppliier control


: supplierDB

3.4.12 collaboration diagram for Payment Form


4: Select payment method( )
5: Enter card number( )
6: enter expiration( )
7: Enter security code( )
12: place order( )
13: Enter card number( )
14: enter expiration( )
15: Enter security code( )
20: place order( )

: Payment boundry
3: Display Details( )
10: Display error mess... 1: fetch product details( )
: customer
11: [if valid]
18: Display eror mess...
19: [if valid]

: ProductDB
9: validate( )
8: Send data( )
17: validate( )
16: Send data( )

21: Update database()

: OrderDB

: payment control

3.4.13 collaboration diagram for Purchase Order Form


58

1: Enter supplier name( )


2: enter supplier adress( )
3: Ente shipping adresss( )
4: Enter product name( )
5: Enter company( )
6: Enter packing( )
7: Enter quantity( )
12: Calculate amount( )
13: Select payment method( )
14: Enter card details( )
15: Enter security code( )
16: Pay bill( )
20: Print P.O( )
22: Print P.O( )

: Admin : prchase order boundry


10: Display error mess...
11: [if you want to continue]
19: Display error message

21: Update database()


9: Validate( ) 8: Send data( )
18: Validate( ) 17: Send data( )

: purchase order control : PurchaseOrderDB

3.4.14 collaboration diagram for Search And Purchase Form


1: Enter product( )
6: Display product( )
7: Add product to cart( )
10: Display products( )

: Search and purchase boundry

: customer
4: Display error ...
8: Display product details( )
9: if want to continue

5: fetch product details( )


2: Send data( )

3: Validate( )

: search and purchase


control : ProductDB

3.4.15 collaboration diagram for Select Product Form


59

2: Enter product( )
3: Select supplier( )
9: Display catagory list...
10: select product catagory( )
11: Display products( )

: customer

: select product boundry

6: display error mess...


7: Display product...
8: fetch product details( )
1: fetch supplier details( )
5: validate( ) 4: Send data( )

: select product

: ProductDB
: supplierDB

3.4.16 collaboration diagram for Update Profile Form

2: Enter full name( )


3: Enter adress( )
4: Enter mobile( )
8: Enter email( )
12: Enter username( )
13: Enter password( )
14: confirm password( )
18: Enter security question( )
19: enter answer( )

: customer
: update profile boundry

7: display error ...


11: Display error mess...
17: display error ...
23: Display appropriate message
6: validate( )
10: validate( ) 1:
16: validate( )
5: send data( )
21: validate( )
9: send data( )
15: send data( )
20: send data( )

22: save in database( )

: RegistrationDB
: update profile control

3.4.17 collaboration diagram for Maintain Cart Form


60

2: Select option( )
4: Add quantity( )
8: Select Product( )

: customer : view cart boundry

1: Display cart( )
7: Display Appropriate message
11: Display Appropriate message

5: send data( )
9: Remove Product( ) 3: fetch product details( )

6: Save in DB( )
10: Update Database( )

: view cart control

: ProductDB

3.4.18 collaboration diagram for view Customer Form

1: Enter customer name( )

: Admin : view customer boundry

4: Display error message

2: Send data( )
6: Display customer details( )

3: Validate( )

5: fetch data()
: view customer control : Customer DB
61

3.4.19 collaboration diagram for view Product Form


1: Search product( )

4: Display product details( )


: customer : view product boundry

2: Send data( )

3: fetch product details( )


: view product control
: ProductDB

3.5 class diagram


62

Payment
Order_Master Pay_no(PK)
date
O_M_id(PK) Product
pay_type
P_id(FK)
O_M_id(FK) P_id(PK)
p_name
Registration U_id(FK) p_name
quantity 1
U_id(PK) p_type
amount
uname make payment() packing
U_id(FK) 1
adress c_name Purchase
o_status
mobile batch Pc_id(pk)
cart_id(FK)
email expiry date
1..* 1..*
username rate p_name
cancel order()
password S_id(FK) quantity
view order()
squestion 1 cat_id(FK) P_id(FK)
1 make order()
cart_id(FK) 0..* S_id(FK)
answer 1..*
E_no(FK)
cart_id(FK) 1 1..* view product() add order()
O_M_id(FK) 1 add product() cancel order()
1..*
delete product() update order()
Feedback Order_transection 1
registration() view P.O()
E_no(PK) O_D_id(PK) 0..* 1..*
login()
uname date
changed password() 0..1 0..*
email P_id(FK) 1
forget password() 1 1..* catagory
feedback O_M_id(FK)
update profile() cat_id
U_id(FK)
view order details() cat_name
1..*
view feedback() cat_img
1..* p_no(FK) Supplier
send feedback()
responce feedback() S_id(PK)
add catagory() s_name
delete catagory() s_adress
s_contact
0..*
P_id(FK)

DelivaryBoy view order()


DB_name
DB_adress 1
DB_contact
O_D_id(FK)
1
login() 1
view order()
1 cartdetails
update status() 1 1
cart_id(PK)
U_id(FK) Stock
p_id(FK) stock_id(PK)
img avail_p
quantity p_no(FK)
rate pc_id(FK)
totalprice cat_id(FK)
username
add stock()
show cart() maintain stock()
clear cart()
63

3.6 Module Hierarchy Diagram :

Online Medical Store

Customer Delivery Boy Admin

Login Login
Login

Change password Maintain Product


View Order
Registration Maintain Product
Accept Order Category

View Customers
Search Product Update Delivery
Status

Make Payment Generate


Purchase Order
Cancel Order
Maintain
Supplier
Update Profile
Maintain order
Send Feedback

Track Order Maintain Delivery

View Feedback

Change Delivery
Status

3.7 Component Diagram:


64

Database

SQL server

Stored data Retrived data

Server
Client
ASP.Net

Send Request User


browser
Response data
<CSS>
<Bootstrap>

3.8 Deployment Diagram:


65

3.9 Table Specification:

Registration Table
66

Sr no Field Name Data type Constraint


1 U_id Int P.K
2 Fullname Varchar2 Not null
3 Address Varchar2 Not null
4 Mobile Int Not null
5 Email_id Varchar2 Not null
7 Username Varchar2 Not null
8 Password Varchar2 Not null
9 Squestion Varchar2 Not null
10 S_Answer Varchar2 Not null

Product Table

Serial No: Field name Data type Constraint


1 P_id Int P.K
2 P_Name Varchar2 Not null

3 P_Type Varchar2 Not null

4 Packing Varchar2 Not null

5 C_Name Varchar2 Not null

6 Batch Int Not null

7 Expiry Varchar2 Not null

8 Rate Int Not null

9 Cart_id Int F.K

Delivery boy Table

Serial No: Field name Data type Constraint


67

1 DB_NO Int P.K


2 DB_Name varchar Not null
3 DB_ Address varchar Not null
4 DB_contact Int Not null
5 O_M_id int F.K

Order Master table

Serial No: Field name Data type Constraint


1 O_M_no Int P.K
2 P_id Int F.K
3 P_Name Varchar2 Not null
4 Batch int Not null
5 expiry Varchar2 Not null
6 Quantity Int Not null
7 Rate Int Not null
8 Amount Int Not null
9 Status Varchar2 Not null
10 U_id Int F.K
11 Ccart_id Int F.K

Order-transection table

Serial No: Field name Data type Constraint


1 order_no Int P.K
2 U_no Int F.K
3 Date Date Not null
4 Amount Int Not null
5 P_no Int F.K
6 O_M_id Int F.K

Supplier table

Serial Field name Data type Constraint


No:
68

1 S_id Int P.K

2 S_name Varchar2 Not null

3 S_Address Varchar2 Not null

4 S_contact Int Not null

5 P_id Int F.K

Feedback Table

Serial No: Field name Data type Constraint

1 F_No Int P.K


2 Uname Varchar2 Not null
3 email_id Varchar2 Not null

4 Feedback Varchar2 Not null


5 U_id Varchar2 F.K

Cart Details Table

Serial No: Field_name Data type Constraint


1 Cs_no Int PK
2 P_no Int FK
3 Img Varchar2 Not null
4 Quatity Int Not null
5 Rate Int Not null
6 Totalprice Varchar2 Not null
7 Username Varchar2 Not null
8 P_name Varchar2 Not null
9 U_id int F.K
10 O_M_id Int F.K
Category Table

Serial No: Field name Data type Constraint


1 Cat_id Int PK
2 Cat_name Varchar2 Not null
69

3 img Varchar2 Not null


4 P_no Int F.K

Payment table

Serial No: Field name Data type Constraint


1 Pay_no Int PK
2 date Date Not null
3 Pay_type Varchar2 Not null
4 U_id Int F.K
5 O_M_id Int F.K

Purchase table

Serial No: Field name Data type Constraint


1 Pc_id Int PK
2 date Date Not null
3 P_name Varchar2 Not null
4 quantity Int Not null
5 P_no Int F.K
6 S_id Int F.K

Stock table

Serial No: Field name Data type Constraint


1 stock_no Int PK
2 Avail_p Int Not null
70

3 P_no Int F.K

4 Pc_id Int F.K


5 Cat_id Int F.K

Test Cases:

1. Login:
71

Test Test case Test case Input Expected Actual Test Test Test
case name Descriptio result Result case status prio
Id n status (p/f) rity

1 Validate Field Leave blank Alert Alert msg Design p hig


Username not msg “Please h
blank “Please Enter
Enter Username”
Usernam
e”
2 Validate Field not Leave blank Alert Alert msg Design p hig
password blank msg “Please h
“Please Enter
Enter Password”
Passwor
d”
3 Login To verify Enter correct Redirect Design p hig
validation username username and Control h
and password and to the
password click on login respected
Eg. button page
Enter
username=
“admin”
And
password=
”admin”

2. Email:

Test Case TCEmail


ID:
72

Test Case Test Case For Email


Name:
Step No. Steps to be Expected Actual Pass / Fail Remarks Defect ID
Executed Results Results

1 Enter Invalid Invalid Pass Invalid NIL


invalid Email email is Email is
Email message displayed checked
without should be
‘@’ Or ’.’ displayed

2 Enter System Entered Pass Valid NIL


Valid should Email is Email are
Email accept And Displayed checked
proceed

3. Mobile No:

Test TCMobileNo
Case
73

ID:
Test Test Case For Mobile Number
Case
Name:
Step No. Steps to Expected Actual Pass / Remarks Defect
be Results Results Fail ID
Executed
1 Enter Invalid Invalid Pass Invalid NIL
more than Mobile Mobile Mobile
10 or less Number Number is number is
than 10 message displayed checked
digit should be
number displayed
2 Enter System Entered Pass Valid NIL
Valid should Mobile Mobile
Mobile accept number is number
Number And Displayed are
proceed checked

4. Upload Image:

Test Case TCUploadimg


ID:
74

Test Case Test Case For Upload Image


Name:
Step No. Steps to be Expected Actual Pass / Fail Remarks Defect ID
Executed Results Results

1 Select the Select Select Pass Selected NIL


image file image file image file Image file
in the message is is checked
format should be displayed
of .png,.jpg displayed

2 Select System Name of Pass Selected NIL


Image file should selected Image file
in correct accept And image file is checked
format. proceed is
Displayed
75

Chapter-IV
USER MANUAL

4. USER MANUAL

Purpose:

The main purpose of user manual is to provide information which helps user in

operating the system


76

A proper user manual allows user to operate the system easily and effectively The

user manual contains all the information about the new system It is prepared for

the convenience of the user

User Manual is mainly for native user.

Web Services

In this module Admin can maintain product, category, supplier, delivary and view

reports from database

Operations Manual

Purpose

The purpose of operations Manual is to make user aware of the basic

functionality of the website


77

Homepage

1. This Dropdown is for Manage your Account.

2. This Button is For Logout from Account.

3. This ImageButton Is For Show A Cart.

4. This Button is For catagories.


78

5.This TextBox is For Search a Product.

6. This Dropdown is for add quantity of Product

7. This Button is For add product in cart.

8. This Button is For buy A product.


79

Chapter-V
DRAWBACK &
LIMITATIONS
80

Drawbacks &limitation

Efforts have been taken to complete this website but still it has some

drawbacks.

The main drawback of the website are as following

 System can’t send OTP to user.

 Without internet connection user cannot used this website.

 Without internet connection Admin Cannot make changes in website.

Limitation

 Website can run slow on slower internet connection


81

Following are the proposed enhancements for the system:


 Integration of social context.

 System can be added new function.

 OTP function can be implemented


82

Chapter-VII

CONCLUSION
83

7. CONCLUSION

 The online medical website will help the user to buy a product online.

 Buying product process will be less time consuming.

 User can buy a product as per their requirement or as per doctor advice.

 User can get very well shopping website

 This website provide variety of product of different catagories.


84

Chapter-VIII

BIBLIOGRAPHY
85

8. BIBLIOGRAPHY

 Web References :-

 www.google.com

 w3cschool.com

 Youtube .com

 stackoverflow.com

 1mg.com

 Books References :-

 Beginning MySQL by W. Jason Gilmore.


86

9.1 Annexure 1: User Interface Screen

3.9.1: Log in page

3.9.2 Registration
87

3.9.2 Registration
88

3.9.3 Homepage

3.9.4 Maintain Product


89

3.9.5 Add Product

3.9.6 Maintain Category


90

3.9.7 Add Category

3.9.8 Maintain Supplier


91

3.9.9 Add Supplier

3.9.10 Show Feedback


92

3.9.11 View Orders (Admin)


93

3.9.12 Search Product

3.9.13 Changed Password


94

3.9.14 Forget Password

3.9.15 Cart
95

3.9.16 Buy Now

3.9.17 Payment
96

3.9.18 Feedback

3.9.19 View Order (customer)


97

3.9.20 View Orders (Delivery boy)


98

Annexure 2: Sample Example Code


home.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class home : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["cat"] != null)
{
DataList1.DataSourceID = null;
DataList1.DataSource = SqlDataSource2;
DataList1.DataBind();
}

if (Session["username"] == null)
{
Label6.Text = "Hello Guest,";
LinkButton7.Visible = true;
LinkButton6.Visible = false;
LinkButton8.Visible = false;
}
else
{
Label6.Text = "Hello " + Session["username"].ToString();
LinkButton8.Visible = true;
LinkButton7.Visible = false;
DropDownList2.Visible = true;

}
DataTable dt = new DataTable();
dt = (DataTable)Session["buyitems"];
if (dt != null)
{

Label3.Text = dt.Rows.Count.ToString();
}
else
{
Label3.Text = "0";

}
protected void ImageMap1_Click(object sender, ImageMapEventArgs e)
{

}
protected void LinkButton5_Click(object sender, EventArgs e)
{
DataList1.DataSourceID = null;
99

DataList1.DataSource = SqlDataSource1;
DataList1.DataBind();

}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("home.aspx?cat=ALLOPATHY");

}
protected void LinkButton2_Click(object sender, EventArgs e)
{
Response.Redirect("home.aspx?cat=HOMEOPATHY");
}
protected void LinkButton3_Click(object sender, EventArgs e)
{
Response.Redirect("home.aspx?cat=AYURVEDA");
}
protected void LinkButton4_Click(object sender, EventArgs e)
{
Response.Redirect("home.aspx?cat=NUTRITION");
}
protected void Button2_Click(object sender, EventArgs e)
{
if (TextBox1.Text != "")
{
DataList1.DataSourceID = null;
DataList1.DataSource = SqlDataSource3;
DataList1.DataBind();
}
}
protected void DataList1_ItemCommand(object source,
DataListCommandEventArgs e)
{
if (e.CommandName == "addtocart")
{

DropDownList dlist = (DropDownList)


(e.Item.FindControl("DropDownList1"));
Response.Redirect("Cart.aspx?id=" + e.CommandArgument.ToString()
+ "&quantity=" + dlist.SelectedItem.ToString());

}
}
protected void LinkButton7_Click(object sender, EventArgs e)
{
Response.Redirect("login.aspx");
}
protected void LinkButton6_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("home.aspx");

}
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Cart.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("BuyNow.aspx?price=" + Label3.Text);
}
100

protected void DropDownList2_SelectedIndexChanged(object sender,


EventArgs e)
{
if (DropDownList2.SelectedItem.Value=="1")
{
Response.Redirect("changedpass.aspx");
}
if (DropDownList2.SelectedItem.Value == "2")
{
Response.Redirect("Registration.aspx");
}
if (DropDownList2.SelectedItem.Value == "3")
{
Response.Redirect("Cart.aspx");
}
}
protected void DropDownList2_SelectedIndexChanged1(object sender,
EventArgs e)
{

}
protected void LinkButton8_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("home.aspx");
}
}

Login.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data;
using System.Data.SqlClient;

public partial class login : System.Web.UI.Page


{
String Constr =
WebConfigurationManager.ConnectionStrings["conString"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{

}
private void clearAll()
{
TextBox1.Text = "";
TextBox2.Text = "";
}
protected void Button1_Click(object sender, EventArgs e)
{
String Constr =
WebConfigurationManager.ConnectionStrings["conString"].ConnectionString;
SqlConnection scon = new SqlConnection(Constr);
101

String myquery = "select * from registration where username='" +


TextBox1.Text + "'";
SqlCommand cmd = new SqlCommand();
cmd.CommandText = myquery;
cmd.Connection = scon;
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds);
String uname;
String pass;
if (ds.Tables[0].Rows.Count > 0)
{
uname = ds.Tables[0].Rows[0]["username"].ToString();
pass = ds.Tables[0].Rows[0]["password"].ToString();

scon.Close();
if (uname == "admin" && pass == "admin")
{
Session["username"] = uname;
Session["buyitems"] = null;

Response.Redirect("product.aspx");
}
else if (uname == "db1" && pass == "db1" || uname == "db2" &&
pass == "db2" || uname == "db3" && pass == "db3" || uname == "db4" && pass
== "db4")
{
Session["username"] = uname;
Session["buyitems"] = null;

Response.Redirect("delivaryBoy.aspx");
}
else
{
Session["username"] = uname;
Session["buyitems"] = null;

Response.Redirect("home.aspx");

Label1.Text = "Invalid Username or Password - Relogin with


Correct Username Password";
}
}
else
{
Label1.Text = "Invalid Username or Password - Relogin with
Correct Username Password";
}
}
102

Registration.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.IO;

public partial class Registration : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
int inserted = 0;
SqlConnection mycon = new SqlConnection(@"Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True");
mycon.Open();
String insertSQL;
insertSQL = "Insert into
registration(f_name,l_name,mobile,email,username,password,squestion,answer)v
alues(@f_name,@l_name,@mobile,@email,@username,@password,@squestion,@answer)
";
SqlCommand cmdinsert = new SqlCommand(insertSQL, mycon);
cmdinsert.Parameters.AddWithValue("@f_name", TextBox1.Text);
cmdinsert.Parameters.AddWithValue("@l_name", TextBox2.Text);
cmdinsert.Parameters.AddWithValue("@mobile", TextBox3.Text);
cmdinsert.Parameters.AddWithValue("@email", TextBox4.Text);
cmdinsert.Parameters.AddWithValue("@username", TextBox8.Text);
cmdinsert.Parameters.AddWithValue("@password", TextBox6.Text);

cmdinsert.Parameters.AddWithValue("@squestion",DropDownList1.Text);
cmdinsert.Parameters.AddWithValue("@answer", TextBox7.Text);

inserted = cmdinsert.ExecuteNonQuery();
mycon.Close();
lblmsg.Text = "Registration successful";
Response.Redirect("login.aspx");

}
catch (Exception x)
{
Response.Write(x.Message);

protected void SqlDataSource1_Selecting(object sender,


SqlDataSourceSelectingEventArgs e)
103

You might also like