Sunteți pe pagina 1din 116

TABLE OF CONTENTS

SLNO DESCRIPTION Page NO

1 INTRODUCTION 4

2 SYSTEM REQUIREMENTS 7

HARDWARE SPECIFICATION 7

SOFTWARE SPECIFICATION 7

3 SYSTEM ANALYIS 8

EXISTING SYSTEM 8

PROPOSED SYSTEM 8

4 FEASIBILITY ANALYSIS 9

5 SYSTEM DESIGN 10
ONLINE GROCERY SHOPPING

INPUT DESIGN 10

ER-DIAGRAM 11-13

DFD 14

USE CASE DIAGRAM 15

SEQUENTIAL DIAGRAMS 16-17

DATABASE DESIGN 18-20

OUTPUT DESIGN 20

6 SYSTEM IMPLEMENTATION 21

7 SOURCE CODE 21-52

8 SOFTWARE TESTING 53-54

9 SCOPE FOR FURTHER ENHANCEMENT 55

Department Of Computer Science and Applications, Bangalore University Page 2


ONLINE GROCERY SHOPPING

10 BIBLIGRAPHY 55

Department Of Computer Science and Applications, Bangalore University Page 3


ONLINE GROCERY SHOPPING

ABSTRACT

An abstracting service is a service that provides shortening or


summarizing of documents and assigning of description for referencing
documents.

The product is often an abstracts journal or a bibliographic index which may be


a subject bibliography or a bibliographic database

This project is an attempt to provide the advantages of online grocery shopping


to customers of a real shop. It helps buying the products in the shop anywhere
through internet by using an android device. Thus the customer will get the
service of online grocery shopping and home delivery from his favorite shop.
This system can be implemented to any shop in the locality or to multinational
branded shops having retail outlet chains.

If shops are providing an online portal where their customers can enjoy easy
shopping from anywhere, the shops won’t be losing any more customers to the
trending online shops such as flip cart or eBay. Since the application is available
in the Smartphone it is easily accessible and always available

Department Of Computer Science and Applications, Bangalore University Page 4


ONLINE GROCERY SHOPPING

1: INTRODUCTION

This project is a web based shopping system for an existing shop. Online grocery shopping is
the process whereby consumers directly buy goods or services from a seller in real-time,
without an intermediary service, over the Internet. It is a form of electronic commerce. This
project is an attempt to provide the advantages of online shopping to customers of a real
shop. It helps buying the products in the shop anywhere through internet buying an android
device. Thus the customer will get the service of online shopping and home delivery from his
favorite shop

1.1 Project objective:

The objective of the project is to make an application in android

platform to purchase items in an existing shop. In order to build such an

application complete web support need to be provided. A complete and

efficient web application which can provide the online shopping

experience is the basic objective of the project. The web application can

be implemented in the form of an android application with web view.

Department Of Computer Science and Applications, Bangalore University Page 5


ONLINE GROCERY SHOPPING

1.2 project overview:

The central concept of the application is to allow the customer to shop

virtually using the Internet and allow customers to buy the items and

articles of their desire from the store. The information pertaining to the

products are stores on an RDBMS at the server side (store).

The Server process the customers and the items are shipped to the

address submitted by them. The application was designed into two

modules first is for the customers who wish to buy the articles. Second is

for the storekeepers who maintains and updates the information pertaining

to the articles and those of the customers. The end user of this product is

a departmental store where the application is hosted on the web and the

administrator maintains the database. The application which is deployed

at the customer database, the details of the items are brought forward

from the database for the customer view based on the selection through

the menu and the database of all the products are updated at the end of

each transaction. Data entry into the application can be done through

various screens designed for various levels of users. Once the authorized

personnel feed the relevant data into the system, several reports could be

generated as per the security.

Department Of Computer Science and Applications, Bangalore University Page 6


ONLINE GROCERY SHOPPING

2 MODULES DESCRIPTION:

2.1 MODULES:

The system after careful analysis has been identified to be presented with

the following modules and roles.

The modules involved are:

Administrator

Users

2.1.1 ADMINISTRATOR:

The administrator is the super user of this application. Only admin

have access into this admin page. Admin may be the owner of the shop.

The administrator has all the information about all the users and about all

products.

MANAGE PRODUCTS

a) Add Products

The shopping cart project contains different kind of products. The products

can be classified into different categories by name. Admin can add new

products into the existing system with all its details including an image.

b) Delete Products

Administrator can delete the products based on the stock of that particular

Product

Department Of Computer Science and Applications, Bangalore University Page 7


ONLINE GROCERY SHOPPING

MANAGE ORDERS

a)View Order

Administrator can view the Orders which is generated by the users. He can verify the details
of the purchase.

2.1.2 USERS

a) Registration

A new user will have to register in the system by providing essential

details in order to view the products in the system. The admin must accept

a new user by unblocking him.

b) Login

A user must login with his user name and password to the system after

registration.

c) View Products

User can view the list of products based on their names after successful

login. A detailed description of a particular product with product name,

products details, product image, price can be viewed by users.

Department Of Computer Science and Applications, Bangalore University Page 8


ONLINE GROCERY SHOPPING

3. Analysis

System analysis is the process of gathering and interpreting facts, diagnosing problems and
using the information to recommend improvements on the system. System analysis is a
problem solving activity that requires intensive communication between the system users and
system developers. System analysis or study is an important phase of any system
development process. The system is viewed as a whole, the inputs are identified and the
system is subjected to close study to identify the problem areas. The solutions are given as a
proposal. The proposal is reviewed on user request and suitable changes are made. This loop
ends as soon as the user is satisfied with the proposal.

3.1 EXISTING SYSTEM

The current system for shopping is to visit the shop manually and from the

available product choose the item customer want and buying the item by

Payment of the price of the item .

1. It is less user-friendly.

2. User must go to shop and select products.

3. It is difficult to identify the required product.

4. Description of the product limited.

5. It is a time consuming process

6. Not in reach of distant users.

3.2 PROPOSED SYSTEM

In the proposed system customer need not go to the shop for

Department Of Computer Science and Applications, Bangalore University Page 9


ONLINE GROCERY SHOPPING

buying the products. He can order the product he wish to buy through the

application in his Smartphone. The shop owner will be admin of the

system. Shop owner can appoint moderators who will help owner in

managing the customers and product orders. The system also

recommends a home delivery system for the purchased products

3.3 FEASIBILITY ANALYSIS

Whatever we think need not be feasible. It is wise to think about the feasibility of any
problem we undertake. Feasibility is the study of impact, which happens in the organization
by the development of a system. The impact can be either positive or negative. When the
positives nominate the negatives, then the system is considered feasible. Here the feasibility
study can be performed in two ways such as technical feasibility and Economical Feasibility.

Technical feasibility:

We can strongly says that it is technically feasible, since there will not be much
difficulty in getting required resources for the development and maintaining the system as
well. All the resources needed for the development of the software as well as the maintenance
of the same is available in the organization here we are utilizing the resources which are
available already.

Economical Feasibility:

Development of this application is highly economically feasible. The organization


need not spend much money for the development of the system already available. The only
thing is to be done is making an environment for the development with an effective
supervision. If we are doing so, we can attain the maximum usability of the corresponding
resources. Even after the development, the organization will not be in a condition to invest
more in the organization. Therefore, the system is economically feasible.

Department Of Computer Science and Applications, Bangalore University Page 10


ONLINE GROCERY SHOPPING

4. Literature survey
4.1 About DBMS

4.1.1 Introduction to DBMS:

DATABASEMANAGEMENT SYSTEM (DBMS)

A Database management system is a collection of programs that enables user to


create and maintain a database. The DBMS facilitates the process of defining,
constructing and manipulating database for various applications. Defining a database
involves specifying, database structures, types and constraints for the data to be stored
in the database, based on the mini-world being modeled.

Constructing the database is the process of storing the data itself on some
storage medium that is controlled by the DBMS. Manipulating a database includes
functions such as querying the database to reflect changes in the mini world,
generating the reports from the data. The primary objective of a DBMS to provide
environment to retrieve and store database information. Database system supports
multi user environment. It is an integrated collection of related files along with details
of the interpretation of the data contained therein data and facts where conclusion
can be drawn.

Department Of Computer Science and Applications, Bangalore University Page 11


ONLINE GROCERY SHOPPING

CHARACTERISTICS OF DATABASE MANAGEMENT SYSTEM:

 It represents complex relationship between data.


 Keeps tight control of data redundancy.
 Enforces user - defined rules to ensure the integrity of data.
 Has centralized data dictionary for storage of information pertaining data its
manipulation.
 Ensures that the data can be shared across application.
 Enforces data access authorization.
 Has different interfaces via which user can manipulate the data.

Oracle workgroup or server is the largest selling RDBMS product. It is estimated that
the combined sales of both these oracle database product account for around 80% of
the RDBMS systems sold worldwide. These products are constantly undergoing
change and evolving. The natural language of this RDBMS product is ANSI SQL,
PL/SQL a superset of ANSISQL. Oracle 8i, 9i, 10G also understands SQLJ. Oracle
corp. has also incorporated a full-fledged java virtual machine into its database
engine. Since both executable shares the same memory space the JVM can
communicate with the database engine with ease and has direct access to oracle tables
and their data.

Department Of Computer Science and Applications, Bangalore University Page 12


ONLINE GROCERY SHOPPING

SQL is structure query language.SQL contains different data types those are
1. Char (size)
2. Varchar2 (size)
3. Date
4. Number (p,s)
5. Long
6. raw/long raw

Different types of commands in SQL:


A). DDL commands: - To create a database objects
B). DML commands: - To manipulate data of a database objects
C). DQL commands: - To retrieve the data from a database.
D). DCL/DTL commands: - To control the data of a database…

DBMS FACILITIES
The two main facilities are provided by DBMS they are:
 The data define facility (or) language DDL.
 The data manipulation facility (or) language DML.

Data Definition Language (DDL): The DBMS has a special type of compiler, whose Work is
to process DDL statements to identify schema constructs. It defines how the data store in
physical devices.DDL is used to define the schema, and mapping between two must be
specified using DDL.

