Pizza Order

November 27, 2017 | Author: Himakar Kilaru | Category: N/A
Share Embed Donate


Short Description

ip PRoject class 12...

Description

I.P PROJECT ON Pizza Order

Lal Krishna .G

CONTENT Frontend o

Admin Form (To add and update pizzas and view orders)

o

User Forms(To Order pizza)

Backend Mysql Tables with following description

Admin form

Coding for

button

String id=jTextField1.getText(); String pass=new String(jPasswordField1.getPassword());

if(id.equals("admin") && pass.equals("pass")) , dispose(); DefaultListModel dlm=(DefaultListModel) jList1.getModel(); dlm.removeAllElements(); jTextField2.setText(null); jTextField3.setText(null); jTextField4.setText(null); jTextField5.setText(null);

jTextField6.setText(null); jTextField7.setText(null); jTextArea1.setText(null); FormOrders.setVisible(true);

try ,

Class.forName("java.sql.DriverManager"); Connection con =(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/pizza","root",""); Statement stmt=(Statement)con.createStatement();

String qry="select id from orders order by id desc;";

ResultSet rs=stmt.executeQuery(qry);

while(rs.next()) , dlm.addElement(rs.getString(1)); -

catch(Exception e) ,

JOptionPane.showMessageDialog(this,e.getMessage()); else JOptionPane.showMessageDialog(this,"Incorrect login details");

New Pizza form

Coding for String loc=jTextField16.getText(); loc=loc.replace("\\", "\\\\");

button

if(loc.isEmpty()==false) , DefaultListModel model=(DefaultListModel)jList2.getModel(); model.addElement(loc);

jTextField16.setText(null); else JOptionPane.showMessageDialog(FormPizza,"Please add location of image first");

Coding for String loc=(String)jList2.getSelectedValue();

if(loc!=null) , jLabel6.setIcon(new ImageIcon(loc)); -

FormImage.setVisible(true);

button

Coding for String name=jTextField8.getText(); String type=""; if(jRadioButton1.isSelected()) type="veg"; else if(jRadioButton2.isSelected()) type="non-veg"; String desc=jTextArea2.getText(); double pprice=-1,mprice=-1,fprice=-1; int flag=0; try, pprice=Double.parseDouble(jTextField9.getText()); mprice=Double.parseDouble(jTextField10.getText()); fprice=Double.parseDouble(jTextField11.getText()); catch(Exception e)

button

, JOptionPane.showMessageDialog(FormPizza,"Invalid Input"); flag=1; -

if(flag==0) , if((name.isEmpty() || type.isEmpty() || desc.isEmpty() || pprice
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF