You are on page 1of 34

Advanced Object Oriented Programming

PROJECT REPORT

Advance Object Oriented Programming


(CE-206)
Fall Semester 2020

Submitted By:
Student 1: Muhammad Umer Ahsan (2020-CE-118)
Student 2: Muhammad Ahmed (2020-CE-112)
Student 3: Muhammad Haris Khan (2020-CE-110)
Student 4: Furqan Ayaz (2020-CE-105)
Student 5: Hadiqa Haneef (2020-CE-123)

Submitted To:

Course Teacher: Sir Adnan Afroz

Lab Teacher: Miss Samina Noureen

BILLING MANAGEMENT SYSTEM


Computer Engineering Department
Sir Syed University of Engineering & Technology
University Road, Karachi 75300
http://www.ssuet.edu.pk
Advanced Object Oriented Programming
Advanced Object Oriented Programming

BILLING MANAGEMENT SYSTEM OF ONLINE


SHOPPING STORE
Advanced Object Oriented Programming

S.No. Contents Pg. No.

01 Acknowledgement

02 Introduction

03 Main Features

04 Description

05 UML Diagram

06 Project Output Sample

07 Conclusion

08 Future Scope

09 Reference
Advanced Object Oriented Programming

The success and outcome of this project required a lot of guidance


and assistance from many people, and I am extremely privileged to
have this all along the completion of our project. All that we have
done is only due to such supervision and assistance and I would not
forget to thank them. We respect and
thank our lab teacher “MISS SAMINA”

In addition, our course teacher

“ MISS SAMINA” providing us an


opportunity to do the wonderful
project work, which helped us to do
some Research work as well.

We are extremely Thankful to them


for providing such great effort and
guidance.
We came up with so many new ideas. We
are thankful to and fortunate enough to get constant
encouragement. Support and guidance from all teaching staffs of
Computer Engineering Department. In addition, we would like to
extend our sincere esteems to all staff in laboratory for their timely
support.

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming

An online shopping system is a process in which people (specifical customers) are


being provided with the option of purchasing goods and services directly from
the seller, all in a real-time environment. Online shopping is an application of
the internet as electronic commerce. From the business perspective, customers
usually find the products more attractive, on websites, as they get all the
details available there.
People in large number are doing online shopping today, and it is not only
because it is convenient as one can shop from home, but also because there is an
ample number of varieties available, with a high competition of prices, and also
it is easy to navigate for searching regarding any particular item.
We have made a billing management system of online store in which we can
buy different products from different brands and we can add all these products
and our cart and at the end of shopping the invoice will be generated in which
individual prices and total amount will be given. In this way we can do our
shopping from online store with a very minimal effort.

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming

The Key features which are performed in this program are


given as under:

1. LOGIN :
The customer will login into his account using username and
password.

2. REGISTRATION:
New customer is required to register himself first then he will
login using username and password. The customers data will
be saved in a database.

3. CATOGARIES:
There are many categories of products like mobile phones,
electronics, household, beauty, etc.

4. BRAND:
This is for the items that belong to some brands and are kept
in the store. People’s choice varies with their taste and
standard of living. Most people these days prefer buying
branded items.

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming

5. PRODUCT:
This is the entity representing the items that customers
choose to buy. It can be added to the cart once the user
added it to the cart and then can be easily confirmed for
order.

6. BRAND-ID:
It is also the identification number given to the products for
uniquely identifying them.

7. QUANTITY:
The user can select the quantity of any product the that he
wants to buy.

8. CART:
A small place for the user to reserve their choice for checking
and finalizing till they end their shopping.

9. TOTAL:
This attribute manages the total price sum of the purchase or
transaction user has made in one attempt.

10. AMOUNT:
It is the record of the total sum amount the user needs to
pay.

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

Following is some of the key features of our system, which


distinguishes it from others:

 Display all the available categories for shopping on the


home page.

 Display all the subcategories on the home page, that are


associated with any particular item.

 Users have to register themselves in order to do online