Data Manipulation Language (DML): After the database schema is compiled and
Implemented using DDL, The data can be manipulated using DML.
It includes certain operations like:

Department Of Computer Science and Applications, Bangalore University Page 13


ONLINE GROCERY SHOPPING

 Retrieval of data.
 Insertion of data.
 Deletion of data.
 Modification of data.

Query: Is the first data manipulation operation that requests a retrieval of data from database.
The subset of the DML used to pose a query is called as a Query language.

DATA INDEPENDENCE:

The process of changing the schema of one level to its higher level of the database system
without affecting the higher level of schema
There are two types of Data Independence:
 Logical data independence.
 Physical Data Independence.
Logical Data Independence: it’s a capacity to change the conceptual schema, without making
any changes in external schema or application program.
Physical Data Independence: it’s a capacity to change the internal structure (or) schema
without changing the external schema.

ADVANTAGES OF DBMS

 Controlling Redundancy.
 Restriction of unauthorized access.
 Providing storage structure for efficient query processing.
 Providing multi user interface.
 Sharing of data.
 Data security.
DISADVANTAGES OF DBMS

Department Of Computer Science and Applications, Bangalore University Page 14


ONLINE GROCERY SHOPPING

 High initial investment in hardware, software and training.


 Overhead for providing security, concurrency control, recovery and integrity
functions.
 The database and its applications are simple, well defined and not expected to change.

RDBMS

An RDBMS (Relational Database Management System) is based on the relational


model of data that was first introduced by Codd in 1970. The relational data model uses the
concept of a mathematical relation that looks somewhat like a table of values as its basic
building block, and has its theoretical basis in the set theory and first order predicate logic.
This model has been implemented in large number of commercial systems over the last thirty
years. Oracle 8i used in this project is also based on relational model with object extensions.

DEFINITION AND DESCRIPTIONS IN DBMS

ATTRIBUTE: A field describing a property of an entity.

DATA DICTIONARY: It is a collection of all data types along with their names and
structures.

ENTITY: It is a thing of independent existence about which data is stored. It is defined as a


collection of values corresponding to various attribute names describing the entity set.

SUPER KEY: The super key of a relation schema R is a set of attributes S which is a subset
of R with the property that no two tuples in a legal relation will have the same combination of
values for this set of attributes.

KEY: A key K is a super key with the additional property that removal of any attribute form
K will not cause K not to be a super key. So it is a “minimal” super key.

CANDIDATE KEY: If the relational schema has more than one minimal key, each is called
a candidate key.

Department Of Computer Science and Applications, Bangalore University Page 15


ONLINE GROCERY SHOPPING

DATA ENHANCING

Oracle 10g Data Warehousing enhancements include:

 An increase in the size limits of the database to support ultra-large databases of


millions of terabytes in size and ultra-large files of terabytes in size. The 4GB
restriction on LOBs has been raised to 128 terabytes.

 Improvements to Real Application Clusters (RAC) enable resources to be allocated


automatically and meansthat operational data can be used immediately without the
need to copy it to another database.

 Enhancements to OLAP analytic, a data-mining GUI and a new SQL model allow
query results to be treated as sets of multi-dimensional arrays on which complex inter-
dependent operations - such as forecasting - can be run without the need to extract
data to spreadsheets or perform complex joins and unions on the data.

 A new changed data capture facility based on Oracle Streams provides low or zero
latency trickle feeds that combined with integrated extraction, transformation and
loading (ell) enable real-time warehousing.

4.2 About Tools

4.2.1 Information about Front end tool:

CSS is a set of tags used to format and layout web pages. Formatting (e.g. bold, colors, etc.)
and layout (e.g. where left menu, top heading, and footer are located) used to be done entirely
in HTML because CSS did not exist until 1996. One does not have to use CSS, but it must be
used for a web page to validate under the strictest validations and has many other advantages.
As a result, CSS is used in most web sites. CSS is used primarily for formatting. A lot of web
sites still use HTML tables for layout, but CSS is being used for an increasing number of web

Department Of Computer Science and Applications, Bangalore University Page 16


ONLINE GROCERY SHOPPING

sites. Tables are still a fine option to organize data within a web page, such as a 4x6 table of
product information.

Advantages of CSS

Easy global changes. Many web pages (hundreds or more) can be attached to the same CSS
file. Therefore, a simple change to the one CSS file, such as a change to the default text color,
would immediately be reflected in all of the hundreds of web pages (i.e. the default text color
is changed on all the hundreds of HTML/web pages), i.e. an immediate global change. CSS is
said to “separate design from content”.
Layout. Using tables for layout can be difficult to maintain and changes may have to be done
on all web pages (unless a template or SSI/include system is being used). CSS allows very
slight changes (moving title text 10 pixels to the right) or substantial changes to be done
easily and globally.

Size, Bandwidth, and Load Time. Since all of the formatting and layout code of a web page
can be removed from every web page, HTML files become much smaller in file size and the
network bandwidth and web page load time is reduced. Bandwidth is further reduced because
the one CSS file being used is then “cached” by the web browser and/or server. CSS also
allows the developer to create roll-over type navigation menus without the use of two images
per menu item reducing the web page’s file size even further.
Accessibility. Separating style from content makes it easier to accommodate persons with
disabilities, such as visual impairments. Web pages can be easily displayed as text only and
different CSS files can be used depending upon the users browsing device.
Consistency. Using a single CSS files allows the formatting, layout and position of elements
within the web pages of a site, such as navigation and text, to be consistently enforced across
the site. You don’t have to worry about having some pages look different than others or
violating the style guide of a company.
Search Engine Optimization. A search engine robot will normally consider the content at the
beginning of your web page (HTML code) more important than the text towards the end of
the code. For a table-based web page the navigation bar is normally at the top of the web
page code. But with CSS, the navigation cab placed at the bottom of the web page allowing
the search engine robot to see the true content on the web page immediately. In addition,

Department Of Computer Science and Applications, Bangalore University Page 17


ONLINE GROCERY SHOPPING

since CSS removes the formatting HTML code from HTML file, there is less clutter for the
robot to go through to find the content to index the web site by.
Clean code. A well-coded and documented HTML and CSS web page can be very clean, i.e.
very easy to read and understand. Easy to read code makes maintaining and updating a web
page much easier.

4.2.1.2

PHP is a programming language that you can use to write Web applications. A Web
application can be anything from a simple "contact us" form through to a fully-fledged
blogging system, online store, or forum system.

PHP is a server-side language

PHP is known as a server-side programming language. This means that it runs on the Web
server. Most Web programming languages are server-side, but some, such as JavaScript,
are client-side, which means they run on the Web browser.

Server-side languages give you more flexibility as they can do many things that are hard to
do with JavaScript — for example, working with files and databases, or manipulating images.
That said, JavaScript is coming along in leaps and bounds these days (as these
examples show).

Server-side code is also potentially more secure than JavaScript code. Since JavaScript code
is sent to the Web browser it's easy for a visitor to view and edit the code. Server-side code,
on the other hand, remains on the Web server and isn't accessible to visitors to the site.

PHP is open source

The PHP engine — that is, the code that sits on the Web server and runs PHP scripts — is
open source, which means anyone can access and work on the engine's source code. This
helps to ensure that PHP will be around for a long time to come.

PHP is free to download and use, which is one reason why it is so popular among Web
hosting companies. You'll find that the vast majority of Web hosting accounts support PHP.

PHP is geared towards the Web

Department Of Computer Science and Applications, Bangalore University Page 18


ONLINE GROCERY SHOPPING

While many programming languages can be used to build Web applications, PHP is one of
the few languages specifically designed for the Web. To this end, it includes a lot of useful
Web-related features out of the box, such as:

Easy ways to read and handle Web forms and cookies

Functions for creating and manipulating graphics

The ability to talk to popular databases such as MySQL, and

Functions for working with HTML.

You can mix PHP code with HTML code

One nice feature of PHP is that you can insert chunks of PHP code into an HTML page. You
surround the PHP chunks with special symbols. When the Web server retrieves the page, any
PHP chunks are run by the PHP engine, while the other parts of the page are sent as they are
to the browser.

This feature makes it easy to add interactivity to otherwise plain Web pages — great for
contact forms and the like.

Uses of PHP

You can use PHP to write practically any type of Web application or script. Common PHP
applications include:

Blogging software such as WordPress

E-commerce systems like Magento

Content management systems including Drupal and Joomla!, and

Forum software such as phpBB.

In addition, many popular websites, including Yahoo!, Wikipedia, Facebook, and Digg, use
PHP code extensively.

Department Of Computer Science and Applications, Bangalore University Page 19


ONLINE GROCERY SHOPPING

4.2.2 Information about Back end Tools

4.2.2.1 MySQL?

MySQL, the most popular Open Source SQL database management system, is developed,
distributed, and supported by Oracle Corporation.

 MySQL is a database management system.

A database is a structured collection of data. It may be anything from a simple shopping list
to a picture gallery or the vast amounts of information in a corporate network. To add, access,
and process data stored in a computer database, you need a database management system
such as MySQL Server. Since computers are very good at handling large amounts of data,
database management systems play a central role in computing, as standalone utilities, or as
parts of other applications

 MySQL databases are relational.

A relational database stores data in separate tables rather than putting all the data in one big
storeroom. The database structures are organized into physical files optimized for speed. The
logical model, with objects such as databases, tables, views, rows, and columns, offers a
flexible programming environment. You set up rules governing the relationships between
different data fields, such as one-to-one, one-to-many, unique, required or optional,
and “pointers” between different tables. The database enforces these rules, so that with a
well-designed database, your application never sees inconsistent, duplicate, orphan, out-of-
date, or missing data.
The SQL part of “MySQL” stands for “Structured Query Language”. SQL is the most
common standardized language used to access databases. Depending on your programming
environment, you might enter SQL directly (for example, to generate reports), embed SQL
statements into code written in another language, or use a language-specific API that hides
the SQL syntax.
SQL is defined by the ANSI/ISO SQL Standard. The SQL standard has been evolving since
1986 and several versions exist. In this manual, “SQL-92” refers to the standard released in

