Professional Documents
Culture Documents
PROJECT REPORT
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:
01 Acknowledgement
02 Introduction
03 Main Features
04 Description
05 UML Diagram
07 Conclusion
08 Future Scope
09 Reference
Advanced Object Oriented Programming
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.
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.
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.
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);
}
}
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);
}
}
name=myRes.getString(1);
specification=myRes.getString(2);
price= myRes.getInt(3);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}
}
catch(SQLException e)
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());
}
}
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);
CONCLUSION
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
So, in this way our management system works. It is very simple and easy to
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.
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
store or any kind of market which will use their database and keep
records of their customers and customers can also buy the products.