shopping.

 Users can select the quantity of products that they want


to buy.

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

Basically we’ve created an online shopping cart in this project


using Data Base and GUI. A customer can login directly whose
username and password is already stored in the database table.

Those who don’t have their record needs to fill a registration


form in order to login to our shopping cart.

Then you’ll select the cart button in our homepage in order to


purchase the items of your choice.

We have created 6 catogaries which includes


“ELECTRONICS”,’CELLPHONE”“CLOTHING”,”BEAUTY” &
“HOUSEHOLD”. The customer will click any of the options of
his choice to purchase the desired items.

There is a button named as ADD TO CART. The customer will


press the button and select the quantity of the item he wants
to purchase.

The items which are added into the cart will move into a cart
table where all the items which the customer have selected will
be displayed.

Finally,there is a buy-now button under the cart table. As the


customer presses the button a BILL is generated where all the
items which the customer purchased will appear with its
specification & price. The total BILL is also generated.

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

public class Login1 {


public String userName;
public String Password;
Login1(String un,String pass)
{
userName=un;
Password=pass;
}
String getUserName()
{
return userName;
}
String getPassword()
{
return Password;
}
}
class store{
public String strNam;
public String strAd;
public int strPh;
store(String n,String a,int p)
{
strNam=n;
strAd=a;

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
strPh=p;
}
public String getNam()
{
return strNam;
}
public String getAd()
{
return strAd;
}
public int getPh()
{
return strPh;
}
}
class Invoice {
}
public class OrderManagementSystem {
public static void main(String[] args) {
Login lg=new Login();
lg.setVisible(true);
lg.pack();
lg.setLocationRelativeTo(null);
lg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
}
catch(SQLException e)
{
e.printStackTrace();
}
Scanner sc=new Scanner(System.in);
System.out.println("Enter user name");
String name=sc.next();
System.out.println("Enter Password");
String pass=sc.next();
Login1 obj1=new Login1(name,pass);
}}

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

private void jLabel3MouseClicked(java.awt.event.MouseEvent evt) {


Registrationform rf=new Registrationform();
rf.setVisible(true);
rf.pack();
rf.setLocationRelativeTo(null);
rf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


String usName=jTextField1.getText();
String pas=jPasswordField1.getText();

Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
COMPUTER ENGINEERING DEPARMENT
Advanced Object Oriented Programming (CE-206)

try{
//class.forName("com.mysql.jdbc.Driver");
int log=1;
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
myStat=(Statement) myCon.createStatement();
myRes=myStat.executeQuery("Select * from Login");
while(myRes.next()){
if(myRes.getString(1).equals(usName)&& myRes.getString(2).equals(pas))
{
log=0;
break;
}
}
if (log==0)
{
System.out.println("Sucessfully Login! ");
Home ic=new Home();
ic.setVisible(true);
ic.pack();
ic.setLocationRelativeTo(null);
ic.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}
else{
System.out.println("Sorry! ");
}
}
catch(SQLException ex){
Logger.getLogger(Login.class.getName()).log(Level.SEVERE,null,ex);
}
}

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


Login rf=new Login();
rf.setVisible(true);
rf.pack();
rf.setLocationRelativeTo(null);
rf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
}

private void jLabel3MouseClicked(java.awt.event.MouseEvent evt) {

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
Registrationform rf=new Registrationform();
rf.setVisible(true);
rf.pack();
rf.setLocationRelativeTo(null);
rf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


name=jTextField6.getText();
pass=jPasswordField1.getText();

Login1 obj= new Login1(name,pass);


obj.getPassword();
obj.getUserName();
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;

try{
//class.forName("com.mysql.jdbc.Driver");
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into Login values (?,?) ");
pstmt.setString(1,name);
pstmt.setString(2,pass);
int i=pstmt.executeUpdate();
if(i>0)
{
JOptionPane.showMessageDialog(null, "Data is saved! ");
}
else{
JOptionPane.showMessageDialog(null, "Data is not saved! ");
}
}
catch(SQLException e)
{
// e.printStackTrace();
JOptionPane.showMessageDialog(null, e);
}
}

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