Department Of Computer Science and Applications, Bangalore University Page 20


ONLINE GROCERY SHOPPING

1992, “SQL:1999” refers to the standard released in 1999, and “SQL:2003” refers to the
current version of the standard. We use the phrase “the SQL standard” to mean the current
version of the SQL Standard at any time.

 MySQL software is Open Source.

Open Source means that it is possible for anyone to use and modify the software. Anybody
can download the MySQL software from the Internet and use it without paying anything. If
you wish, you may study the source code and change it to suit your needs. The MySQL
software uses the GPL (GNU General Public License), to define what you may and may not
do with the software in different situations. If you feel uncomfortable with the GPL or need
to embed MySQL code into a commercial application, you can buy a commercially licensed
version from us. See the MySQL Licensing Overview for more information).

 The MySQL Database Server is very fast, reliable, scalable, and easy to use.

If that is what you are looking for, you should give it a try. MySQL Server can run
comfortably on a desktop or laptop, alongside your other applications, web servers, and so
on, requiring little or no attention. If you dedicate an entire machine to MySQL, you can
adjust the settings to take advantage of all the memory, CPU power, and I/O capacity
available. MySQL can also scale up to clusters of machines, networked together.

MySQL Server was originally developed to handle large databases much faster than existing
solutions and has been successfully used in highly demanding production environments for
several years. Although under constant development, MySQL Server today offers a rich and
useful set of functions. Its connectivity, speed, and security make MySQL Server highly
suited for accessing databases on the Internet.

 MySQL Server works in client/server or embedded systems.

Department Of Computer Science and Applications, Bangalore University Page 21


ONLINE GROCERY SHOPPING

The MySQL Database Software is a client/server system that consists of a multi-threaded


SQL server that supports different back ends, several different client programs and libraries,
administrative tools, and a wide range of application programming interfaces (APIs).

 A large amount of contributed MySQL software is available.

MySQL Server has a practical set of features developed in close cooperation with our users.
It is very likely that your favorite application or language supports the MySQL Database
Server.

Features of MySQL?

 Internals and Portability


 Statements and Functions
 Security
 Scalability and Limits
 Connectivity
 Localization
Clients and Tools

Department Of Computer Science and Applications, Bangalore University Page 22


ONLINE GROCERY SHOPPING

CHAPTER -5

5. System Configuration

5.1 HARDWARE REQUIRMENTS:

 RAM: 4.00SB

 HARD DISK: 25GB

 Intel® core(I3) i3-7020u PROCESSOR.

5.2 SOFTWARE REQUIREMENTS:

 FRONT END DEVELOPING TOOL: PHP, CSS

 BACK END: MYSQL

 OPERATING SYSTEM: WINDOWS 10

Department Of Computer Science and Applications, Bangalore University Page 23


ONLINE GROCERY SHOPPING

6. E-R Diagram

Entity relationship diagram represents the data flow between external words, processes and
data stores direction of arrows between processes and entities whether the external entity
provides information/data to the process.

E-R Model is a popular high level conceptual data model. This model and its variations are
frequency used for the conceptual design of database application and many database design
tools employ its concept.

A database that confirms to an E-R diagram can be represented by a collection of tables in the
relational system. The mapping of E-R diagram to the entities are:

 Attributes
 Relations
o Many-to-many
o Many-to-one
o One-to-many
o One-to-one
 Weak entities
 Sub-type and super-type

The entities and their relationship between them are shown using the following conventions.

Department Of Computer Science and Applications, Bangalore University Page 24


ONLINE GROCERY SHOPPING

Product id User id
User id
Product
name
Product

Loin User Orders Product Photo


name

Price
Email id Mobile no Description

Order id

Department Of Computer Science and Applications, Bangalore University Page 25


ONLINE GROCERY SHOPPING

7. Database Tables

7.1 PRODUCT TABLE:

7.2 ORDERS TABLE:

7.3 ADMIN TABLE:

Department Of Computer Science and Applications, Bangalore University Page 26


ONLINE GROCERY SHOPPING

7.4 CUSTOMER TABLE:

Department Of Computer Science and Applications, Bangalore University Page 27


ONLINE GROCERY SHOPPING

8. DFD Diagram

The data flow diagram is one of the most important tools used by system analysis. Data Flow
Diagram are made up of number symbols, which represents system components. Most data
flow modeling methods use four kinds of symbols, these symbols are used to prevent four
kind of system components. Processes, data flow, data stores and external entities Circles in
DFD represents processes. Data flow is represented by a thin line in the DFD and each data
store has a unique name andsquare or rectangle represents external entities.

To construct a data flow diagram, we use:

 Arrows
 Circles
 Open end Box
 Squares

1) LOGIN DFD

LOGIN

DB

ENTER USER CHECK


USER NAME VALIDITY
&pass word
pppppp
IF YES
MAIN PAGE

Department Of Computer Science and Applications, Bangalore University Page 28


ONLINE GROCERY SHOPPING

2) REGISTRATION DFD

REGIST
RATION

DB

USER DETAILS CHECK

VALIDITY

SUCCESSFUL

LOGIN PAGE

Department Of Computer Science and Applications, Bangalore University Page 29


ONLINE GROCERY SHOPPING

3) ADMIN DFD

ADD PRODUCT

ADMIN DELETE PRODUCT


pppPPpPPPPRO
DUCT
VIEW ORDERS

Department Of Computer Science and Applications, Bangalore University Page 30


ONLINE GROCERY SHOPPING

9. Source Code

10. Screen Shots

Welcome page:

Coding: <!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

Department Of Computer Science and Applications, Bangalore University Page 31


ONLINE GROCERY SHOPPING

<title>welcome</title>

<style>

