數(shù)據(jù)庫課程設(shè)計商品銷售管理系統(tǒng)_第1頁
數(shù)據(jù)庫課程設(shè)計商品銷售管理系統(tǒng)_第2頁
數(shù)據(jù)庫課程設(shè)計商品銷售管理系統(tǒng)_第3頁
已閱讀5頁,還剩42頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、public class LoginBackPanel extends JFrame implements ActionListener private static final long serialVersionUID = 1L;JButton button1,button2;JTextField F1;Choice c;Container ct = getContentPane();public LoginBackPanel(String str)super(str); setBak();JPanel panel = new JPanel(); panel.setOpaque(false

2、); ct.add(panel);panel.setLayout(new FlowLayout(FlowLayout.CENTER,60,20); c = new Choice();c.add(" Boss ");c.add(" Salesman ");JLabel J1 = new JLabel(" 驗證身份 :");JLabel J2 = new JLabel(" 登錄密碼 :");F1 = new JTextField(9);button1 = new JButton(" 登錄 "); b

3、utton2 = new JButton(" 退出 "); button1.addActionListener(this); button2.addActionListener(this); panel.add(J1);panel.add(c); panel.add(J2);panel.add(F1); panel.add(button1); panel.add(button2);add(panel);public void setBak()(JPanel)this.getContentPane().setOpaque(false);ImageIcon img = new

4、ImageIcon("e:/ 數(shù)據(jù)庫課程設(shè)計 /六月物語 .jpg");JLabel background = new JLabel(img); this.getLayeredPane().add(background, new Integer(Integer.MIN_V ALUE);backgro un d.setBo un ds(0, 0, img.getlc on Width(), img.getlc onH eight();Bosspublic void action Performed(Acti onEvent e)if(e.getSource()=butt on

5、 1)if(c.getSelectedltem().equals(”)&&F1.getText().equals("boss")this.dispose();BS bs=new BS("管理員界面"); bs.setSize(500,250); bs.setLocatio n(450,250);bs.setVisible(true);Salesma n if(c.getSelectedItem().equals("")&&F1.getText().equals("salesma n"

6、)this.dispose();SL sl=new SL("銷售員界面”); sl.setSize(500,250); sl.setLocati on (450,250);sl.setVisible(true);if(e.getSource()=butt on 2)System.exit(0);public static void main( Stri ngargs)Logi nBackPa nel Igp=n ew Log in BackPa nel("管理系統(tǒng)登錄");Igp.setDefaultCloseOperati on (JFrame.EXIT_ON_

7、CLOSE); lgp.setSize(300,200);lgp.setLocatio n(550,250);lgp.setVisible(true);class BS exte nds JFrame impleme nts Actio nListe nerJButton B1,B2,B3,B4,B5,B6,B7;Container ct = getC onten tPa ne(); public BS(String str)super(str);setBak();JPanel JP = new JPanel();JP.setOpaque(false);ct.add(JP);JP.setLay

8、out(new FlowLayout(FlowLayout.CENTER,30,50); B1 = new JButton(” 銷售情況");B2 = new JButton(” 客戶退貨");B3 = new JButton(” 銷售收款");B4 = new JButton("客戶信息”);B5 = new JButton(” 員工管理");B6 = new JButton(” 進(jìn)貨信息”);B7 = new JButton("更換角色");B1.addActio nListe ner(this);B2.addActio

9、 nListe ner(this);B3.addActio nListe ner(this);B4.addAct ion Liste ner(this);B5.addAct ion Liste ner(this);B6.addActio nListe ner(this);B7.addActio nListe ner(this);JP.add(B1);JP.add(B2);JP.add(B3);JP.add(B4);JP.add(B5);JP.add(B6);JP.add(B7); add(JP);public void setBak()(JPanel)this.getContentPane()

10、.setOpaque(false);ImageIcon img = new ImageIcon("e:/ 數(shù)據(jù)庫課程設(shè)計 /六月物語 1.jpg");JLabel background = new JLabel(img); this.getLayeredPane().add(background, new Integer(Integer.MIN_V ALUE);background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight();public void actionPerformed(ActionEvent e

11、)if(e.getSource()=B1)this.dispose();CXFPXX cxfpxx = new CXFPXX(" 日常銷售【發(fā)票情況】 ");cxfpxx.setSize(700,300);cxfpxx.setLocation(350,250);cxfpxx.setVisible(true);if(e.getSource()=B2)this.dispose();XSTHXX xsthxx = new XSTHXX(" 日常銷售【銷售退貨】 ");xsthxx.setSize(700,300);xsthxx.setLocation(350,

12、250);xsthxx.setVisible(true);if(e.getSource()=B3) this.dispose();XSXXCX xsxxcx = new XSXXCX(" 日常銷售【銷售收款】 ");xsxxcx.setSize(700,300);xsxxcx.setLocation(350,250);xsxxcx.setVisible(true);if(e.getSource()=B4)this.dispose();HYXXCX hyxxcx = new HYXXCX(" 基本信息管理【會員信息】 ");hyxxcx.setSize(7

13、00,300);hyxxcx.setLocation(350,250); hyxxcx.setVisible(true);if(e.getSource()=B5)this.dispose();YGGL yggl = new YGGL(" 員工管理【員工信息】 ");yggl.setSize(500,200);yggl.setLocation(450,250);yggl.setVisible(true);if(e.getSource()=B6)this.dispose();JHXX jhxx = new JHXX(" 商品更新【進(jìn)貨信息】 ");jhxx.

14、setSize(300,150);jhxx.setLocation(500,250);jhxx.setVisible(true);if(e.getSource()=B7)this.dispose();LoginBackPanel xt = new LoginBackPanel(" 管理系統(tǒng)登錄 ");xt.setSize(300,200);xt.setLocation(550,250);xt.setVisible(true);class BG2 extends AbstractTableModelString rq,ph,mc,bh,dj,sl,je;",&quo

15、t; 商品單價 /課程設(shè)計 "final String columnNames=" 開票日期 "," 銷售票號 ","商品名稱 ","商品編 元"," 銷售數(shù)量 /個"," 銷售金額 /元"Objectdata=new Object1007;public BG2()int m=0;String url="jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName=Connection con;String s

16、ql;Statement stmt;trytry con=DriverManager.getConnection(url,"sa","123456"); stmt=con.createStatement(); sql="SELECT * FROM 銷售發(fā)票 " ResultSet rs=stmt.executeQuery(sql); while(rs.next() rq=rs.getString(1); ph=rs.getString(2); mc=rs.getString(3); bh=rs.getString(4); dj=rs.

17、getString(5); sl=rs.getString(6); je=rs.getString(7);datam0=rq;datam1=ph;datam2=mc;datam3=bh;datam4=dj;datam5=sl;dat am+6=je;stmt.close(); con.close();catch(SQLException e)public int getColumnCount()return columnNames.length;public int getRowCount()return data.length;public String getColumnName(int

18、col)return columnNamescol;public Object getValueAt(int row,int col)return datarowcol;public void setValueAt(Object value,int row,int col)int numRows=getRowCount();int numCols=getColumnCount();for(int i=0;i<numRows;i+)for(int j=0;j<numCols;j+)class CXFPXX extends JFrame implements ActionListene

19、rBG2 bg2;JTable t;JButton b;JPanel p; JScrollPane s;public CXFPXX(String str) super(str);setLayout(new BorderLayout(); b = new JButton(" 確定 "); b.addActionListener(this); p = new JPanel();p.add(b);bg2 = new BG2();t = new JTable(bg2); s = new JScrollPane(t); add(s,"Center"); add(p

20、,"South");public void actionPerformed(ActionEvent e)if(e.getSource()=b)this.dispose();BS cxfpxx = new BS(" 管理員界面 "); cxfpxx.setSize(500,250); cxfpxx.setLocation(450,250); cxfpxx.setVisible(true);class BG3 extends AbstractTableModelString rq,mc,yy,sl,je;final String columnNames=&q

21、uot; 退貨日期 "," 商品名稱 ","退貨原因 ","退貨數(shù)量 /件","退貨金 額/元"Objectdata=new Object1005;public BG3()int m=0;String url="jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName= 課程設(shè)計 "Connection con;String sql;Statement stmt;trytry con=DriverManager.getConnectio

22、n(url,"sa","123456"); stmt=con.createStatement();sql="SELECT * FROM 退貨記錄 "ResultSet rs=stmt.executeQuery(sql); while(rs.next()rq=rs.getString(1);mc=rs.getString(2);yy=rs.getString(3);sl=rs.getString(4);je=rs.getString(5); datam0=rq;datam1=mc;datam2=yy;datam3=sl;datam+4=

23、je;stmt.close(); con.close();catch(SQLException e)public int getColumnCount()return columnNames.length;public int getRowCount()return data.length;public String getColumnName(int col)return columnNamescol;public Object getValueAt(int row,int col)return datarowcol;public void setValueAt(Object value,i

24、nt row,int col)int numRows=getRowCount();int numCols=getColumnCount();for(int i=0;i<numRows;i+)class XSTHXX extends JFrame implements ActionListenerBG3 bg3;JTable t;JButton b;JPanel p; JScrollPane s;public XSTHXX(String str)super(str);setLayout(new BorderLayout();b = new JButton(" 確定 ")

25、;b.addActionListener(this);p = new JPanel();p.add(b);bg3 = new BG3();t = new JTable(bg3);s = new JScrollPane(t);add(s,"Center"); add(p,"South");public void actionPerformed(ActionEvent e)if(e.getSource()=b)this.dispose();BS cxfpxx = new BS(" 管理員界面 "); cxfpxx.setSize(500,

26、250); cxfpxx.setLocation(450,250); cxfpxx.setVisible(true);class BG4 extends AbstractTableModelString rq,mc,dj,sl,je;final String columnNames=" 開票日期 ","商品名稱 ","商品單價 /元","銷售數(shù)量 /個","銷售 金額 / 元 "Objectdata=new Object1005;public BG4()int m=0;String url=&q

27、uot;jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName= 課程設(shè)計 "Connection con;String sql;Statement stmt;try con=DriverManager.getConnection(url,"sa","123456"); stmt=con.createStatement();sql="SELECT 開票日期 ,商品名稱 ,商品單價 /元,銷售數(shù)量 /個, 銷售金額 /元 FROM 銷售發(fā)票 "ResultSet rs=stm

28、t.executeQuery(sql); while(rs.next()rq=rs.getString(1);mc=rs.getString(2);dj=rs.getString(3);sl=rs.getString(4);je=rs.getString(5); datam0=rq;datam1=mc;datam2=dj;datam3=sl;datam+4=je;stmt.close(); con.close();catch(SQLException e)public int getColumnCount()return columnNames.length;public int getRow

29、Count()return data.length;public String getColumnName(int col)return columnNamescol;public Object getValueAt(int row,int col)return datarowcol;int numRows=getRowCount();int numCols=getColumnCount();for(int i=0;i<numRows;i+) for(int j=0;j<numCols;j+)class XSXXCX extends JFrame implements Action

30、ListenerBG4 bg4;JTable t;JButton b;JPanel p; JScrollPane s;public XSXXCX(String str) super(str);setLayout(new BorderLayout();b = new JButton(" 確定 ");b.addActionListener(this);p = new JPanel();p.add(b);bg4 = new BG4();t = new JTable(bg4);s = new JScrollPane(t);add(s,"Center"); add

31、(p,"South");public void actionPerformed(ActionEvent e)if(e.getSource()=b)this.dispose();BS cxfpxx = new BS(" 管理員界面 "); cxfpxx.setSize(500,250); cxfpxx.setLocation(450,250); cxfpxx.setVisible(true);class BG5 extends AbstractTableModelString ch,lx,dz,rq;final String columnNames=&qu

32、ot; 客戶稱呼 ","聯(lián)系方式 "," 客戶地址 "," 入會日期 "Objectdata=new Object1004; public BG5()int m=0;課程設(shè)計 "String url="jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName=Connection con;String sql;Statement stmt;trytry con=DriverManager.getConnection(url,"sa",&

33、quot;123456"); stmt=con.createStatement();sql="SELECT * FROM 客戶信息 "ResultSet rs=stmt.executeQuery(sql); while(rs.next()ch=rs.getString(1);lx=rs.getString(2);dz=rs.getString(3);rq=rs.getString(4); datam0=ch;datam1=lx;datam2=dz;datam+3=rq;stmt.close();con.close();catch(SQLException e)pu

34、blic int getColumnCount()return columnNames.length;public int getRowCount()return data.length;public String getColumnName(int col)return columnNamescol;public Object getValueAt(int row,int col)return datarowcol;int numRows=getRowCount();class HYXXCX extends JFrame implements ActionListener BG5 bg5;J

35、Table t;JButton b;JPanel p;JScrollPane s;public HYXXCX(String str)super(str); setLayout(new BorderLayout();b = new JButton(" 確定 "); b.addActionListener(this);p = new JPanel();p.add(b);bg5 = new BG5();t = new JTable(bg5);s = new JScrollPane(t);add(s,"Center"); add(p,"South&qu

36、ot;);public void actionPerformed(ActionEvent e) if(e.getSource()=b)this.dispose();BS cxfpxx = new BS(" 管理員界面 "); cxfpxx.setSize(500,250); cxfpxx.setLocation(450,250); cxfpxx.setVisible(true);class YGGL extends JFrame implements ActionListener JButton B1,B2,B3,B4,B5;Container ct = getConten

37、tPane(); public YGGL(String str)super(str);setBak();JPanel panel = new JPanel(); panel.setOpaque(false); panel.setLayout(new FlowLayout(FlowLayout.CENTER,60,40); B1 = new JButton(" 添加員工 ");B2 = new JButton(" 刪除員工 ");B3 = new JButton(" 員工名單 ");B4 = new JButton(" 更新信

38、息 ");B5 = new JButton(" 返回 ");B1.addActionListener(this);B2.addActionListener(this);B3.addActionListener(this);B4.addActionListener(this);B5.addActionListener(this); panel.add(B1); panel.add(B2); panel.add(B3); panel.add(B4); panel.add(B5);add(panel); public void setBak()(JPanel)this.

39、getContentPane().setOpaque(false);ImageIcon img = new ImageIcon("e:/ 數(shù)據(jù)庫課程設(shè)計 / 六月物語 1.jpg");JLabel background = new JLabel(img); this.getLayeredPane().add(background, new Integer(Integer.MIN_V ALUE);background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight(); public void actionPerfo

40、rmed(ActionEvent e) if(e.getSource()=B1) this.dispose();TJYG tjyg = new TJYG(" 員工管理【添加員工】 "); tjyg.setSize(400,350);tjyg.setLocation(450,200); tjyg.setVisible(true); if(e.getSource()=B2) this.dispose();SCYG scyg = new SCYG(" 員工管理【刪除員工】 "); scyg.setSize(300,150);scyg.setLocation(5

41、50,300); scyg.setVisible(true); if(e.getSource()=B3) this.dispose();YGMDXX ygmdxx = new YGMDXX(" 員工管理【員工名單】 ");ygmdxx.setSize(700,300); ygmdxx.setLocation(350,250); ygmdxx.setVisible(true); if(e.getSource()=B4) this.dispose(); GXXX gxxx = new GXXX(" 員工管理【更新信息】 "); gxxx.setSize(30

42、0,200);gxxx.setLocation(500,250); gxxx.setVisible(true); if(e.getSource()=B5) this.dispose(); BS bs = new BS(" 管理員界面 "); bs.setSize(500,250); bs.setLocation(450,250); bs.setVisible(true);class TJYG extends JFrame implements ActionListenerJLabel L1,L2,L3,L4,L5;JTextField T1,T2,T3,T4,T5;JBut

43、ton B1,B2;Container ct = getContentPane(); public TJYG(String str) super(str); setBak();JPanel panel = new JPanel(); panel.setOpaque(false); panel.setLayout(new FlowLayout(FlowLayout.CENTER,60,25); L1 = new JLabel(" 員工名稱 :");L2 = new JLabel(" 員工編號 :");L3 = new JLabel(" 員工職位

44、:");L4 = new JLabel(" 聘請日期 :");L5 = new JLabel(" 聯(lián)系方式 :");T1=new JTextField(10);T2=new JTextField(10);T3=new JTextField(10);T4=new JTextField(10);T5=new JTextField(10);B1 = new JButton(" 確定 ");B2 = new JButton(" 返回 ");B1.addActionListener(this);B2.addActi

45、onListener(this);panel.add(L1);panel.add(T1);panel.add(L2);panel.add(T2);panel.add(L3);panel.add(T3);panel.add(L4);panel.add(T4);panel.add(L5);panel.add(T5);panel.add(B1);panel.add(B2);add(panel);public void setBak() (JPanel)this.getContentPane().setOpaque(false);ImageIcon img = new ImageIcon("

46、e:/ 數(shù)據(jù)庫課程設(shè)計 / 六月物語 2.jpg");JLabel background = new JLabel(img);this.getLayeredPane().add(background, new Integer(Integer.MIN_V ALUE);background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight();public void actionPerformed(ActionEvent e)if(e.getSource()=B1)String url="jdbc:microsoft:s

47、qlserver:/localhost:1433;DatabaseName= 課程設(shè)計 "Connection con;String sql;Statement stmt;trytry con=DriverManager.getConnection(url,"sa","123456");stmt=con.createStatement();sql="INSERT INTO 人員管理 (員工名稱 ,員工編號 ,員工職位 ,聘請日期 ,聯(lián)系方式 ) VALUES('"+T1.getText()+"',&

48、#39;"+T2.getText()+"','"+T3.getText()+"','"+T4.getText()+"','"+T5.getTe xt()+"')"stmt.executeUpdate(sql);stmt.close();con.close();catch(SQLException e2) e2.printStackTrace();JOptionPane.showMessageDialog(this," 添 加 員 工 成 功

49、 ! "," 提 示 ",JOptionPane.INFORMA TION_MESSAGE);T1.setText("");T2.setText("");T3.setText("");T4.setText("");T5.setText(""); if(e.getSource()=B2)this.dispose();YGGL yggl=new YGGL(" 員工管理【員工信息】 ");yggl.setSize(500,200);yggl.setLo

50、cation(450,250);yggl.setVisible(true);class SCYG extends JFrame implements ActionListenerJLabel L1;JTextField T1;JButton B1,B2;Container ct = getContentPane();public SCYG(String str)super(str);setBak();JPanel panel = new JPanel();panel.setOpaque(false);panel.setLayout(new FlowLayout(FlowLayout.CENTE

51、R,60,20);L1 = new JLabel(" 員工名稱 :");T1=new JTextField(10);B1 = new JButton(" 確定 ");B2 = new JButton(" 返回 ");B1.addActionListener(this);B2.addActionListener(this);panel.add(L1);panel.add(T1);panel.add(B1);panel.add(B2);add(panel);public void setBak() (JPanel)this.getCont

52、entPane().setOpaque(false); ImageIcon img = new ImageIcon("e:/ 數(shù)據(jù)庫課程設(shè)計 / 六月物語 3.jpg");JLabel background = new JLabel(img); this.getLayeredPane().add(background, new Integer(Integer.MIN_V ALUE);background.setBounds(0, 0, img.getIconWidth(), img.getIconHeight();public void actionPerformed(Ac

53、tionEvent e) if(e.getSource()=B1)String url="jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName= 課程設(shè)計Connection con;String sql;Statement stmt;try con=DriverManager.getConnection(url,"sa","123456"); stmt=con.createStatement();sql="DELETE FROM 人員管理 WHERE( 員工名稱 ='&q

54、uot;+T1.getText()+"')"stmt.executeUpdate(sql);stmt.close(); con.close();catch(SQLException e2)e2.printStackTrace();JOptionPane.showMessageDialog(this," 成 功 刪 除 ! "," 提 ",JOptionPane.INFORMA TION_MESSAGE);T1.setText("");if(e.getSource()=B2) this.dispose();

55、YGGL yggl = new YGGL(" 員工管理【員工信息】 "); yggl.setSize(500,200); yggl.setLocation(450,250); yggl.setVisible(true);class BG6 extends AbstractTableModelString mc,bh,zw,rq,lx;final String columnNames=" 員工名稱 "," 員工編號 ","員工職位 ","聘請日期 ","聯(lián)系方式 "Object

56、data=new Object1005;public BG6()int m=0;String url="jdbc:microsoft:sqlserver:/localhost:1433;DatabaseName= 課程設(shè)計 "Connection con;String sql;Statement stmt;trytry con=DriverManager.getConnection(url,"sa","123456"); stmt=con.createStatement(); sql="SELECT * FROM 人員管理

57、" ResultSet rs=stmt.executeQuery(sql); while(rs.next()mc=rs.getString(1); bh=rs.getString(2); zw=rs.getString(3); rq=rs.getString(4); lx=rs.getString(5); datam0=mc;datam1=bh;datam2=zw;datam3=rq;datam+4=lx;stmt.close(); con.close();catch(SQLException e)public int getColumnCount()return columnNam

58、es.length; public int getRowCount() return data.length; public String getColumnName(int col) return columnNamescol;public Object getValueAt(int row,int col) return datarowcol;public void setValueAt(Object value,int row,int col) class YGMDXX extends JFrame implements ActionListener BG6 bg6;JTable t;

59、JButton b;JPanel p; JScrollPane s;public YGMDXX(String str) super(str);setLayout(new BorderLayout(); b = new JButton(" 確定 "); b.addActionListener(this); p = new JPanel();p.add(b); bg6 = new BG6(); t = new JTable(bg6); s = new JScrollPane(t); add(s,"Center");add(p,"South");public void actionPerformed(ActionEvent e)if(e.

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論