pg1 d =new pg1();
jDesktopPane1.add(d);
d.setVisible(true);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
String name = null,specification = null;
int price = 0;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from cart" );
myRes.next();
COMPUTER ENGINEERING DEPARMENT
Advanced Object Oriented Programming (CE-206)

name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());

}
}

private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {


Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from Electronics" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this,e);}
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?)");
pstmt.setString(1,name);
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0){
System.out.println("Data is sent");
}
else{
System.out.println("Data is not sent");
}
}
catch(SQLException e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(this, e);
}
}

private void jButton23ActionPerformed(java.awt.event.ActionEvent evt) {


Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from cellphone" );
myRes.next();

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
name=myRes.getString(1);
specification=myRes.getString(2);
price =myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?) ");
pstmt.setString(1,name);
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0)
{
System.out.println("Data is sent");
}
else{
}
}
catch(SQLException e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(this, e);
}
}
private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from Electronics" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this,e);
}
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?) ");
pstmt.setString(1,name);
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0)
{
System.out.println("Data is sent");
}
else{
}
}
catch(SQLException e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(this, e);
}
}
private void jButton25ActionPerformed(java.awt.event.ActionEvent evt) {
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from cellphone" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
System.out.println(e.getMessage());
}
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?) ");
pstmt.setString(1,name);
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0)
{
System.out.println("Data is sent");
}
else{
System.out.println("Data is not sent");
}
}
catch(SQLException e)
{
}
}
private void jButton43ActionPerformed(java.awt.event.ActionEvent evt) {
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
String sapphire;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from Clothing" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
try{

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?)");
pstmt.setString(1,name);
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0)
{
System.out.println("Data is sent");
}
else{
System.out.print("Data is not sent");
}
}
catch(SQLException e)
{
}
}
private void jButton54ActionPerformed(java.awt.event.ActionEvent evt) {
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
String Retro;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from Beauty" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?) ");
pstmt.setString(1,name);

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0)
{
System.out.println("Data is sent");
}
else{
}
}
catch(SQLException e)
{
}
}
private void jButton56ActionPerformed(java.awt.event.ActionEvent evt) {
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from Beauty" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?) ");
pstmt.setString(1,name);
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0)
{

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
System.out.println("Data is sent");
}
else{
System.out.println("Data is not sent");
}
}
catch(SQLException e)
{
}
}
private void jButton33ActionPerformed(java.awt.event.ActionEvent evt) {
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
String Bed;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from household" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
try{
//class.forName("com.mysql.jdbc.Driver");
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?) ");
pstmt.setString(1,name);
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0)
{
System.out.println("Data is sent");
}

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
else{
System.out.println("Data is not sent");
}
}
catch(SQLException e)
{
}
}
private void jButton35ActionPerformed(java.awt.event.ActionEvent evt) {
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from household" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
try{
//class.forName("com.mysql.jdbc.Driver");
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?) ");
pstmt.setString(1,name);
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0)
{
System.out.println("Data is sent");
}
else{
}
}

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
catch(SQLException e)
{
}
}
private void jButton45ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
String khaddi;
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from Clothing" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
try{
//class.forName("com.mysql.jdbc.Driver");
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara" , "123");
pstmt=myCon.prepareStatement("insert into cart values (?,?,?) ");
pstmt.setString(1,name);
pstmt.setString(2,specification);
pstmt.setInt(3, price);
int i=pstmt.executeUpdate();
if(i>0)
{
System.out.println("Data is sent");
}
else{

}
}
catch(SQLException e)

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)
{
}
}
private void jButton57MouseClicked(java.awt.event.MouseEvent evt) {
Home rf=new Home();
rf.setVisible(true);
rf.pack();
rf.setLocationRelativeTo(null);
rf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
}

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