body{

background-image:url("../final/bs.svg");

a{

display:inline-block;

text-decoration: none;

padding:10px 20px;

.ab{

background-color:rgb(205, 230, 182);

width:200px;

border-radius: 15px;

margin-left:25%;

.ub{

background-color:rgb(230, 209, 182);

width:200px;

border-radius: 15px;
Department Of Computer Science and Applications, Bangalore University Page 32
ONLINE GROCERY SHOPPING

float:left;

margin-left:15%;

.main{

height:350px;

h1{

font-size: 50px;

font-family: cursive;

</style>

</head>

<body>

<div class="main">

<h1><marquee behavior="alternate">WELCOME TO ONLNE <br>GROCERY


SHOPPING</marquee></h1>

</div>

<div class="customer">

<a href="index.php" class="ub"><center>CUSTOMER


LOGIN</center></a>

Department Of Computer Science and Applications, Bangalore University Page 33


ONLINE GROCERY SHOPPING

</div>

<div class="admin">

<a href="admin/index.php" class="ab"><center>ADMIN


LOGIN</center></a>

</div>

</body>

</html>

Login page:

Department Of Computer Science and Applications, Bangalore University Page 34


ONLINE GROCERY SHOPPING

Coding: <?php

session_start();

require('connect.php');

$firstname='firstname';

if($_POST != null){

$firstname = $_POST['firstname'];

$password = $_POST['password'];

$sql = "select * from customers where firstname='$firstname' and


password='$password' ";

$result = mysqli_query($conn, $sql);

$count = mysqli_num_rows($result);

if($count == 1){

Department Of Computer Science and Applications, Bangalore University Page 35


ONLINE GROCERY SHOPPING

while($row = mysqli_fetch_array($result)){

$firstname = $row['firstname'];

$id = $row['id'];

$_SESSION['user_id'] = $firstname;

header('Location: ../index.php');

?>

Department Of Computer Science and Applications, Bangalore University Page 36


ONLINE GROCERY SHOPPING

Signup page:

Coding:

<?php

session_start();

require('connect.php');

$firstname='firstname';

Department Of Computer Science and Applications, Bangalore University Page 37


ONLINE GROCERY SHOPPING

$lastname='lastname';

$address='address';

$date='date';

$phone='phone';

$email='email';

if($_POST != null){

$firstname = $_POST['first'];

$lastname = $_POST['last'];

$address = $_POST['add'];

$date = $_POST['dob'];

$phone = $_POST['phone'];

$email = $_POST['email'];

$password = $_POST['pass'];

$sql = "INSERT INTO customers (`firstname`, `lastname`, `address`, `DOB`,


`phone`, `email`, `password`)

Department Of Computer Science and Applications, Bangalore University Page 38


ONLINE GROCERY SHOPPING

VALUES
('$firstname','$lastname','$address','$date','$phone','$email','$password')";

if ($conn->query($sql) === TRUE) {

echo "New record created successfully";

} else {

echo "Error: " . $sql . "<br>" . mysqli_error($conn);

?>

Home page:

Coding:

<?php
session_start();

Department Of Computer Science and Applications, Bangalore University Page 39


ONLINE GROCERY SHOPPING

if ( isset( $_SESSION['user_id'] ) ) {
// Grab user data from the database using the user_id
// Let them access the "logged in only" pages
} else {
// Redirect them to the login page
header("Location: db/login.php");
}

$connect = mysqli_connect("localhost", "root", "", "testing");

?>

Product page:

Department Of Computer Science and Applications, Bangalore University Page 40


ONLINE GROCERY SHOPPING

Admin Login:

Coding: <?php
session_start();

require('../db/connect.php');
$firstname='firstname';

if($_POST != null){
$firstname = $_POST['firstname'];
$password = $_POST['password'];
}

Department Of Computer Science and Applications, Bangalore University Page 41


ONLINE GROCERY SHOPPING

$sql = "select * from admin where firstname='$firstname' and


password='$password' ";

$result = mysqli_query($conn, $sql);

$count = mysqli_num_rows($result);

if($count == 1){

while($row = mysqli_fetch_array($result)){
$firstname = $row['firstname'];

$id = $row['id'];

$_SESSION['user_id'] = $firstname;

}
// echo $username;
// exit();

header('Location: index.php');
}else{
echo "login details are not correct";
}

Department Of Computer Science and Applications, Bangalore University Page 42


ONLINE GROCERY SHOPPING

?>

ADMIN PANEL

Coding:
<?php
// You'd put this code at the top of any "protected" page you create

// Always start this first


session_start();
if ( isset( $_SESSION['user_id'] ) ) {
// Grab user data from the database using the user_id

Department Of Computer Science and Applications, Bangalore University Page 43


ONLINE GROCERY SHOPPING

// Let them access the "logged in only" pages


} else {
// Redirect them to the login page
header("Location: login.php");
}

$connect = mysqli_connect("localhost", "root", "", "testing");

?>

Department Of Computer Science and Applications, Bangalore University Page 44


ONLINE GROCERY SHOPPING

Add product:

Coding: <?php
session_start();

require('../db/connect.php');
$id='id';
$name='name';
$image='image';
$price='price';

if($_POST != null){
$id = $_POST['id'];
$name = $_POST['name'];
$image = $_POST['image'];
$price = $_POST['price'];
}

Department Of Computer Science and Applications, Bangalore University Page 45


ONLINE GROCERY SHOPPING

$sql = "INSERT INTO tbl_product (`id`, `name`, `image`, `price`)


VALUES ('$id','$name','$image','$price')";

if ($conn->query($sql) === TRUE) {


} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
?>

Delete Product:

Coding:
<?php
$servername = "localhost";
$username = "root";
$password = "";

Department Of Computer Science and Applications, Bangalore University Page 46


ONLINE GROCERY SHOPPING

$dbname = "testing";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}

if($_POST['productid'] != null){
$productid = $_POST['productid'];
}

$sql = "DELETE FROM tbl_product WHERE category=$productid";

if (mysqli_query($conn, $sql)) {
echo '<script>window.location="index.php"</script>' ;
} else {
echo "Error deleting record: " . mysqli_error($conn);
}

mysqli_close($conn);
?>
<style>
body{
Department Of Computer Science and Applications, Bangalore University Page 47
ONLINE GROCERY SHOPPING

background-image:url("../images/dg.svg");
}

Orders page:

coding: <?php
session_start();
echo "<b><u>".":"." "."id"." ".":"." "."name"." ".":"." "."product"." ".":"."
"."price"." ".":"."<br>"."</b></u>";
require('../db/connect.php');

if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

$sql = "select * from orders";


$result = $conn->query($sql);

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
Department Of Computer Science and Applications, Bangalore University Page 48
ONLINE GROCERY SHOPPING

echo ":"." ".$row["order_id"]." ".":".":"." ".$row["customer_name"] ."


".":".":"." ". $row["product"] ." ".":".":"." ".$row["price"] ." ".":"." "."<br>";
}
} else {
echo "0 results";
}
$conn->close();

?>

11. Testing:
Testing performs a very critical role for quality assurance and ensuring the reliability of the
software. The success of testing for errors in program depends critically on the test cases.
The basic levels of testing are:
1.Unit testing
2.Integration testing
3.System testing
4.Acceptance testing

SYSTEM TESTING
Software Testing is a critical element of software quality assurance and represents the
ultimate review of specification, design and coding. Testing presents an interesting anomaly
for the software. The testing phase involves testing of a system using various test data.
Preparation of the test data plays a vital role in the system testing. After preparation the test
data, the system under study is tested using those test data. Errors were found and corrected

Department Of Computer Science and Applications, Bangalore University Page 49


ONLINE GROCERY SHOPPING

by using the following testing steps and corrections are recorded for future reference. Thus,
series of testing is performed on the system before it is ready for implementation.
The development of software system involves a series of production activities where
opportunities for injection of human errors are enormous. Errors may begin to occur at the
very inception of the process where the objectives may be enormously or imperfectly
specified as well in later design and development stages. Because of human inability to
perform and communicate with perfection, software development is followed by assurance
activity.
Quality assurance is the review of software products and related documentation for
completeness, correctness, reliability and maintainability. And of course it includes
assurances that the system meets the specification and the requirements for the intended use
and performance. The various levels of quality assurance are described in the following
sections.

TEST CASE DESIGN


The test case design for software should be done in such a way that the errors can be found
out with a minimum amount of time and effort. A test case is a set of data that the system
will process as normal as input. Mainly there are two methods for the test case design-Black
box tests and White box Testing.

BLACK BOX TESTING


This method focuses on the functional requirements of the software. It attempts to find out
the errors of the following categories-incorrect and missing functions, interface errors, errors
in data structures or external database access, performance errors and initialization and
termination errors.

WHITE BOX TESTING


This method is also called path testing, is a test design method that uses the control structure
of the procedural design to derive test cases. It is predicted on a close examination of
procedural design. Logical paths through which the software are tested by providing test
cases that exercise specific sets of conditions and or loops.
In the case of the present projects, both the White box testing and the Black box testing were
conducted successfully. The functionality of the software is also tested. All loops and

Department Of Computer Science and Applications, Bangalore University Page 50


ONLINE GROCERY SHOPPING

conditional statements of the software were executed correctly within their operations
bounds. Test cases which will result in the execution of every instruction in the modules
where developed. All the transaction paths were tested to identify and correct the errors
occurred.
Mainly there are two levels of testing, namely Unit testing and Integration Testing.

TESTING STRATEGY
An initial testing strategy is developed upon completion of the Analysis stage and is refined
and updated during the Design and Build stages of the project. The testing strategies
followed in the project are as follows:

UNIT TESTING
Unit testing focuses on verification effort on the smallest unit of software design module.
Using the unit test plans. Prepared in the design phase of the system as a guide, important
control paths are tested. Boundary conditions were checked. All independent paths were
exercises to ensure that all statements in the module are executed at least once and all error
handling paths were test. Each unit was thoroughly tested to check if it might fall in any
possible situation. This testing was carried out during the programming itself. At the end of
this testing phase, each unit was found to be working satisfactorily, as regard to the output
from the module.

INTEGRATION TESTING
Data can be lost across an interface one module can have an adverse effect on another’s sub
functions, when combined may not produce the desired major function; global data structures
can be present problems. Integration testing is a symmetric technique for constructing tests
to uncover errors associated with the interface. All modules are combined in this testing step.
Then the entire program was tested as a whole.

VALIDATION TESTING
At the culmination of the integration testing, the software was completely assembled as a
package, interfacing errors have been uncovered and corrected and a final series of software
validation began. Here we test the system in a manner that can be reasonably expected by
customer, the system was tested against system requirement.

Department Of Computer Science and Applications, Bangalore University Page 51


ONLINE GROCERY SHOPPING

OUTPUT TESTING
After performing validation test the next phase in output test of the system, since no system
could be useful if it does not produce the desired output in a desired format. By considering
the format of the report/output, output/ report is generated or displayed and is tested. Here
output format is considered in two ways: one is the screen and other is a printed form.

TESTING PROCESS
First thing in the testing process is to make plans. In the test plan, test cases are selected to
ensure that there ii\s an error in the program then it is executed by one of the test cases. The
success of testing depends critically on these test cases selected.

TEST CASE SPECIFICATION


It is the major activity in the testing process. Test cases are specified for testing each unit, the
specification gives all the test cases inputs to be used and the outputs expected for these test
cases.

12. CONCLUSION:
The project entitled Online shopping system was completed successfully.
The system has been developed with much care and free of errors and at the same time it is
efficient and less time consuming. The purpose of this project was to develop a web
application and an android application for purchasing items from a shop.
This project helped us in gaining valuable information and practical knowledge on
several topics like designing web pages using html & css, usage of responsive templates,
designing of android applications, and management of database using mysql . The entire
system is secured. Also the project helped us understanding about the development phases
of a project and software development life cycle. We learned how to test different features of
a project.
This project has given us great satisfaction in having designed an application which can
be implemented to any nearby shops or branded shops selling various kinds of products by
simple modifications

Department Of Computer Science and Applications, Bangalore University Page 52


ONLINE GROCERY SHOPPING

15.REFERENCES

[1] JavaScript Enlightenment,Cody Lindley-First Edition, based on JavaScript 1.5, ECMA-


262, Edition

[2] Mc GrawHill’s , Java : The complete reference 7thEdition, Herbert Schildit

[3] Complete CSS Guide ,Maxine Sherrin and John Allsopp-O'Reilly Media; September 2012

[4] http://www.w3schools.com/html/defualt.asp, http://www.w3schools.com/css/default.asp,


http://www.w3schools.com/js/default.asp

Department Of Computer Science and Applications, Bangalore University Page 53


ONLINE GROCERY SHOPPING

CHAPTER-4

PERT CHART

Planning and Scheduling

1. FEASIBILITY ANALYSIS

Whatever we think need not be feasible. It is wise to think about the feasibility of any
problem we undertake. Feasibility is the study of impact, which happens in the organization
by the development of a system. The impact can be either positive or negative. When the
positives nominate the negatives, then the system is considered feasible. Here the feasibility
study can be performed in two ways such as technical feasibility and Economical Feasibility.

Technical feasibility:

We can strongly says that it is technically feasible, since there will not be much
difficulty in getting required resources for the development and maintaining the system as
well. All the resources needed for the development of the software as well as the maintenance
of the same is available in the organization here we are utilizing the resources which are
available already.

Economical Feasibility:

Development of this application is highly economically feasible. The organization


need not spend much money for the development of the system already available. The only
thing is to be done is making an environment for the development with an effective
supervision. If we are doing so, we can attain the maximum usability of the corresponding
resources. Even after the development, the organization will not be in a condition to invest
more in the organization. Therefore, the system is economically feasible.

Department Of Computer Science and Applications, Bangalore University Page 54


ONLINE GROCERY SHOPPING

SYSTEM DESIGN

INPUT DESIGN
Input design is the process of converting user-oriented input to a computer
based format. Input design is a part of overall system design, which requires very
careful attention. Often the collection of input data is the most expensive part of the
system. The main objectives of the input design are.
1. Produce cost effective method of input.
2. Achieve highest possible level of accuracy
3. Ensure that the input is acceptable to and understood by the staff.

Input Data
The goal of designing input data is to make enter easy, logical and free from
errors as possible. The entering data entry operators need to know the allocated space
field; field sequence and which must match with that in the source document. The

Department Of Computer Science and Applications, Bangalore University Page 55


ONLINE GROCERY SHOPPING

format in which the data fields are entered should be given in the input form. Here
data enter is online; it makes use of processor that accepts commands and data from
the operator through a keyboard. The input required is analyzed by the processor. It is
then accepted or rejected. Input stages include the following processes
o Data Recording
o Data Transcription
o Data Conversion
o Data Verification
o Data Control
o Data Transmission
o Data Correction

One of the aims of the system analyst must be to select data capture method and
devices, which reduce the number of stages so as to reduce both the changes of errors
and the cost. Input types, can be characterized as.

 External
 Internal
 Operational
 Computerized
 Interaction

Input files can exist in document from before being input to the computer. Input
design is rather complex since it involves producers for capturing data as well as
inputting it to the computer.

ER DIAGRAM

Department Of Computer Science and Applications, Bangalore University Page 56


ONLINE GROCERY SHOPPING

LIBRARY MANAGEMENT
SYSTEM

LOGIN

INTRODUCTION REGISTRATION BOOK RETURN LOGOUT

MASTER ENTRIES BOOK ISSUE REPORT

MASTER ENTRIES

COLLEGE COURSE ACCADAMIC YEAR DEPARTMENT

REGISTRATION YEAR SEMISTER

Department Of Computer Science and Applications, Bangalore University Page 57


ONLINE GROCERY SHOPPING

REGISTRATION

STUDENT STAFF REGISTRATION BOOK REGISTRATION


REGISTRATION

MODIFICATION DELETION

Department Of Computer Science and Applications, Bangalore University Page 58


ONLINE GROCERY SHOPPING

ER DIAGRAM

PASSWORD
NAME

USER ADMIN

MODIFY, ISSUE/ MODIFY A UDATE, ISSUE/


RECIEVE BOOKS RECIEVE BOOKS A

ID
ID
STUDENTS TEACHER
REG NO

STAFF
NAME

USE A DEPARTMENT
USE A
PHN NO

Department Of Computer Science and Applications, Bangalore University Page 59


ONLINE GROCERY SHOPPING

COST AUTHOR NAME


ID

DATA FLOW DIAGRAM

LIBRARIAN / ADMINISTRATOR

LOGIN

SYSTEM

LOGIN MASTER ENTRIES BOOK ISSUE REPORT

Department Of Computer Science and Applications, Bangalore University Page 60


ONLINE GROCERY SHOPPING

INTRODUCTION REGISTRATION BOOK RETURN LOGOUT

DATA BASE

USE CASE DIAGRAM

Book details and member


Modify

Details

Department Of Computer Science and Applications, Bangalore University Page 61


ONLINE GROCERY SHOPPING

Administrator

Data base
Queries

Guest Account

Check book
availability

SEQUENCE DIAGRAMS

SEQUENCE DIAGRAM FOR ADD/MODIFY BOOK


OR MEMBER

Department Of Computer Science and Applications, Bangalore University Page 62


ONLINE GROCERY SHOPPING

ADMINISTRATOR SYSTEM DATABASE

1. REQUEST FOR ADD/MODIFY BOOK OR MEMBER

2. ADD/MODIFY BOOK OR MEMBER FORM

3. FILL IN DETAILS

4. SUBMIT

5. SHOW UPDATED DETAILS

6. STORE FULL DETAILS

SEQUENCE DIAGRAM FOR QUERYING DETAILS:


Department Of Computer Science and Applications, Bangalore University Page 63
ONLINE GROCERY SHOPPING

ADMISTRATOR SYSTEM DATABASE

Queries for books or members fetching details for books and members

Display the status

Department Of Computer Science and Applications, Bangalore University Page 64


ONLINE GROCERY SHOPPING

DATABASE DESIGN

The general theme behind a database is to handle information as an integrated whole.


A database is a collection of interrelated data stored with minimum redundancy to serve
many users quickly and effectively. After designing input and output, the analyst must
concentrate on database design or how data should be organized around user requirements.
The general objective is to make information access, easy quick, inexpensive and flexible for
other users. During database design the following objectives are concerned:-

 Controlled redundancy
 Data independence
 Accurate and integrating
 More information at low cost
 Recovery from failure
 Privacy and security
 Performance
 Ease of learning and use

TABLE NAME: LOGIN

Column Name Data type Length Allow Null


uname Varchar 50
pword varchar 50

TABLE NAME: STUDENT REGISTRATION

Column Name Data type Length Allow Nulls


Student name varchar 50 

Department Of Computer Science and Applications, Bangalore University Page 65


ONLINE GROCERY SHOPPING

Father name varchar 50


Mother name varchar 50
Address nvarchar 100
E-mail nvarchar 50
College name nvarchar 50
College Code nvarchar 50
Course nvarchar 50
Acc year nvarchar 50
Year of study nvarchar 50
Std reg no nvarchar 50
Std ID int
Phone no nvarchar 50

TABLE NAME: STAFF REGISTRATION

Column Name Data type Length Allow Nulls


College name nvarchar 50 
Staff name nvarchar 50
Designation nvarchar 50
Department nvarchar 50
Address nvarchar 50
E-mail ID nvarchar 50
Staff ID int 50
Phone no nvarchar 50

TABLE NAME: DEPARTMENT

Column Name Data type Length Allow Nulls


Department name nvarchar 50 

TABLE NAME: COLLEGE REGISTRATION


Department Of Computer Science and Applications, Bangalore University Page 66
ONLINE GROCERY SHOPPING

Column Name Data type Length Allow Nulls


College name nvarchar 50
College code nvarchar 50
Address nvarchar Max
Phone no nvarchar 50

TABLE NAME: COURSE

Column Name Data type Length Allow Nulls


College name varchar 50
Course varchar 50

TABLE NAME: BOOK ISSUE

Column Name Data type Length Allow Nulls


Student ID varchar 200 
Student name varchar 200
College name varchar 200
Course varchar 50
Year of study varchar 50
Student phone no varchar 50
Book title varchar 200
Author varchar 200
Book ID varchar 50
Issue date date time -
Return date date time -

OUTPUT DESIGN

Outputs from computer systems are required primarily to communicate the results of
processing to users. They are also used to provide a permanent copy of these results for later
consultation. Computer is the most important and direct source of information to the users.

Department Of Computer Science and Applications, Bangalore University Page 67


ONLINE GROCERY SHOPPING

Designing computer output should proceed in an organized well throughout the manner. The
right output must be available for the people who find the easy of use. The outputs have
been designed during the logical design stages. If not, they should defined at the beginning of
the output designing terms of types of output connect, format, response etc.

Various types of outputs are

 External output
 Internal output
 Operational outputs
 Interactive outputs
 Turn around outputs

All screens are informative and interactive in such a way that the user can full fill his
requirements through asking queries.

Department Of Computer Science and Applications, Bangalore University Page 68


ONLINE GROCERY SHOPPING

2. SYSTEM IMPLEMENTATION

Implementation is the stage in the project where the theoretical designs


turned into a working system. The implementation phase constructs, installs and
operates the new system. The most crucial stage in achieving a news successful
system is that it will work efficiently and effectively.

There are several activities involved while implementing a new project.


They are

 End user training


 End user education
 Training on the application software
 System design
 Parallel run and to new system
 Post implementation review

End user training:

The successful implementation of the new system will purely depend, upon the
involvement of the officers working in that department. The officers will be
imparted the necessary training on the new technology.

End User Education:

The education of the end user start after the implementation and testing is over. When the
system is found to be more difficult to understand and complex, more effort is put to educate
the end user to make them aware of the system, giving them lectures about the new system
and providing them necessary documents and materials about how the system can do this.

Department Of Computer Science and Applications, Bangalore University Page 69


ONLINE GROCERY SHOPPING

Training of application software:

After providing the necessary basic training on the computer awareness, the users will have
to be trained upon the new system such as the screen flows and screen flow design type of
help on the screen, type of errors while entering the data, the corresponding validation check
at each entry and the way to correct the data enter. It should then cover information needed
by the specific user or group to use the system.

Post Implementation View:

The department is planning a method to know the states of the past implementation process.
For that regular meeting will be arranged by the concerned officers about the implementation
problem and succes

SOURCE CODE

LOGIN

CODING

Department Of Computer Science and Applications, Bangalore University Page 70


ONLINE GROCERY SHOPPING
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Timers;
public partial class Default2 : System.Web.UI.Page
{
SqlConnection cn = new SqlConnection("data Source=chitrakoota-PC;initial
catalog=data;integrated security=true");
SqlCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
lblerr.Visible = false;
}
protected void Button1_Click(object sender, EventArgs e)
{

cmd = new SqlCommand("select * from student_login where uname = '" + txtname.Text


+ "' and pword='" + txtpwd.Text + "'", cn);
cn.Open();
lblerr.Visible = false;
if(cmd.ExecuteScalar()!=null)
{

Response.Redirect("introduction.aspx");
}
else
{
lblerr.Visible = true;
lblerr.Text = "invalid login";
}
cn.Close();
}

protected void txtname_TextChanged(object sender, EventArgs e)


{

Department Of Computer Science and Applications, Bangalore University Page 71


ONLINE GROCERY SHOPPING
}

INTRODUCTION

MASTER ENTRIES

I. COLLEGE REGISTRATION

Department Of Computer Science and Applications, Bangalore University Page 72


ONLINE GROCERY SHOPPING

II. COURSE

Department Of Computer Science and Applications, Bangalore University Page 73


ONLINE GROCERY SHOPPING

III. ACCADEMIC YEAR

IV. YEAR / SEMISTER

Department Of Computer Science and Applications, Bangalore University Page 74


ONLINE GROCERY SHOPPING

V. DEPARTMENT

CODING

 College registration code


 View code
 Deletion code

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

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

Department Of Computer Science and Applications, Bangalore University Page 75


ONLINE GROCERY SHOPPING
{
SqlConnection cn = new SqlConnection("server=chitrakoota-
PC;database=data;integrated security=true");
SqlCommand cmd = new SqlCommand();
public void grid()
{
cmd = new SqlCommand(" select * from col_reg", cn);
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
GridView2.DataSource = dt;
DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
Label1.Visible = false;
}
protected void Button1_Click(object sender, EventArgs e)
{
string str = "insert into col_reg(col_name,col_code,address,ph_no) values('" +
txtcolname.Text + "','" + txtcolcode.Text + "','" + txtaddress.Text + "','" +
txtph_no.Text + "')";
cmd = new SqlCommand(str, cn);
try
{
cn.Open();
cmd.ExecuteNonQuery();

finally
{
cn.Close();
Label1.Visible = true;
Label1.Text = "saved succeessfully";
}
grid();
GridView2.Visible = true;
}
protected void Button2_Click(object sender, EventArgs e)
{
grid();

Department Of Computer Science and Applications, Bangalore University Page 76


ONLINE GROCERY SHOPPING
GridView2.Visible = true;
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{

}
protected void Button3_Click(object sender, EventArgs e)
{
try
{
cmd = new SqlCommand("delete from Col_Reg where col_code='" +
txtcolcode.Text + "'", cn);
cn.Open();
cmd.ExecuteNonQuery();
Label1.Visible = true;
Label1.Text = "Deleted sucessfully";
cn.Close();
}
catch (Exception ex)
{
Response.Write(ex);
}
grid();
}
protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
{
txtcolcode.Text = GridView2.SelectedRow.Cells[2].Text;
txtcolname.Text = GridView2.SelectedRow.Cells[1].Text;
txtaddress.Text = GridView2.SelectedRow.Cells[3].Text;
txtph_no.Text = GridView2.SelectedRow.Cells[4].Text;
}
}

REGISTRATION

1. STUDENT REGISTRATION
 STUDENT MODIFY
 STUDENT DELETION
2. STAFF REGISTRATION

Department Of Computer Science and Applications, Bangalore University Page 77


ONLINE GROCERY SHOPPING

 STAFF MODIFY
 STAFF DELETION
3. BOOK REGISTRATION
 MODIFY
 DELETION

STUDENT REGISTRATION

 STUDENT MODIFY

Department Of Computer Science and Applications, Bangalore University Page 78


ONLINE GROCERY SHOPPING

 STUDENT DELETION

Department Of Computer Science and Applications, Bangalore University Page 79


ONLINE GROCERY SHOPPING

STAFF REGISTRATION

 STAFF MODIFY

Department Of Computer Science and Applications, Bangalore University Page 80


ONLINE GROCERY SHOPPING

 STAFF DELETION

Department Of Computer Science and Applications, Bangalore University Page 81


ONLINE GROCERY SHOPPING

BOOK REGISTRATION

 MODIFY

Department Of Computer Science and Applications, Bangalore University Page 82


ONLINE GROCERY SHOPPING

 DELETION

CODING

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

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


{
SqlConnection cn = new SqlConnection("data Source=chitrakoota-PC;initial
catalog=data;integrated security=true");

Department Of Computer Science and Applications, Bangalore University Page 83


ONLINE GROCERY SHOPPING
SqlCommand cmd = new SqlCommand();
SqlDataReader rd,reader;

protected void Page_Load(object sender, EventArgs e)


{
if (!Page.IsPostBack)
{
disp_col();
disp_Accademic_Year();
disp_course();
}
}
protected void Button1_Click(object sender, EventArgs e)
// year_study,
{

string str = "select stud_id from student_registration where stud_id in(select


max(stud_id) from student_registration)";
SqlCommand cmd = new SqlCommand(str, cn);
// int status = 0;
int count = 0;
try
{
cn.Open();
reader = cmd.ExecuteReader();
while (reader.Read())
{
string status1 = reader["stud_id"].ToString();
count = Int32.Parse(status1) + 1;
Class1.Student_ID = count.ToString();

}
cn.Close();
}
catch (Exception ex)
{
Response.Write(ex);
}

Department Of Computer Science and Applications, Bangalore University Page 84


ONLINE GROCERY SHOPPING

string str1 = "insert into student_registration values('" + TextBox1.Text +


"','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" +
TextBox6.Text + "','" + DropDownList1.SelectedItem.Text + "','" + TextBox7.Text +
"','" + DropDownList2.SelectedItem.Text + "','" + DropDownList3.SelectedItem.Text +
"','" + DropDownList4.SelectedItem.Text + "','" + TextBox8.Text + "','" + count +
"','" + TextBox5.Text + "')";
try
{
cmd = new SqlCommand(str1, cn);
cn.Open();
cmd.ExecuteNonQuery();
Label1.Visible = true;
Label1.Text = "Saved successfully";
Label2.Visible = true;
Label2.Text = Class1.Student_ID;

}
finally
{
cn.Close();

clear();
}
}

void disp_col()
{
DropDownList1.Items.Add("Select");
string str = "select * from col_reg";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList1.Items.Add(rd["col_name"].ToString());

}
cn.Close();
}

Department Of Computer Science and Applications, Bangalore University Page 85


ONLINE GROCERY SHOPPING

void disp_code()
{

string str = "select *from col_reg where col_name='" +


DropDownList1.SelectedItem.Text + "'";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
TextBox7.Text = rd["col_code"].ToString();

}
cn.Close();

void disp_course()
{
DropDownList2.Items.Clear();

DropDownList2.Items.Add("Select");
string str = "select *from course where col_name='" +
DropDownList1.SelectedItem.Text + "'";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList2.Items.Add(rd["course"].ToString());

}
cn.Close();

void disp_Accademic_Year()
{
DropDownList3.Items.Clear();

DropDownList3.Items.Add("Select");

Department Of Computer Science and Applications, Bangalore University Page 86


ONLINE GROCERY SHOPPING
string str = "select distinct acc_year from Accademic_Year";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList3.Items.Add(rd["acc_year"].ToString());

}
cn.Close();

void disp_year_sem()
{
DropDownList4.Items.Clear();

DropDownList4.Items.Add("Select");
string str = "select *from year where col_name='" +
DropDownList1.SelectedItem.Text + "'";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList4.Items.Add(rd["year_sem"].ToString());

}
cn.Close();

void clear()
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";

Department Of Computer Science and Applications, Bangalore University Page 87


ONLINE GROCERY SHOPPING
DropDownList1.SelectedItem.Text = "";
DropDownList2.SelectedItem.Text = "";
DropDownList3.SelectedItem.Text = "";
DropDownList4.SelectedItem.Text = "";

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)


{
disp_code();
disp_course();
disp_year_sem();
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("stud_delete.aspx");

}
protected void Button3_Click(object sender, EventArgs e)
{
Response.Redirect("std_modify.aspx");
}
}

MODIFICATION CODE

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 Default2 : System.Web.UI.Page


{
SqlConnection cn = new SqlConnection("server=chitrakoota-
PC;database=data;integrated security=true");
SqlConnection cv = new SqlConnection("server=chitrakoota-
PC;database=data;integrated security=true");

Department Of Computer Science and Applications, Bangalore University Page 88


ONLINE GROCERY SHOPPING
SqlCommand cmd;
SqlDataReader rd;
string st;
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button2_Click(object sender, EventArgs e)
{

string str = "select * from student_registration where stud_id='" +


txtstd.Text + "' ";
cmd = new SqlCommand(str, cn);
cn.Open();
rd = cmd.ExecuteReader();
try
{
while (rd.Read())
{
Label10.Visible = false;
txtstd.Text = rd["stud_id"].ToString();
txtname.Text=rd["student_name"].ToString();
txtfname.Text = rd["father_name"].ToString();
Txtmname.Text = rd["mother_name"].ToString();
TextBox6.Text = rd["phone_no"].ToString();
TextBox8.Text = rd["code"].ToString();
TextBox9.Text = rd["std_reg_no"].ToString();
DropDownList1.Items.Add(rd["col_name"].ToString());
st = rd["course"].ToString();

DropDownList2.Items.Add(rd["course"].ToString());
DropDownList3.Items.Add(rd["acc_year"].ToString());
DropDownList4.Items.Add(rd["year_study"].ToString());
TextBox6.Text = rd["phone_no"].ToString();
TextBox7.Text = rd["E_Mail"].ToString();
DropDownList1.Text = rd["col_name"].ToString();
TextBox5.Text = rd["address"].ToString();

SqlCommand cmd1=new SqlCommand("select distinct course from course",cv);

Department Of Computer Science and Applications, Bangalore University Page 89


ONLINE GROCERY SHOPPING
cv.Open();
rd = cmd1.ExecuteReader();
while (rd.Read())
{
DropDownList2.Items.Add(rd["course"].ToString());
DropDownList2.SelectedItem.Text = st;
}
cv.Close();

}
catch (Exception ex)
{
Response.Write(ex);
}
if (Label10.Visible == false)
{
Label10.Visible = true;
Label10.Text = "successfull";
}
else
{
Label10.Visible = true;

Label10.Text = "unsuccessfull";
txtstd.Text= "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox5.Text = "";
}

}
void disp_col()
{
DropDownList1.Items.Add("Select");
string str = "select * from col_reg";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList1.Items.Add(rd["col_name"].ToString());

Department Of Computer Science and Applications, Bangalore University Page 90


ONLINE GROCERY SHOPPING
}
cn.Close();
}

void disp_code()
{

string str = "select *from col_reg where col_name='" +


DropDownList1.SelectedItem.Text + "'";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
TextBox7.Text = rd["col_code"].ToString();

}
cn.Close();

void disp_course()
{
DropDownList2.Items.Clear();

DropDownList2.Items.Add("Select");
string str = "select *from course where col_name='" +
DropDownList1.SelectedItem.Text + "'";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList2.Items.Add(rd["course"].ToString());

}
cn.Close();

void disp_Accademic_Year()
{

Department Of Computer Science and Applications, Bangalore University Page 91


ONLINE GROCERY SHOPPING
DropDownList3.Items.Clear();

DropDownList3.Items.Add("Select");
string str = "select distinct acc_year from Accademic_Year";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList3.Items.Add(rd["acc_year"].ToString());

}
cn.Close();

void disp_year_sem()
{
DropDownList4.Items.Clear();

DropDownList4.Items.Add("Select");
string str = "select *from year where col_name='" +
DropDownList1.SelectedItem.Text + "'";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList4.Items.Add(rd["year_sem"].ToString());

}
cn.Close();

void clear()
{

TextBox5.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";

Department Of Computer Science and Applications, Bangalore University Page 92


ONLINE GROCERY SHOPPING
DropDownList1.SelectedItem.Text = "";
DropDownList2.SelectedItem.Text = "";
DropDownList3.SelectedItem.Text = "";
DropDownList4.SelectedItem.Text = "";

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)


{
disp_code();
disp_course();
disp_year_sem();
}
protected void Button1_Click(object sender, EventArgs e)
{
// ,stud_id,phone_no ,='"+TextBox7.Text+"'

string str = "update student_registration set student_name='"+


txtname.Text+"',father_name='"+txtfname.Text+"', mother_name='"+
Txtmname.Text+"',address='"+TextBox5.Text+"',phone_no='"+TextBox6.Text+"',E_Mail='"+Te
xtBox7.Text+"',code='"+TextBox8.Text+"',acc_year='"+DropDownList3.Text+"',col_name='"+
DropDownList1.Text+"',year_study='"+DropDownList4.Text+"',std_reg_no='"+TextBox9.Text+
"',course='"+DropDownList2.Text+"'where stud_id ='"+txtstd.Text+"'" ;
SqlCommand cmd = new SqlCommand(str, cn);

try
{
cn.Open();
cmd.ExecuteNonQuery();
Label10.Text = "updated sucessfully";

}
catch (Exception ex)
{
Response.Write(ex);
}
finally
{
cn.Close();
}

Department Of Computer Science and Applications, Bangalore University Page 93


ONLINE GROCERY SHOPPING

}
}

DELETION CODE

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 _Default : System.Web.UI.Page


{
SqlConnection cn = new SqlConnection("server=chitrakoota-
PC;database=data;integrated security=true");
SqlConnection cv = new SqlConnection("server=chitrakoota-
PC;database=data;integrated security=true");
SqlCommand cmd;
SqlDataReader rd;
string st;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string str = "delete from student_registration where stud_id='" +
txtstd_id.Text+ "'";
SqlCommand cmd = new SqlCommand(str, cn);
Label13.Visible = true;
Label13.Text = "Deleted successfully";
try
{
cn.Open();
cmd.ExecuteNonQuery();

Department Of Computer Science and Applications, Bangalore University Page 94


ONLINE GROCERY SHOPPING
catch (Exception ex)
{
Response.Write(ex);
}
finally
{
cn.Close();
clear();
}

}
protected void Button2_Click(object sender, EventArgs e)
{

string str = "select * from student_registration where stud_id='" +


txtstd_id.Text + "' ";
cmd = new SqlCommand(str, cn);
cn.Open();
rd = cmd.ExecuteReader();
try
{
while (rd.Read())
{
Label14.Visible = false;
txtstd_id.Text = rd["stud_id"].ToString();
txtname.Text = rd["student_name"].ToString();
txtfname.Text = rd["father_name"].ToString();
Txtmname.Text = rd["mother_name"].ToString();
TextBox6.Text = rd["phone_no"].ToString();
TextBox8.Text = rd["code"].ToString();
TextBox9.Text = rd["std_reg_no"].ToString();
DropDownList1.Items.Add(rd["col_name"].ToString());
st = rd["course"].ToString();

DropDownList2.Items.Add(rd["course"].ToString());
DropDownList3.Items.Add(rd["acc_year"].ToString());
DropDownList4.Items.Add(rd["year_study"].ToString());
TextBox6.Text = rd["phone_no"].ToString();
TextBox7.Text = rd["E_Mail"].ToString();
DropDownList1.Text = rd["col_name"].ToString();
TextBox5.Text = rd["address"].ToString();

Department Of Computer Science and Applications, Bangalore University Page 95


ONLINE GROCERY SHOPPING
}

SqlCommand cmd1 = new SqlCommand("select distinct course from course",


cv);
cv.Open();
rd = cmd1.ExecuteReader();
while (rd.Read())
{
DropDownList2.Items.Add(rd["course"].ToString());
DropDownList2.SelectedItem.Text = st;
}
cv.Close();

}
catch (Exception ex)
{
Response.Write(ex);
}
if (Label14.Visible == false)
{
Label14.Visible = true;
Label14.Text = "successfull";
}
else
{
Label14.Visible = true;

Label14.Text = "unsuccessfull";
txtstd_id.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox5.Text = "";
}

}
void disp_col()
{
DropDownList1.Items.Add("Select");
string str = "select * from col_reg";
cn.Open();
cmd = new SqlCommand(str, cn);

Department Of Computer Science and Applications, Bangalore University Page 96


ONLINE GROCERY SHOPPING
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList1.Items.Add(rd["col_name"].ToString());

}
cn.Close();
}

void disp_code()
{

string str = "select *from col_reg where col_name='" +


DropDownList1.SelectedItem.Text + "'";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
TextBox7.Text = rd["col_code"].ToString();

}
cn.Close();

void disp_course()
{
DropDownList2.Items.Clear();

DropDownList2.Items.Add("Select");
string str = "select *from course where col_name='" +
DropDownList1.SelectedItem.Text + "'";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList2.Items.Add(rd["course"].ToString());

}
cn.Close();

Department Of Computer Science and Applications, Bangalore University Page 97


ONLINE GROCERY SHOPPING

void disp_Accademic_Year()
{
DropDownList3.Items.Clear();

DropDownList3.Items.Add("Select");
string str = "select distinct acc_year from Accademic_Year";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList3.Items.Add(rd["acc_year"].ToString());

}
cn.Close();

void disp_year_sem()
{
DropDownList4.Items.Clear();

DropDownList4.Items.Add("Select");
string str = "select *from year where col_name='" +
DropDownList1.SelectedItem.Text + "'";
cn.Open();
cmd = new SqlCommand(str, cn);
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList4.Items.Add(rd["year_sem"].ToString());

}
cn.Close();

void clear()
{

Department Of Computer Science and Applications, Bangalore University Page 98


ONLINE GROCERY SHOPPING

TextBox5.Text = "";
TextBox6.Text = "";
TextBox7.Text = "";
TextBox8.Text = "";
DropDownList1.SelectedItem.Text = "";
DropDownList2.SelectedItem.Text = "";
DropDownList3.SelectedItem.Text = "";
DropDownList4.SelectedItem.Text = "";
txtstd_id.Text = "";
txtfname.Text = "";
Txtmname.Text = "";
txtname.Text = "";
TextBox9.Text = "";

BOOK ISSUE

Department Of Computer Science and Applications, Bangalore University Page 99


ONLINE GROCERY SHOPPING

CODING
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 _Default : System.Web.UI.Page


{
SqlConnection cn = new SqlConnection("server=Chitrakoota-
PC;database=data;integrated security=true");
SqlCommand cmd,cmd1,cmd2;
SqlDataReader rd,rd1;
SqlDataAdapter da;
int k=1;
string auth;
string book_id;
string issue_date,return_date;

protected void Page_Load(object sender, EventArgs e)


{

Department Of Computer Science and Applications, Bangalore University Page 100


ONLINE GROCERY SHOPPING
protected void Button1_Click(object sender, EventArgs e)
{
string str = "select * from student_registration where stud_id='" +
txtstdid.Text + "'";
cmd = new SqlCommand(str, cn);
cn.Open();
rd = cmd.ExecuteReader();
try
{
while (rd.Read())
{
Label10.Visible = false;
TextBox10.Text = rd["student_name"].ToString();
txtcourse.Text = rd["course"].ToString();
txtph_no.Text = rd["phone_no"].ToString();
txtemail.Text = rd["E_Mail"].ToString();
txtcolname.Text = rd["col_name"].ToString();
txtaddress.Text = rd["address"].ToString();
TextBox11.Text = rd["year_study"].ToString();

}
}
catch (Exception ex)
{
Response.Write(ex);
}
finally
{
cn.Close();
}
if (Label10.Visible == false)
{
Label10.Visible = true;
Label10.Text = "successfull";
}
else
{
Label10.Visible = true;

Label10.Text = "unsuccessfull";
TextBox10.Text = "";
txtcourse.Text = "";

Department Of Computer Science and Applications, Bangalore University Page 101


ONLINE GROCERY SHOPPING
txtph_no.Text = "";
txtemail.Text = "";
txtcolname.Text = "";
txtaddress.Text = "";
}

}
protected void txtstdno_TextChanged(object sender, EventArgs e)
{

}
protected void Button2_Click(object sender, EventArgs e)
{
getdate();

string str1 = "Select


title,author,publisher,pub_year,book_id,compartment,row,department,msg,status from
book_registration where title='" + txtaddress0.Text + "' and status=0 ";

cmd1 = new SqlCommand(str1, cn);


cmd2 = new SqlCommand(str1, cn);
cn.Open();
//SqlDataAdapter da;
try
{
rd1 = cmd1.ExecuteReader();

while (rd1.Read())
{
k = int.Parse(rd1["status"].ToString());

}
cn.Close();
cn.Open();
if (k == 0)
{

DataTable dt1 = new DataTable();


da = new SqlDataAdapter(cmd2);
da.Fill(dt1);
GridView1.DataSource = dt1;
DataBind();

Department Of Computer Science and Applications, Bangalore University Page 102


ONLINE GROCERY SHOPPING
}
else
{
Label13.Text = "Book is not Available";

}
catch (Exception ey)
{
Response.Write(ey);
}
finally
{
cn.Close();
}

void getdate()
{

issue_date=System.DateTime.Today.ToShortDateString();
return_date=System.DateTime.Today.AddDays(15).ToShortDateString();
TextBox12.Text=issue_date;
TextBox13.Text=return_date;

void getbook()
{
string str = "select * from book_registration where
title='"+txtaddress0.Text+"' and status=0";
cmd = new SqlCommand(str, cn);
cn.Open();
rd = cmd.ExecuteReader();
try
{
while (rd.Read())
{

Department Of Computer Science and Applications, Bangalore University Page 103


ONLINE GROCERY SHOPPING
auth = rd["author"].ToString();
book_id = rd["book_id"].ToString();

}
catch (Exception ex)
{
Response.Write(ex);
}
finally
{
cn.Close();
}
}

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)


{
getbook();

try
{
string str2 = "insert into
Book_Issues(stud_id,stud_name,col_name,course,year_of_study,stud_ph,btitle,author,book
_id,issue_date,return_date) values('" + txtstdid.Text + "','" + TextBox10.Text + "','"
+ txtcolname.Text + "','" + txtcourse.Text + "','" + TextBox11.Text + "','" +
txtph_no.Text + "','" + txtaddress0.Text + "','" + auth + "','" + book_id + "','" +
Convert.ToDateTime(TextBox12.Text) + "','" + Convert.ToDateTime(TextBox13.Text) + "')
";
string str1 = "update book_registration set status=1 where title='" +
txtaddress0.Text + "' and book_id='"+book_id+"' ";
cmd1 = new SqlCommand(str1, cn);
cmd2 = new SqlCommand(str2, cn);
cn.Open();
cmd1.ExecuteNonQuery();
cmd2.ExecuteNonQuery();
}
catch (Exception mm)
{

Department Of Computer Science and Applications, Bangalore University Page 104


ONLINE GROCERY SHOPPING
}

finally
{
cn.Close();
}
}

protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)


{

}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

}
}

BOOK RETURN

Department Of Computer Science and Applications, Bangalore University Page 105


ONLINE GROCERY SHOPPING

CODING

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

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


{
SqlConnection cn = new SqlConnection("Data Source=chitrakoota-PC;Initial
Catalog=data;integrated security=true");
SqlCommand cmd = new SqlCommand();
SqlDataReader rd;
string var;
string book_id;
public void grid()
{
string str = "SELECT *from Book_Issues where stud_Id='" + TextBox1.Text + "'";
cmd = new SqlCommand(str, cn);
DataTable tbl = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);

Department Of Computer Science and Applications, Bangalore University Page 106


ONLINE GROCERY SHOPPING
da.Fill(tbl);
GridView1.DataSource = tbl;
DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
grid();

void no_of_days()
{
double days;

string today;
DateTime ret_date,t;

string str = "select * from book_issues where title='" + TextBox1.Text + "'


";
cmd = new SqlCommand(str, cn);
cn.Open();

try
{
rd = cmd.ExecuteReader();
while (rd.Read())
{

ret_date = Convert.ToDateTime(rd["return_date"]);

today=System.DateTime.Today.ToShortDateString();

t=DateTime.Parse(today);

days=(System.DateTime.Today-t).TotalDays;

Department Of Computer Science and Applications, Bangalore University Page 107


ONLINE GROCERY SHOPPING

}
catch (Exception ex)
{
Response.Write(ex);
}
finally
{
cn.Close();
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
Class1.Return_Book =GridView1.SelectedRow.Cells[1].Text.ToString();
}

void getdetail()
{
string str = "select *from Book_Issues where stud_id='"+TextBox1.Text+"'";

cmd = new SqlCommand(str, cn);


cn.Open();
rd = cmd.ExecuteReader();
try
{
while (rd.Read())
{

book_id=rd["book_id"].ToString();

}
}
catch (Exception ex)
{
Response.Write(ex);
}
finally
{
cn.Close();
}

Department Of Computer Science and Applications, Bangalore University Page 108


ONLINE GROCERY SHOPPING
}
protected void Button2_Click(object sender, EventArgs e)
{
getdetail();
string str = "update Book_Registration set status=0 where book_id='" + book_id
+ "'";
cmd = new SqlCommand(str, cn);
cn.Open();
cmd.ExecuteNonQuery();
Label3.Visible = true;
cn.Close();
grid();
}
}

STUDENT REPORT CODING


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Data.SqlClient;
using CrystalDecisions.Web;
using CrystalDecisions.ReportSource;
using System.Configuration;
using System.Data;

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


{
SqlConnection cn = new SqlConnection("server=chitrakoota-
PC;database=data;integrated security=true");
SqlCommand cmd = new SqlCommand();
SqlDataReader rd;

SqlDataAdapter da;
protected void Page_Load(object sender, EventArgs e)

Department Of Computer Science and Applications, Bangalore University Page 109


ONLINE GROCERY SHOPPING
{
if (!IsPostBack)
{

}
}

void All_Student_report()
{

try
{

SqlCommand cmd = new SqlCommand("select *from student_registration ", cn);


SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "student_registration");
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
ReportDocument rpt = new ReportDocument();
rpt.Load(Server.MapPath("Student_Report.rpt"));
rpt.SetDataSource(ds.Tables["student_registration"]);
CrystalReportViewer1.ReportSource = rpt;
CrystalReportViewer1.DataBind();

catch (Exception ex)


{
Response.Write(ex);
}
finally
{
}

Department Of Computer Science and Applications, Bangalore University Page 110


ONLINE GROCERY SHOPPING

private void Stud_reg()


{
// DropDownList1.Items.Clear();
DropDownList3.Items.Add("Select");
string str = "select distinct std_reg_no from student_registration";
cmd = new SqlCommand(str, cn);
try
{
cn.Open();
rd = cmd.ExecuteReader();
while (rd.Read())
{
DropDownList3.Items.Add(rd["std_reg_no"].ToString());
DataSet ds = new DataSet();
da.Fill(ds, "student_registration");
ReportDocument rpt = new ReportDocument();
rpt.Load(Server.MapPath("Student_Report.rpt"));
rpt.SetDataSource(ds.Tables["student_registration"]);
CrystalReportViewer1.ReportSource = rpt;
CrystalReportViewer1.DataBind();

}
}
catch (Exception ex)
{
Response.Write(ex);
}
finally
{
cn.Close();
}

protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)


{
if (DropDownList2.Text == "All Student Report")
{

Department Of Computer Science and Applications, Bangalore University Page 111


ONLINE GROCERY SHOPPING
All_Student_report();
}
else if (DropDownList2.Text == "IndividualStudent Report") ;
{
Stud_reg();
}
}

SOFTWARE TESTING

Is the menu bar displayed in the appropriate contested some system


related features included either in menu s or tools? Do pull down menu
operation and tool bars work properly? Are all menu function and pull down
sub function properly listed? Is it possible to invoke each menu function
using logical assumptions that if all parts of the system are correct, the goal
will be successfully achieved? In adequate testing or non-testing will lead to
errors that may appear few months later.

This creates 2 problems


1. Time delay between the cause and appearance of the problem.
2. The effect of the system errors on files and records within the system

The purpose of the system testing is to consider all the likely variations to
which it will be suggested and push the systems to limits.

The testing process focuses on the logical intervals of the software


ensuring that all statements have been tested and on functional interval is
conducting tests to uncover errors and ensure that defined input will produce
actual results that agree with the required results.

Program level testing, modules level testing integrated and carried out.

Department Of Computer Science and Applications, Bangalore University Page 112


ONLINE GROCERY SHOPPING

There are two major type of testing they are

 White Box Testing


 Black Box Testing

White Box Testing

White box sometimes called “Glass box testing” is a test case


design uses the control structure of the procedural design to drive test case.

Using white box testing methods, the following tests were made on the system

a. All independent paths within a module have been exercised once. In our
system, ensuring that case was select and executed checked all case structures.
The bugs that were prevailing in some part of the code where fix.
b. All logical decisions were checked for the truth and falsity of the values .

Black Box Testing

Black box testing focuses on the functional requirements of the software. This is
black box testing enables the software engineering to drive a set of input conditions that will
fully exercise all functional requirements for a program. Black box testing rather it is
complementary approach that is likely to uncover a different class of errors that white box
methods like.

 Interface errors
 Performance in data structure
 Performance errors
 Initializing and termination errors

UNIT TESTING:

As this system was partially GUI based WINDOWS application, the following were
tested in this phase

Department Of Computer Science and Applications, Bangalore University Page 113


ONLINE GROCERY SHOPPING

1. Tab order
2. Reverse tab order
3. Field length
4. Front end validation
In our system, unit testing has been successfully handled. The test data was given to
each and every module in all respects and got the desired output. Each module has
been tested found working properly.

INTEGRATION TESTING:

Test data should be prepared carefully since the data only determines the efficiency
and accuracy of the system. Artificial data are prepared solely for testing. Every program
validates the input data.

Software verification and validation:

Software testing is used in association with verification and validation.

 Verification: Have we built the software right? (i.e., does it match the specification)
 Validation: Have we built the right software? (i.e., is this what the customer wants)

The terms verification and validation are commonly used in the industry; it is also
common to see these two terms incorrectly defined. According to the IEEE Standard
Glossary of Software Engineering Terminology:

Validation is the process of evaluating a system or component during or at the end of


the development process to determine whether it satisfies specified requirements.

CONCLUSION

Our project is a humble venture to satisfy the needs the needs in a library. Several
user friendly coding have also been adopted. This package shall prove to be a powerful
package in satisfying all the requirements of an organization.

The objective of software planning is to provide a framework that enables the manager to
make reasonable estimates made within a limited timeframe at the beginning of the software

Department Of Computer Science and Applications, Bangalore University Page 114


ONLINE GROCERY SHOPPING

project should be updated regularly as the project progresses. Last but not the least; it is not
the work paved the ways to success but ALMIGHTY.

FUTURE ENHACEMENT

Our Library Management System can be enhanced in future by installing Biometric


device to know the details of all the students and teachers. This helps the librarian to know
the status of books takes by any student or teacher.

We can also use Barcode reader to know the details of each and every book which
helps the librarian to issue books or take back the books in quick time

BIBLOGRAPHY

Professional .NET 2.0 Generics Tod Golding

Programming C# liberty

MICROSOFT SQL SERVER 2000- kuljit kaur

DATABASE DESIGN

Visual Basic . NET professional projects pooja bem

ONLINE REFERENCES:

 www.codeproject.com
 www.wikipedia.com

Department Of Computer Science and Applications, Bangalore University Page 115


ONLINE GROCERY SHOPPING

 www.stackverflow.com

Department Of Computer Science and Applications, Bangalore University Page 116

S-ar putea să vă placă și