public cartdisplay() {
initComponents();
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from cart" );
ResultSetMetaData rsmd = myRes.getMetaData();
int columns = rsmd.getColumnCount();
DefaultTableModel dtm=new DefaultTableModel();
Vector Column_name=new Vector();
Vector data_rows=new Vector();
for(int i=1;i<=columns;i++){
Column_name.addElement(rsmd.getColumnName(i));
}
dtm.setColumnIdentifiers(Column_name);
while(myRes.next())
{
data_rows=new Vector();
COMPUTER ENGINEERING DEPARMENT
Advanced Object Oriented Programming (CE-206)
for(int j=1;j<=columns;j++)
{
data_rows.addElement(myRes.getString(j));
}
dtm.addRow(data_rows);
}
jTable1.setModel(dtm);
}
catch (Exception e)
{
System.out.println(e.getMessage());

}
}
private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {
String name,specification; int price;
invoice rf=new invoice();
rf.setVisible(true);
rf.pack();
rf.setLocationRelativeTo(null);
rf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.dispose();
try{
myCon=DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat=myCon.createStatement();
myRes=myStat.executeQuery("select * from cart" );
myRes.next();
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

public class invoice extends javax.swing.JFrame {


Connection myCon=null;
Statement myStat=null;
ResultSet myRes=null;
PreparedStatement pstmt=null;
String name; double price;
String specification;
public invoice() {
initComponents();
bill();
}
public void bill(){
try{
Class.forName("org.apache.derby.jdbc.ClientDriver");
COMPUTER ENGINEERING DEPARMENT
Advanced Object Oriented Programming (CE-206)

jTextArea3.setText("========================================================
=============="
+"\n Billing Management System" +

"\n==================================================================
===="
);
myCon = DriverManager.getConnection("jdbc:derby://localhost:1527/Sara","Sara","123");
myStat =
myCon.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
myRes=myStat.executeQuery("SELECT * FROM cart");
int i=0;
double Tprice=0;
while(myRes.next()){
i++;
jTextArea3.setText(jTextArea3.getText()+"\n Name "+i+": "+myRes.getString("name")+"\n
Specification : "+myRes.getString("specification")+"\n Price : "+myRes.getDouble("price")+

"\n==================================================================
====");
Tprice=Tprice+myRes.getDouble("price");
}
//long Plus_Tex=(long)(Tprice*0.05)+Tprice;
jTextArea3.setText(jTextArea3.getText()+"\nTotal Price : "+Tprice+

"\n==================================================================
===="
);
myStat = myCon.createStatement();
String query = "DELETE FROM cart";
int deletedRows=myStat.executeUpdate(query);
if(deletedRows>0){
System.out.println("Deleted All Rows In The Table Successfully...");
}else{
System.out.println("Table already empty.");
}
}catch(Exception s){
JOptionPane.showMessageDialog(this,s);

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

CONCLUSION

In this project, we have made billing management system of an online

shopping store. We have used various operations for users like there are

different products of different brands and we have made a cart in which all

the products that the user wants to buy that will be stored in a cart. After

clicking the buy now button the system will proceed to next operations and

invoice will be generated of the products that were in a cart.

So, in this way our management system works. It is very simple and easy to

use for everyone. It is software which can be easily understandable.

In future we will try to include many other option and features in this

project and we hope that more software like these are should be made to

provide the great experience for the ones who wants to shop online.

COMPUTER ENGINEERING DEPARMENT


Advanced Object Oriented Programming (CE-206)

This Software is designed to handle time and billing tracking as well

as invoicing customer for services and products. Our main idea is to

develop a system where we can have all the required information for

the user to effectively interest him in the process of using our software

and buying products. In the Proposed System, user can buy different

products and different brands are available, user can select quantity

as many as possible and prices are also placed under

every product for the conveniency of user.

The main goal of this project is designing and

developing an interactive system. This system will help every shopping

store or any kind of market which will use their database and keep

records of their customers and customers can also buy the products.

You might also like